summaryrefslogtreecommitdiff
path: root/src/keyboard.c
Commit message (Collapse)AuthorAgeFilesLines
* Handle X selection requests in input-pending-p.Chong Yidong2011-12-051-6/+19
| | | | | | | * src/keyboard.c (process_special_events): New function. (swallow_events, Finput_pending_p): Use it. Fixes: debbugs:10195
* Don't call Lisp in signal handlerAndreas Schwab2011-12-041-13/+16
| | | | | | | | | | * emacs.c (Qkill_emacs): Define. (syms_of_emacs): Initialize it. * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set Qquit_flag to `kill-emacs' instead. (quit_throw_to_read_char): Add parameter `from_signal'. All callers changed. Call Fkill_emacs if requested and safe. * lisp.h (QUIT): Call Fkill_emacs if requested.
* Spelling fixes.Paul Eggert2011-12-041-1/+1
|
* Fixes: debbugs:10169Andreas Schwab2011-12-011-1/+1
| | | | | * src/keyboard.c (interrupt_signal): Don't call kill-emacs when waiting for input.
* Remove GCPRO-related macros that exist only to avoid shadowing locals.Paul Eggert2011-11-281-7/+7
| | | | | | | | | * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR) (GCPRO6_VAR, UNGCPRO_VAR): Remove. See <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>. All uses changed to use GCPRO1 etc. (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO): Revert to old implementation (i.e., before 2011-03-11).
* Fix typos.Juanma Barranquero2011-11-201-1/+1
|
* Spelling fixes.Paul Eggert2011-11-191-1/+1
|
* Spelling fixes.Paul Eggert2011-11-191-1/+1
|
* Spelling fixes.Paul Eggert2011-11-171-2/+2
|
* Spelling fixes.Paul Eggert2011-11-141-1/+1
|
* Spelling fixes.Paul Eggert2011-11-131-1/+1
|
* Spelling fixes.Paul Eggert2011-11-111-1/+1
|
* * src/keyboard.c (interrupt_signal): Don't call kill-emacs while inAndreas Schwab2011-11-061-2/+6
| | | | GC.
* * src/lisp.h (struct Lisp_Symbol): Update comments.Stefan Monnier2011-10-281-62/+62
|
* Make function-key-map apply when key is bound to `undefined'.Stefan Monnier2011-10-251-2/+14
| | | | | | | * src/keyboard.c (test_undefined): New function. (read_key_sequence): Use it to detect when a key is bound to `undefined'. Fixes: debbugs:9751
* * src/keyboard.c (read_key_sequence_remapped): New var.Stefan Monnier2011-10-031-7/+13
| | | | | (read_key_sequence): Compute remapping in the right buffer. (command_loop_1): Use read_key_sequence's remapping directly.
* Whitespace changes.Juanma Barranquero2011-09-091-6/+6
|
* sprintf-related integer and memory overflow issues.Paul Eggert2011-08-291-18/+28
| | | | | | | | | | | | | | | | | | | | * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values. (esprintf, esnprintf, exprintf, evxprintf): New functions. * keyboard.c (command_loop_level): Now EMACS_INT, not int. (cmd_error): kbd macro iterations count is now EMACS_INT, not int. (modify_event_symbol): Do not assume that the length of name_alist_or_stem is safe to alloca and fits in int. (Fexecute_extended_command): Likewise for function name and binding. (Frecursion_depth): Wrap around reliably on integer overflow. * keymap.c (push_key_description): First arg is now EMACS_INT, not int, since some callers pass EMACS_INT values. (Fsingle_key_description): Don't crash if symbol name contains more than MAX_ALLOCA bytes. * minibuf.c (minibuf_level): Now EMACS_INT, not int. (get_minibuffer): Arg is now EMACS_INT, not int. * lisp.h (get_minibuffer, push_key_description): Reflect API changes. (esprintf, esnprintf, exprintf, evxprintf): New decls. * window.h (command_loop_level, minibuf_level): Reflect API changes.
* Merge from trunk.Paul Eggert2011-08-041-1/+1
|\
| * Check for pthread and use it if found.Jan Djärv2011-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | * configure.in (HAVE_PTHREAD): Add check for -lpthread. (HAVE_GTK_AND_PTHREAD): Remove. * src/Makefile.in (LIB_PTHREAD): New variable. (LIBES): Add LIB_PTHREAD (Bug#9216). * src/alloc.c, src/emacs.c, src/gmalloc.c, src/gtkutil.c, src/keyboard.c, src/syssignal.h: Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
* | * keyboard.c: Integer and memory overflow fixes.Paul Eggert2011-07-281-42/+38
| | | | | | | | | | | | | | | | | | | | (read_char, menu_bar_items, tool_bar_items, read_char_x_menu_prompt) (read_char_minibuf_menu_width, read_char_minibuf_menu_prompt) (follow_key, read_key_sequence): Use ptrdiff_t, not int, to count maps. (read_char_minibuf_menu_prompt): Check for overflow in size calculations. Don't update size until allocation succeeds. Redo calculations to avoid overflow. * keyboard.h: Change prototypes to match the above.
* | * keyboard.c: Overflow, signedness and related fixes.Paul Eggert2011-07-161-10/+11
|/ | | | | | | | | | | | | | (make_lispy_movement): Use same integer type in forward decl that is used in the definition. (read_key_sequence, keyremap_step): Change bufsize argument back to int, undoing my 2011-03-30 change. We prefer signed types, and int is wide enough here. (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string length, not size_t. Use ptrdiff_t for index, not int. (keyremap_step, read_key_sequence): Redo bufsize check to avoid possibility of integer overflow.
* Merge from trunk.Paul Eggert2011-07-141-1/+2
|\
| * * keyboard.c (Fopen_dribble_file): Document when the file is closed.Lars Magne Ingebrigtsen2011-07-141-1/+2
| | | | | | | | Fixes: debbugs:8056
* | * keyboard.h (num_input_events): Now uintmax_t.Paul Eggert2011-07-071-2/+2
|/ | | | | This is (very slightly) less likely to mess up due to wraparound. All uses changed.
* Fix corner case in prefix-arg handling for mouse events (Bug#1586).Chong Yidong2011-07-021-1/+12
| | | | | * src/keyboard.c (command_loop_1): If a down-mouse event is unbound, leave any prefix arg for the up event.
* Add multiple inheritance to keymaps.Stefan Monnier2011-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/keymap.c (Fmake_composed_keymap): New function. (Fset_keymap_parent): Simplify. (fix_submap_inheritance): Remove. (access_keymap_1): New function extracted from access_keymap to handle embedded parents and handle lists of maps. (access_keymap): Use it. (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap) (Fcopy_keymap): Handle embedded parents. (Fcommand_remapping, define_as_prefix): Simplify. (Fkey_binding): Simplify. (syms_of_keymap): Move minibuffer-local-completion-map, minibuffer-local-filename-completion-map, minibuffer-local-must-match-map, and minibuffer-local-filename-must-match-map to Elisp. (syms_of_keymap): Defsubr make-composed-keymap. * src/keyboard.c (menu_bar_items): Use map_keymap_canonical. (parse_menu_item): Trivial simplification. * lisp/subr.el (remq): Don't allocate if it's not needed. (keymap--menu-item-binding, keymap--menu-item-with-binding) (keymap--merge-bindings): New functions. (keymap-canonicalize): Use them to refine the canonicalization. * lisp/minibuffer.el (minibuffer-local-completion-map) (minibuffer-local-must-match-map): Move initialization from C. (minibuffer-local-filename-completion-map): Move initialization from C; don't inherit from anything here. (minibuffer-local-filename-must-match-map): Make obsolete. (completing-read-default): Use make-composed-keymap to combine minibuffer-local-filename-completion-map with either minibuffer-local-must-match-map or minibuffer-local-filename-completion-map.
* * keyboard.c (parse_tool_bar_item): Avoid need for strlen.Paul Eggert2011-06-191-2/+2
|
* Variadic C functions now count arguments with ptrdiff_t.Paul Eggert2011-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This partly undoes my 2011-03-30 change, which replaced int with size_t. Back then I didn't know that the Emacs coding style prefers signed int. Also, in the meantime I found a few more instances where arguments were being counted with int, which may truncate counts on 64-bit machines, or EMACS_INT, which may be unnecessarily wide. * lisp.h (struct Lisp_Subr.function.aMANY) (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Arg counts are now ptrdiff_t, not size_t. All variadic functions and their callers changed accordingly. (struct gcpro.nvars): Now size_t, not size_t. All uses changed. * bytecode.c (exec_byte_code): Check maxdepth for overflow, to avoid potential buffer overrun. Don't assume arg counts fit in 'int'. * callint.c (Fcall_interactively): Check arg count for overflow, to avoid potential buffer overrun. Use signed char, not 'int', for 'varies' array, so that we needn't bother to check its size calculation for overflow. * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args. * eval.c (apply_lambda): * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length. (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed. (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
* * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.Paul Eggert2011-06-121-3/+3
|
* Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.Paul Eggert2011-06-121-6/+2
| | | | | | These casts should not be needed on 32-bit hosts, either. * keyboard.c (read_char): * lread.c (Fload): Remove casts to unsigned.
* * lisp.h (UNSIGNED_CMP): New macro.Paul Eggert2011-06-121-2/+6
| | | | | | | | | | | This fixes comparison bugs on 64-bit hosts. (ASCII_CHAR_P): Use it. * casefiddle.c (casify_object): * character.h (ASCII_BYTE_P, CHAR_VALID_P): (SINGLE_BYTE_CHAR_P, CHAR_STRING): * composite.h (COMPOSITION_ENCODE_RULE_VALID): * dispextern.h (FACE_FROM_ID): * keyboard.c (read_char): Use UNSIGNED_CMP.
* Minor fixes for signed vs unsigned integers.Paul Eggert2011-06-051-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * character.h (MAYBE_UNIFY_CHAR): * charset.c (maybe_unify_char): * keyboard.c (read_char, reorder_modifiers): XINT -> XFASTINT, since the integer must be nonnegative. * ftfont.c (ftfont_spec_pattern): * keymap.c (access_keymap, silly_event_symbol_error): XUINT -> XFASTINT, since the integer must be nonnegative. (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT, since it makes no difference and we prefer signed. * keyboard.c (record_char): Use XUINT when all the neighbors do. (access_keymap): NATNUMP -> INTEGERP, since the integer must be nonnegative.
| * Minor fixes for signed vs unsigned integers.Paul Eggert2011-05-311-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * character.h (MAYBE_UNIFY_CHAR): * charset.c (maybe_unify_char): * keyboard.c (read_char, reorder_modifiers): XINT -> XFASTINT, since the integer must be nonnegative. * ftfont.c (ftfont_spec_pattern): * keymap.c (access_keymap, silly_event_symbol_error): XUINT -> XFASTINT, since the integer must be nonnegative. (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT, since it makes no difference and we prefer signed. * keyboard.c (record_char): Use XUINT when all the neighbors do. (access_keymap): NATNUMP -> INTEGERP, since the integer must be nonnegative.
* | Support bidi reordering of text covered by display properties.Eli Zaretskii2011-06-041-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/bidi.c (bidi_copy_it): Use offsetof instead of emulating it. (bidi_fetch_char, bidi_fetch_char_advance): New functions. (bidi_cache_search, bidi_cache_iterator_state) (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak) (bidi_level_of_next_char, bidi_move_to_visually_next): Support character positions inside a run of characters covered by a display string. (bidi_paragraph_init, bidi_resolve_explicit_1) (bidi_level_of_next_char): Call bidi_fetch_char and bidi_fetch_char_advance instead of FETCH_CHAR and FETCH_CHAR_ADVANCE. (bidi_init_it): Initialize new members. (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro definitions. (bidi_explicit_dir_char): Lookup character type in bidi_type_table, instead of using explicit *_CHAR codes. (bidi_resolve_explicit, bidi_resolve_weak): Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of bidirectional text is supported only in multibyte buffers. (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use it to initialize the frame_window_p member of struct bidi_it. (bidi_cache_iterator_state, bidi_resolve_explicit_1) (bidi_resolve_explicit, bidi_resolve_weak) (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if bidi_it->nchars is non-positive. (bidi_level_of_next_char): Don't try to lookup the cache for the next/previous character if nothing is cached there yet, or if we were just reseat()'ed to a new position. src/xdisp.c (set_cursor_from_row): Set start and stop points according to the row's direction when priming the loop that looks for the glyph on which to display cursor. (single_display_spec_intangible_p): Function deleted. (display_prop_intangible_p): Reimplement to call handle_display_spec instead of single_display_spec_intangible_p. Accept 3 additional arguments needed by handle_display_spec. This fixes incorrect cursor motion across display property with complex values: lists, `(when COND...)' forms, etc. (single_display_spec_string_p): Support property values that are lists with the argument STRING its top-level element. (display_prop_string_p): Fix the condition for processing a property that is a list to be consistent with handle_display_spec. (handle_display_spec): New function, refactored from the last portion of handle_display_prop. (compute_display_string_pos): Accept additional argument FRAME_WINDOW_P. Call handle_display_spec to determine whether the value of a `display' property is a "replacing spec". (handle_single_display_spec): Accept 2 additional arguments BUFPOS and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from the display property, but just return a value indicating whether the display property will replace the characters it covers. (Fcurrent_bidi_paragraph_direction): Initialize the nchars and frame_window_p members of struct bidi_it. (compute_display_string_pos, compute_display_string_end): New functions. (push_it): Accept second argument POSITION, where pop_it should jump to continue iteration. (reseat_1): Initialize bidi_it.disp_pos. src/keyboard.c (adjust_point_for_property): Adjust the call to display_prop_intangible_p to its new signature. src/dispextern.h (struct bidi_it): New member frame_window_p. (bidi_init_it): Update prototypes. (display_prop_intangible_p): Update prototype. (compute_display_string_pos, compute_display_string_end): Declare prototypes. (struct bidi_it): New members nchars and disp_pos. ch_len is now EMACS_INT.
| * Fix cursor motion across display strings covering reordered text.Eli Zaretskii2011-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/xdisp.c (set_cursor_from_row): Set start and stop points according to the row's direction when priming the loop that looks for the glyph on which to display cursor. (single_display_spec_intangible_p): Function deleted. (display_prop_intangible_p): Reimplement to call handle_display_spec instead of single_display_spec_intangible_p. Accept 3 additional arguments needed by handle_display_spec. This fixes incorrect cursor motion across display property with complex values: lists, `(when COND...)' forms, etc. (single_display_spec_string_p): Support property values that are lists with the argument STRING its top-level element. (display_prop_string_p): Fix the condition for processing a property that is a list to be consistent with handle_display_spec. src/keyboard.c (adjust_point_for_property): Adjust the call to display_prop_intangible_p to its new signature. src/dispextern.h (display_prop_intangible_p): Adjust prototype.
* | [ChangeLog]Paul Eggert2011-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use 'inline', not 'INLINE'. * configure.in, autogen/config.in (INLINE): Remove. [lib-src/ChangeLog] Use 'inline', not 'INLINE'. * etags.c (hash): Now inline unconditionally. * make-docfile.c (put_char): inline, not INLINE. [nt/ChangeLog] Use 'inline', not 'INLINE'. * config.nt (INLINE): Remove. [src/ChangeLog] Use 'inline', not 'INLINE'. * alloc.c, fontset.c (INLINE): Remove. * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c: * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c: * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline. * gmalloc.c (register_heapinfo): Use inline unconditionally. * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
* | Be more systematic about user-interface timestamps.Paul Eggert2011-05-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, the code sometimes used 'Time', sometimes 'unsigned long', and sometimes 'EMACS_UINT', to represent these timestamps. This change causes it to use 'Time' uniformly, as that's what X uses. This makes the code easier to follow, and makes it easier to catch integer overflow bugs such as Bug#8664. * frame.c (Fmouse_position, Fmouse_pixel_position): Use Time, not unsigned long, for user-interface timestamps. * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise. (button_down_time, make_lispy_position, make_lispy_movement): Likewise. * keyboard.h (last_event_timestamp): Likewise. * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise. * menu.h (xmenu_show): Likewise. * term.c (term_mouse_position): Likewise. * termhooks.h (struct input_event.timestamp): Likewise. (struct terminal.mouse_position_hook): Likewise. * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise. * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise. * systime.h (Time): New decl. Pull it in from <X11/X.h> if HAVE_X_WINDOWS, otherwise define it as unsigned long, which is what it was before. * menu.h, termhooks.h: Include "systime.h", for Time.
* | * keyboard.c (make_lispy_event): Fix problem in integer overflow.Paul Eggert2011-05-121-6/+6
|/ | | | | | | | | | Don't assume that the difference between two unsigned long values can fit into an integer. At this point, we know button_down_time <= event->timestamp, so the difference must be nonnegative, so there's no need to cast the result if double-click-time is nonnegative, as it should be; check that it's nonnegative, just in case. This bug is triggered when events are more than 2**31 ms apart (about 25 days).
* Add delayed warnings support.Juanma Barranquero2011-04-281-0/+19
| | | | | | | | | | | | | * etc/NEWS: Document `delayed-warnings-list' and `delayed-warnings-hook'. * lisp/subr.el (display-delayed-warnings): New function. (delayed-warnings-hook): New variable. * src/keyboard.c (Qdelayed_warnings_hook): Define. (command_loop_1): Run `delayed-warnings-hook' if Vdelayed_warnings_list is non-nil. (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it. (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
* * keyboard.c (handle_user_signal): Fix pointer signedness problem.Paul Eggert2011-04-261-5/+5
|
* Merge from mainline.Paul Eggert2011-04-261-4/+32
|\
| * src/keyboard.c (QCrtl): Rename from Qrtl. All uses changed.Juanma Barranquero2011-04-261-3/+3
| |
| * Implement debug-on-eventDaniel Colascione2011-04-261-1/+29
| |
* | * lisp.h: (XVECTOR_SIZE): Remove. All uses replaced with ASIZE.Paul Eggert2011-04-251-18/+18
| | | | | | | | | | (ASIZE): Now contains previous implementation of XVECTOR_SIZE instead of invoking XVECTOR_SIZE.
* | lisp.h: Fix a problem with aliasing and vector headers.Paul Eggert2011-04-251-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.6.0 optimizes based on type-based alias analysis. For example, if b is of type struct buffer * and v of type struct Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size != &v->size, and therefore "v->size = 1; b->size = 2; return v->size;" must therefore return 1. This assumption is incorrect for Emacs, since it type-puns struct Lisp_Vector * with many other types. To fix this problem, this patch adds a new type struct vector_header that documents the constraints on layout of vectors and pseudovectors, and helps optimizing compilers not get fooled by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons. * lisp.h (XVECTOR_SIZE): New convenience macro. All previous uses of XVECTOR (foo)->size replaced to use this macro, to avoid the hassle of writing XVECTOR (foo)->header.size. (XVECTOR_HEADER_SIZE): New macro, for use in XSETPSEUDOVECTOR. (XSETTYPED_PVECTYPE): New macro, specifying the name of the size member. (XSETPVECTYPE): Rewrite in terms of new macro. (XSETPVECTYPESIZE): New macro, specifying both type and size. This is a bit clearer, and further avoids the possibility of undesirable aliasing. (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size. (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XVECTOR_HEADER_SIZE. (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE, since Lisp_Subr is a special case (no "next" field). (ASIZE): Rewrite in terms of XVECTOR_SIZE. (struct vector_header): New type. (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the object, to help avoid aliasing. (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP. (SUBRP): Likewise, since Lisp_Subr is a special case. * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table): (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector): (struct Lisp_Hash_Table): Combine first two members into a single struct vector_header member. All uses of "size" and "next" members changed to be "header.size" and "header.next". * buffer.h (struct buffer): Likewise. * font.h (struct font_spec, struct font_entity, struct font): Likewise. * frame.h (struct frame): Likewise. * process.h (struct Lisp_Process): Likewise. * termhooks.h (struct terminal): Likewise. * window.c (struct save_window_data, struct saved_window): Likewise. * window.h (struct window): Likewise. * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector): Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems. * buffer.c (init_buffer_once): Likewise. * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a special case. * process.c (Fformat_network_address): Use local var for size, for brevity.
* | Replace pEd with more-general pI, and fix some printf arg casts.Paul Eggert2011-04-181-4/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp.h (pI): New macro, generalizing old pEd macro to other conversion specifiers. For example, use "...%"pI"d..." rather than "...%"pEd"...". (pEd): Remove. All uses replaced with similar uses of pI. * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise. * alloc.c (check_pure_size): Don't overflow by converting size to int. * bidi.c (bidi_dump_cached_states): Use pI to avoid cast. * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort. * dbusbind.c (xd_append_arg): Use pI to avoid cast. (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise. * font.c (font_unparse_xlfd): Avoid potential buffer overrun on 64-bit hosts. (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts. * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts. * print.c (safe_debug_print, print_object): Likewise. (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT to int. Use pI instead of if-then-else-abort. Use %p to avoid casts. * process.c (Fmake_network_process): Use pI to avoid cast. * region-cache.c (pp_cache): Likewise. * xdisp.c (decode_mode_spec): Likewise. * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined behavior on 64-bit hosts with printf arg. * xselect.c (x_queue_event): Use %p to avoid casts. (x_stop_queuing_selection_requests): Likewise. (x_get_window_property): Don't truncate byte count to an 'int' when tracing.
* * keyboard.c (read_char): Make a var volatile so longjmp won't clobberPaul Eggert2011-04-161-1/+1
| | | | it.
* * keyboard.c (make_lispy_event): Remove unused local var.Paul Eggert2011-04-161-1/+0
|
* Fix link errors in the Mac OS build that were caused by variables being ↵Ben Key2011-04-141-1/+1
| | | | marked as static that should not have been.