1 2011-06-13 Paul Eggert <eggert@cs.ucla.edu>
3 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
5 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
7 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
9 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13 GLYPH_CODE_FACE returns EMACS_INT, not int.
14 * dispextern.h (merge_faces):
15 * xfaces.c (merge_faces):
16 * xdisp.c (get_next_display_element):
17 (next_element_from_display_vector): Don't assume EMACS_INT fits in int.
19 * character.h (CHAR_VALID_P): Remove unused parameter.
20 * fontset.c, lisp.h, xdisp.c: All uses changed.
22 * editfns.c (Ftranslate_region_internal): Omit redundant test.
24 * fns.c (concat): Minor tuning based on overflow analysis.
25 This doesn't fix any bugs. Use int to hold character, instead
26 of constantly refetching from Emacs object. Use XFASTINT, not
27 XINT, for value known to be a character. Don't bother comparing
28 a single byte to 0400, as it's always less.
31 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
33 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
36 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
38 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
39 Without this fix, on a 64-bit host (aset S 0 4294967386) would
40 incorrectly succeed when S was a string, because 4294967386 was
41 truncated before it was used.
43 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
44 Otherwise, an out-of-range integer could cause undefined behavior
47 * composite.c: Use int, not EMACS_INT, for characters.
48 (fill_gstring_body, composition_compute_stop_pos): Use int, not
49 EMACS_INT, for values that are known to be in character range.
50 This doesn't fix any bugs but is the usual style inside Emacs and
51 may generate better code on 32-bit machines.
53 Make sure a 64-bit char is never passed to ENCODE_CHAR.
54 This is for reasons similar to the recent CHAR_STRING fix.
55 * charset.c (Fencode_char): Check that character arg is actually
56 a character. Pass an int to ENCODE_CHAR.
57 * charset.h (ENCODE_CHAR): Verify that the character argument is no
58 wider than 'int', as a compile-time check to prevent future regressions
61 * character.c (char_string): Remove unnecessary casts.
63 Make sure a 64-bit char is never passed to CHAR_STRING.
64 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
65 by silently ignoring the top 32 bits, allowing some values
66 that were far too large to be valid characters.
67 * character.h: Include <verify.h>.
68 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
69 arguments are no wider than unsigned, as a compile-time check
70 to prevent future regressions in this area.
72 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char):
73 (Fsubst_char_in_region):
75 * xdisp.c (decode_mode_spec_coding):
76 Adjust to CHAR_STRING's new requirement.
77 * editfns.c (Finsert_char, Fsubst_char_in_region):
78 * fns.c (concat): Check that character args are actually
79 characters. Without this test, these functions did the wrong
80 thing with wildly out-of-range values on 64-bit hosts.
82 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
84 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
85 These casts should not be needed on 32-bit hosts, either.
86 * keyboard.c (read_char):
87 * lread.c (Fload): Remove casts to unsigned.
89 * lisp.h (UNSIGNED_CMP): New macro.
90 This fixes comparison bugs on 64-bit hosts.
91 (ASCII_CHAR_P): Use it.
92 * casefiddle.c (casify_object):
93 * character.h (ASCII_BYTE_P, CHAR_VALID_P):
94 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
95 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
96 * dispextern.h (FACE_FROM_ID):
97 * keyboard.c (read_char): Use UNSIGNED_CMP.
99 2011-06-11 Paul Eggert <eggert@cs.ucla.edu>
101 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
102 not to EMACS_INT, to avoid GCC warning.
104 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
106 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
107 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
108 isn't needed on 32-bit machines.
110 * buffer.c (Fgenerate_new_buffer_name): Use EMACS_INT for count, not int.
111 (advance_to_char_boundary): Return EMACS_INT, not int.
113 * data.c (Qcompiled_function): Now static.
115 * window.c (window_body_lines): Now static.
117 * image.c (gif_load): Rename local to avoid shadowing.
119 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
120 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
121 * alloc.c (make_save_value): Integer argument is now of type
123 (mark_object): Use ptrdiff_t, not int.
124 * lisp.h (pD): New macro.
125 * print.c (print_object): Use it.
127 * alloc.c: Use EMACS_INT, not int, to count objects.
128 (total_conses, total_markers, total_symbols, total_vector_size)
129 (total_free_conses, total_free_markers, total_free_symbols)
130 (total_free_floats, total_floats, total_free_intervals, total_intervals)
131 (total_strings, total_free_strings):
132 Now EMACS_INT, not int. All uses changed.
133 (Fgarbage_collect): Compute overall total using a double, so that
134 integer overflow is less likely to be a problem. Check for overflow
135 when converting back to an integer.
136 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
137 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
138 These were 'int' variables that could overflow on 64-bit hosts;
139 they were never used, so remove them instead of repairing them.
140 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
141 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
142 Previously, this ceilinged at INT_MAX, but that doesn't work on
144 (allocate_pseudovector): Don't use EMACS_INT when int would do.
146 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
147 (allocate_vectorlike): Check for ptrdiff_t overflow.
148 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
149 when a (possibly-narrower) signed value would do just as well.
150 We prefer using signed arithmetic, to avoid comparison confusion.
152 * alloc.c: Catch some string size overflows that we were missing.
153 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
154 for convenience in STRING_BYTES_MAX.
155 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
156 The definition here is exact; the one in lisp.h was approximate.
157 (allocate_string_data): Check for string overflow. This catches
158 some instances we weren't catching before. Also, it catches
159 size_t overflow on (unusual) hosts where SIZE_MAX <= min
160 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
161 and ptrdiff_t and EMACS_INT are both 64 bits.
163 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
164 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
165 * lisp.h (STRING_BYTES_BOUND): Renamed from STRING_BYTES_MAX.
167 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
169 * alloc.c (Fmake_string): Check for out-of-range init.
171 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
173 * dispextern.h (struct image): Replace data member, whose int_val
174 and ptr_val fields were not used by anything, with a single
177 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
178 (gif_clear_image, gif_load, imagemagick_load_image)
179 (gs_clear_image, gs_load): Callers changed.
181 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
183 * buffer.h: Include <time.h>, for time_t.
184 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
186 Fix minor problems found by static checking.
188 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
190 Make identifiers static if they are not used in other modules.
191 * data.c (Qcompiled_function, Qframe, Qvector):
192 * image.c (QimageMagick, Qsvg):
193 * minibuf.c (Qmetadata):
194 * window.c (resize_window_check, resize_root_window): Now static.
195 * window.h (resize_window_check, resize_root_window): Remove decls.
197 * window.c (window_deletion_count, delete_deletable_window):
199 (window_body_lines): Now static.
200 (Fdelete_other_windows_internal): Mark vars as initialized.
201 Make sure 'resize_failed' is initialized.
202 (run_window_configuration_change_hook): Rename local to avoid shadowing.
203 (resize_window_apply): Remove unused local.
204 * window.h (delete_deletable_window): Remove decl.
206 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
207 (imagemagick_load_image): Fix pointer signedness problem by changing
208 last arg from unsigned char * to char *. All uses changed.
209 Also, fix a local for similar reasons.
210 Remove unused locals. Remove locals to avoid shadowing.
211 (fn_rsvg_handle_free): Remove; unused.
212 (svg_load, svg_load_image): Fix pointer signedness problem.
213 (imagemagick_load_image): Don't use garbage pointer image_wand.
215 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
217 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
219 * image.c (gif_load): Fix omitted cast error introduced by
222 2011-06-10 Martin Rudalics <rudalics@gmx.at>
224 * window.h (resize_proportionally, orig_total_lines)
225 (orig_top_line): Remove from window structure.
226 (set_window_height, set_window_width, change_window_heights)
227 (Fdelete_window): Remove prototypes.
228 (resize_frame_windows): Remove duplicate declaration.
230 2011-06-10 Eli Zaretskii <eliz@gnu.org>
232 * window.h (resize_frame_windows, resize_window_check)
233 (delete_deletable_window, resize_root_window)
234 (resize_frame_windows): Declare prototypes.
236 * window.c (resize_window_apply): Make definition be "static" to
239 2011-06-10 Martin Rudalics <rudalics@gmx.at>
241 * window.c: Remove declarations of Qwindow_size_fixed,
242 window_min_size_1, window_min_size_2, window_min_size,
243 size_window, window_fixed_size_p, enlarge_window, delete_window.
244 Remove static from declaration of Qdelete_window, it's
245 temporarily needed by Fbury_buffer.
246 (replace_window): Don't assign orig_top_line and
248 (Fdelete_window, delete_window): Remove. Window deletion is
249 handled by window.el.
250 (window_loop): Remove DELETE_OTHER_WINDOWS case. Replace
251 Fdelete_window calls with calls to Qdelete_window.
252 (Fdelete_other_windows): Remove. Deleting other windows is
253 handled by window.el.
254 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
255 handled in window.el.
256 (window_min_size_2, window_min_size_1, window_min_size): Remove.
257 Window minimum sizes are handled in window.el.
258 (shrink_windows, size_window, set_window_height)
259 (set_window_width, change_window_heights, window_height)
260 (window_width, CURBEG, CURSIZE, enlarge_window)
261 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
262 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
263 handled in window.el.
264 (make_dummy_parent): Rename to make_parent_window and give it a
265 second argument horflag.
266 (make_window): Don't set resize_proportionally any more.
267 (Fsplit_window): Remove. Windows are split in window.el.
268 (save_restore_action, save_restore_orig_size)
269 (shrink_window_lowest_first, save_restore_orig_size): Remove.
270 Resize mini windows in window.el.
271 (grow_mini_window, shrink_mini_window): Implement by calling
272 Qresize_root_window_vertically, resize_window_check and
274 (saved_window, Fset_window_configuration, save_window_save): Do
275 not handle orig_top_line, orig_total_lines, and
276 resize_proportionally.
277 (window_min_height, window_min_width): Move to window.el.
278 (keys_of_window): Move bindings for delete-other-windows,
279 split-window, delete-window and enlarge-window to window.el.
281 * buffer.c: Temporarily extern Qdelete_window.
282 (Fbury_buffer): Temporarily call Qdelete_window instead of
283 Fdelete_window (Fbury_buffer will move to window.el soon).
285 * frame.c (set_menu_bar_lines_1): Remove code handling
286 orig_top_line and orig_total_lines.
288 * dispnew.c (adjust_frame_glyphs_initially): Don't use
289 set_window_height but set heights directly.
290 (change_frame_size_1): Use resize_frame_windows.
292 * xdisp.c (init_xdisp): Don't use set_window_height but set
295 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Use
296 resize_frame_windows instead of change_window_heights and run
297 run_window_configuration_change_hook.
299 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
300 instead of change_window_heights and run
301 run_window_configuration_change_hook.
303 2011-06-09 Martin Rudalics <rudalics@gmx.at>
305 * window.c (replace_window): Rename second argument REPLACEMENT to
306 NEW. New third argument SETFLAG. Rewrite.
307 (delete_window, make_dummy_parent): Call replace_window with
309 (window_list_1): Move down in code.
310 (run_window_configuration_change_hook): Move set_buffer part
311 before select_frame_norecord part in order to unwind correctly.
312 Rename count1 to count.
313 (recombine_windows, delete_deletable_window, resize_root_window)
314 (Fdelete_other_windows_internal)
315 (Frun_window_configuration_change_hook, make_parent_window)
316 (resize_window_check, resize_window_apply, Fresize_window_apply)
317 (resize_frame_windows, Fsplit_window_internal)
318 (Fdelete_window_internal, Fresize_mini_window_internal): New
320 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
322 2011-06-08 Martin Rudalics <rudalics@gmx.at>
324 * window.h (window): Add some new members to window structure -
325 normal_lines, normal_cols, new_total, new_normal, clone_number,
326 splits, nest, prev_buffers, next_buffers.
327 (WINDOW_TOTAL_SIZE): Move here from window.c.
328 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
330 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
332 (make_dummy_parent): Set new members of windows structure.
333 (make_window): Move down in code. Handle new members of window
335 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
336 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
337 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
338 (Fset_window_prev_buffers, Fwindow_next_buffers)
339 (Fset_window_next_buffers, Fset_window_clone_number): New
341 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
342 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
344 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
345 Argument WINDOW can be now internal window too.
346 (Fwindow_use_time): Move up in code.
347 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
349 (Fset_window_configuration, saved_window)
350 (Fcurrent_window_configuration, save_window_save): Handle new
351 members of window structure.
352 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
353 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
354 (syms_of_window): New Lisp objects Qrecord_window_buffer,
355 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
356 Qget_mru_window, Qresize_root_window,
357 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
358 Qauto_buffer_name; staticpro them.
360 2011-06-07 Martin Rudalics <rudalics@gmx.at>
362 * window.c (Fwindow_total_size, Fwindow_left_column)
363 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
364 (Fwindow_list_1): New functions.
365 (window_box_text_cols): Replace with window_body_cols.
366 (Fwindow_width, Fscroll_left, Fscroll_right): Use
367 window_body_cols instead of window_box_text_cols.
368 (delete_window, Fset_window_configuration): Call
369 delete_all_subwindows with window as argument.
370 (delete_all_subwindows): Take a window as argument and not a
372 (window_loop): Remove handling of GET_LRU_WINDOW and
374 (Fget_lru_window, Fget_largest_window): Move to window.el.
376 * window.h: Extern window_body_cols instead of
377 window_box_text_cols. delete_all_subwindows now takes a
378 Lisp_Object as argument.
380 * indent.c (compute_motion, Fcompute_motion): Use
381 window_body_cols instead of window_box_text_cols.
383 * frame.c (delete_frame): Call delete_all_subwindows with root
386 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
388 * fns.c (Fputhash): Document return value.
390 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
392 * image.c (gif_load): Implement gif89a spec "no disposal" method.
394 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
396 Cons<->int and similar integer overflow fixes (Bug#8794).
398 Check for overflow when converting integer to cons and back.
399 * charset.c (Fdefine_charset_internal, Fdecode_char):
400 Use cons_to_unsigned to catch overflow.
401 (Fencode_char): Use INTEGER_TO_CONS.
402 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
403 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
404 * data.c (long_to_cons, cons_to_long): Remove.
405 (cons_to_unsigned, cons_to_signed): New functions.
406 These signal an error for invalid or out-of-range values.
407 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
408 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
409 * font.c (Ffont_variation_glyphs):
410 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
411 * lisp.h: Include <intprops.h>.
412 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
413 (cons_to_signed, cons_to_unsigned): New decls.
414 (long_to_cons, cons_to_long): Remove decls.
415 * undo.c (record_first_change): Use INTEGER_TO_CONS.
416 (Fprimitive_undo): Use CONS_TO_INTEGER.
417 * xfns.c (Fx_window_property): Likewise.
418 * xselect.c: Include <limits.h>.
419 (x_own_selection, selection_data_to_lisp_data):
421 (x_handle_selection_request, x_handle_selection_clear)
422 (x_get_foreign_selection, Fx_disown_selection_internal)
423 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
424 (lisp_data_to_selection_data): Use cons_to_unsigned.
425 (x_fill_property_data): Use cons_to_signed.
426 Report values out of range.
428 Check for buffer and string overflow more precisely.
429 * buffer.h (BUF_BYTES_MAX): New macro.
430 * lisp.h (STRING_BYTES_MAX): New macro.
431 * alloc.c (Fmake_string):
432 * character.c (string_escape_byte8):
433 * coding.c (coding_alloc_by_realloc):
435 * editfns.c (Fformat):
437 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
438 since they may not be the same number.
439 * editfns.c (Finsert_char):
440 * fileio.c (Finsert_file_contents):
441 Likewise for BUF_BYTES_MAX.
443 * image.c: Use ptrdiff_t, not int, for sizes.
444 (slurp_file): Switch from int to ptrdiff_t.
446 (slurp_file): Check that file size fits in both size_t (for
447 malloc) and ptrdiff_t (for sanity and safety).
449 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
450 if b->modtime has its maximal value.
452 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
454 Don't assume time_t can fit into int.
455 * buffer.h (struct buffer.modtime): Now time_t, not int.
456 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
457 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
459 Minor fixes for signed vs unsigned integers.
460 * character.h (MAYBE_UNIFY_CHAR):
461 * charset.c (maybe_unify_char):
462 * keyboard.c (read_char, reorder_modifiers):
463 XINT -> XFASTINT, since the integer must be nonnegative.
464 * ftfont.c (ftfont_spec_pattern):
465 * keymap.c (access_keymap, silly_event_symbol_error):
466 XUINT -> XFASTINT, since the integer must be nonnegative.
467 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
468 since it makes no difference and we prefer signed.
469 * keyboard.c (record_char): Use XUINT when all the neighbors do.
470 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
473 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
475 * window.h (Fwindow_frame): Declare.
477 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
479 * alloc.c: Simplify handling of large-request failures (Bug#8800).
480 (SPARE_MEMORY): Always define.
481 (LARGE_REQUEST): Remove.
482 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
484 2011-06-06 Martin Rudalics <rudalics@gmx.at>
486 * lisp.h: Move EXFUNS for Fframe_root_window,
487 Fframe_first_window and Fset_frame_selected_window to window.h.
489 * window.h: Move EXFUNS for Fframe_root_window,
490 Fframe_first_window and Fset_frame_selected_window here from
493 * frame.c (Fwindow_frame, Fframe_first_window)
494 (Fframe_root_window, Fframe_selected_window)
495 (Fset_frame_selected_window): Move to window.c.
496 (Factive_minibuffer_window): Move to minibuf.c.
497 (Fother_visible_frames_p): New function.
499 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
501 * window.c (decode_window, decode_any_window): Move up in code.
502 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
503 (inhibit_frame_unsplittable): Remove unused variable.
504 (Fwindow_buffer): Move up and rewrite doc-string.
505 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
506 (Fwindow_prev): New functions.
507 (Fwindow_frame): Move here from frame.c. Accept any window as
509 (Fframe_root_window, Fframe_first_window)
510 (Fframe_selected_window): Move here from frame.c. Accept frame
511 or arbitrary window as argument. Update doc-strings.
512 (Fminibuffer_window): Move up in code.
513 (Fwindow_minibuffer_p): Move up in code and simplify.
514 (Fset_frame_selected_window): Move here from frame.c.
516 (Fselected_window, select_window, Fselect_window): Move up in
517 code. Minor doc-string fixes.
519 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
521 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
522 Do not assume that spare memory exists; that assumption is valid
523 only if SYSTEM_MALLOC.
524 (LARGE_REQUEST): New macro, so that the issue of large requests
525 is separated from the issue of spare memory.
527 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
529 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
532 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
534 * xfns.c (x_set_scroll_bar_default_width): Move declarations
537 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
539 * gtkutil.c (xg_get_default_scrollbar_width): New function.
541 * gtkutil.h: Declare xg_get_default_scrollbar_width.
543 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
544 min width by calling x_set_scroll_bar_default_width (Bug#8505).
546 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
548 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
550 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
552 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
553 (x_clipboard_manager_save): Add return value.
554 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
556 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
557 Obey Vx_select_enable_clipboard_manager. Catch errors in
558 x_clipboard_manager_save (Bug#8779).
559 (Vx_select_enable_clipboard_manager): New variable.
560 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
562 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
564 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
566 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
568 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
569 in the current matrix if keep_current_p is non-zero.
571 2011-06-04 Eli Zaretskii <eliz@gnu.org>
573 * bidi.c (bidi_level_of_next_char): Fix last change.
575 2011-06-03 Eli Zaretskii <eliz@gnu.org>
577 Support bidi reordering of text covered by display properties.
579 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
580 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
581 (bidi_cache_search, bidi_cache_iterator_state)
582 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
583 (bidi_level_of_next_char, bidi_move_to_visually_next):
584 Support character positions inside a run of characters covered by a
586 (bidi_paragraph_init, bidi_resolve_explicit_1)
587 (bidi_level_of_next_char): Call bidi_fetch_char and
588 bidi_fetch_char_advance instead of FETCH_CHAR and
590 (bidi_init_it): Initialize new members.
591 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
593 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
594 instead of using explicit *_CHAR codes.
595 (bidi_resolve_explicit, bidi_resolve_weak):
596 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
597 bidirectional text is supported only in multibyte buffers.
598 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
599 it to initialize the frame_window_p member of struct bidi_it.
600 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
601 (bidi_resolve_explicit, bidi_resolve_weak)
602 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
603 bidi_it->nchars is non-positive.
604 (bidi_level_of_next_char): Don't try to lookup the cache for the
605 next/previous character if nothing is cached there yet, or if we
606 were just reseat()'ed to a new position.
608 * xdisp.c (set_cursor_from_row): Set start and stop points
609 according to the row's direction when priming the loop that looks
610 for the glyph on which to display cursor.
611 (single_display_spec_intangible_p): Function deleted.
612 (display_prop_intangible_p): Reimplement to call
613 handle_display_spec instead of single_display_spec_intangible_p.
614 Accept 3 additional arguments needed by handle_display_spec.
615 This fixes incorrect cursor motion across display property with complex
616 values: lists, `(when COND...)' forms, etc.
617 (single_display_spec_string_p): Support property values that are
618 lists with the argument STRING its top-level element.
619 (display_prop_string_p): Fix the condition for processing a
620 property that is a list to be consistent with handle_display_spec.
621 (handle_display_spec): New function, refactored from the
622 last portion of handle_display_prop.
623 (compute_display_string_pos): Accept additional argument
624 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
625 value of a `display' property is a "replacing spec".
626 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
627 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
628 the display property, but just return a value indicating whether
629 the display property will replace the characters it covers.
630 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
631 frame_window_p members of struct bidi_it.
632 (compute_display_string_pos, compute_display_string_end):
634 (push_it): Accept second argument POSITION, where pop_it should
635 jump to continue iteration.
636 (reseat_1): Initialize bidi_it.disp_pos.
638 * keyboard.c (adjust_point_for_property): Adjust the call to
639 display_prop_intangible_p to its new signature.
641 * dispextern.h (struct bidi_it): New member frame_window_p.
642 (bidi_init_it): Update prototypes.
643 (display_prop_intangible_p): Update prototype.
644 (compute_display_string_pos, compute_display_string_end):
646 (struct bidi_it): New members nchars and disp_pos. ch_len is now
649 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
651 Malloc failure behavior now depends on size of allocation.
652 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
653 * lisp.h: Change signatures accordingly.
654 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
655 All callers changed. (Bug#8762)
657 * gnutls.c: Use Emacs's memory allocators.
658 Without this change, the gnutls library would invoke malloc etc.
659 directly, which causes problems on non-SYNC_INPUT hosts, and which
660 runs afoul of improving memory_full behavior. (Bug#8761)
661 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
662 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
663 xfree instead of the default malloc, realloc, free.
664 (Fgnutls_boot): No need to check for memory allocation failure,
665 since xmalloc does that for us.
667 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
668 * category.c (hash_get_category_set):
669 * ccl.c (ccl_driver):
670 * charset.c (Fdefine_charset_internal):
671 * charset.h (struct charset.hash_index):
672 * composite.c (get_composition_id, gstring_lookup_cache)
673 (composition_gstring_put_cache):
674 * composite.h (struct composition.hash_index):
675 * dispextern.h (struct image.hash):
676 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
677 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
678 (hashfn_equal, hashfn_user_defined, make_hash_table)
679 (maybe_resize_hash_table, hash_lookup, hash_put)
680 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
681 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
682 (Fsxhash, Fgethash, Fputhash, Fmaphash):
683 * image.c (make_image, search_image_cache, lookup_image)
684 (xpm_put_color_table_h):
685 * lisp.h (struct Lisp_Hash_Table):
686 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
687 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
688 for hashes and hash indexes, instead of 'unsigned' and 'int'.
689 * alloc.c (allocate_vectorlike):
690 Check for overflow in vector size calculations.
691 * ccl.c (ccl_driver):
692 Check for overflow when converting EMACS_INT to int.
693 * fns.c, image.c: Remove unnecessary static decls that would otherwise
694 need to be updated by these changes.
695 * fns.c (make_hash_table, maybe_resize_hash_table):
696 Check for integer overflow with large hash tables.
697 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
698 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
699 (SXHASH_REDUCE): New macro.
700 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
701 Use it instead of discarding useful hash info with large hash values.
702 (sxhash_float): New function.
703 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
704 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
705 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
706 Rewrite to use FIXNUM_BITS, as this simplifies things.
707 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
708 Adjust signatures to match updated version of code.
709 (consing_since_gc): Now EMACS_INT, since a single hash table can
710 use more than INT_MAX bytes.
712 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
714 Make it possible to build with GCC-4.6+ -O2 -flto.
716 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
718 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
720 * minibuf.c (get_minibuffer, read_minibuf_unwind):
721 Call minibuffer-inactive-mode.
723 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
725 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
728 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
730 * data.c (init_data): Remove code for UTS, this system is not
733 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
735 Don't force ./temacs to start in terminal mode.
737 * frame.c (make_initial_frame): Initialize faces in all cases, not
738 only when CANNOT_DUMP is defined.
739 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
741 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
743 * dispnew.c (add_window_display_history): Use const for the string
744 pointer. Remove declaration, not needed.
746 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
748 Use 'inline', not 'INLINE'.
749 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
750 * alloc.c, fontset.c (INLINE): Remove.
751 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
752 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
753 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
754 * gmalloc.c (register_heapinfo): Use inline unconditionally.
755 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
757 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
759 Make it possible to run ./temacs.
761 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
762 syms_of_callproc does the same thing. Remove test for
763 "initialized", do it in the caller.
764 * emacs.c (main): Avoid calling set_initial_environment when dumping.
766 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
768 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
769 (read_minibuf): Use get_minibuffer.
770 (syms_of_minibuf): Use DEFSYM.
771 (Qmetadata): New var.
772 * data.c (Qbuffer): Don't make it static.
773 (syms_of_data): Use DEFSYM.
775 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
777 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
778 (CCL_CODE_MIN): New macro.
780 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
782 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
784 * eval.c (Qdebug): Now static.
785 * lisp.h (Qdebug): Remove decl. This reverts a part of the
786 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
787 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
789 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
791 * image.c: Various fixes to ImageMagick code comments.
792 (Fimagemagick_types): Doc fix.
794 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
796 Minor fixes prompted by GCC 4.6.0 warnings.
798 * xselect.c (converted_selections, conversion_fail_tag): Now static.
800 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
801 (x_clipboard_manager_save_all): Move extern decl to ...
802 * xterm.h: ... here, so that it can be checked for consistency.
804 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
806 * xselect.c (x_clipboard_manager_save_frame)
807 (x_clipboard_manager_save_all): New functions.
808 (Fx_clipboard_manager_save): Lisp function deleted.
810 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
811 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
813 * xterm.h: Update prototype.
815 2011-05-28 William Xu <william.xwl@gmail.com>
817 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
820 2011-05-28 Jim Meyering <meyering@redhat.com>
822 Avoid a sign-extension bug in crypto_hash_function.
823 * fns.c (to_uchar): Define.
824 (crypto_hash_function): Use it to convert some newly-signed
825 variables to unsigned, to avoid sign-extension bugs. For example,
826 without this change, (md5 "truc") would evaluate to
827 45723a2aff78ff4fff7fff1114760e62 rather than the expected
828 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
829 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
831 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
833 Integer overflow fixes.
835 * dbusbind.c: Serial number integer overflow fixes.
836 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
837 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
838 to hold a serial number that is too large for a fixnum.
839 (Fdbus_method_return_internal, Fdbus_method_error_internal):
840 Check for serial numbers out of range. Decode any serial number
841 that was so large that it became a float. (Bug#8722)
843 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
844 (Fdbus_call_method, Fdbus_call_method_asynchronously):
845 Use XFASTINT rather than XUINT when numbers are nonnegative.
846 (xd_append_arg, Fdbus_method_return_internal):
847 (Fdbus_method_error_internal): Likewise. Also, for unsigned
848 arguments, check that Lisp number is nonnegative, rather than
849 silently wrapping negative numbers around. (Bug#8722)
850 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
853 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
855 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
857 ccl: add integer overflow checks
858 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
859 (IN_INT_RANGE): New macros.
860 (ccl_driver): Use them to check for integer overflow when
861 decoding a CCL program. Many of the new checks are whether XINT (x)
862 fits in int; it doesn't always, on 64-bit hosts. The new version
863 doesn't catch all possible integer overflows, but it's an
864 improvement. (Bug#8719)
866 * alloc.c (make_event_array): Use XINT, not XUINT.
867 There's no need for unsigned here.
869 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
870 This follows up to the 2011-05-06 change that substituted uintptr_t
871 for EMACS_INT. This case wasn't caught back then.
873 Rework Fformat to avoid integer overflow issues.
874 * editfns.c: Include <float.h> unconditionally, as it's everywhere
875 now (part of C89). Include <verify.h>.
876 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
877 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
878 (Fformat): Avoid the prepass trying to compute sizes; it was only
879 approximate and thus did not catch overflow reliably. Instead, walk
880 through the format just once, formatting and computing sizes as we go,
881 checking for integer overflow at every step, and allocating a larger
882 buffer as needed. Keep track separately whether the format is
883 multibyte. Keep only the most-recently calculated precision, rather
884 than them all. Record whether each argument has been converted to
885 string. Use EMACS_INT, not int, for byte and char and arg counts.
886 Support field widths and precisions larger than INT_MAX. Avoid
887 sprintf's undefined behavior with conversion specifications such as %#d
888 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
889 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
890 formatting out-of-range floating point numbers with int
893 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
895 * data.c: Avoid integer truncation in expressions involving floats.
896 * data.c: Include <intprops.h>.
897 (arith_driver): When there's an integer overflow in an expression
898 involving floating point, convert the integers to floating point
899 so that the resulting value does not suffer from catastrophic
900 integer truncation. For example, on a 64-bit host (* 4
901 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
902 Do not rely on undefined behavior after integer overflow.
904 merge count_size_as_multibyte, parse_str_to_multibyte
905 * character.c, character.h (count_size_as_multibyte):
906 Rename from parse_str_to_multibyte; all uses changed.
907 Check for integer overflow.
908 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
909 since it's now a duplicate of the other. This is more of
910 a character than a buffer op, so better that it's in character.c.
911 * fns.c, print.c: Adjust to above changes.
913 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
915 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
917 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
919 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
920 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
921 (x_clipboard_manager_save): Now static.
922 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
924 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
925 (crypto_hash_function): Now static.
926 Fix pointer signedness problems. Avoid unnecessary initializations.
928 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
930 * termhooks.h (Vselection_alist): Make it terminal-local.
932 * terminal.c (create_terminal): Initialize it.
934 * xselect.c: Support for clipboard managers.
935 (Vselection_alist): Move to termhooks.h as terminal-local var.
936 (LOCAL_SELECTION): New macro.
937 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
938 (symbol_to_x_atom): Remove gratuitous arg.
939 (x_handle_selection_request, lisp_data_to_selection_data)
940 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
941 (x_own_selection, x_get_local_selection, x_convert_selection):
942 New arg, specifying work frame. Use terminal-local Vselection_alist.
943 (some_frame_on_display): Delete unused function.
944 (Fx_own_selection_internal, Fx_get_selection_internal)
945 (Fx_disown_selection_internal, Fx_selection_owner_p)
946 (Fx_selection_exists_p): New optional frame arg.
947 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
948 (x_handle_selection_clear): Don't treat other terminals with the
949 same keyboard specially. Use the terminal-local Vselection_alist.
950 (x_clear_frame_selections): Use Frun_hook_with_args.
952 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
954 * xterm.h: Add support for those atoms.
956 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
958 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
959 (converted_selections, conversion_fail_tag): New global variables.
960 (x_selection_request_lisp_error): Free the above.
961 (x_get_local_selection): Remove unnecessary code.
962 (x_reply_selection_request): Args changed; handle arbitrary array
963 of converted selections stored in converted_selections.
964 Separate the XChangeProperty and SelectionNotify steps.
965 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
966 (x_convert_selection): New function.
967 (x_handle_selection_event): Simplify.
968 (x_get_foreign_selection): Don't ignore incoming requests while
969 waiting for an answer; this will fail when we implement
970 SAVE_TARGETS, and seems unnecessary anyway.
971 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
972 (Vx_sent_selection_functions): Doc fix.
974 2011-05-26 Leo Liu <sdl.web@gmail.com>
976 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
978 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
980 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
982 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
983 for fringe update if it has periodic bitmap.
984 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
985 and fringe_bitmap_periodic_p.
987 * fringe.c (get_fringe_bitmap_data): New function.
988 (draw_fringe_bitmap_1, update_window_fringes): Use it.
989 (update_window_fringes): Record periodicity of fringe bitmap in glyph
990 row. Mark glyph row for fringe update if periodicity changed.
992 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
993 for fringe update unless it has periodic bitmap.
995 2011-05-25 Kenichi Handa <handa@m17n.org>
997 * xdisp.c (get_next_display_element): Set correct it->face_id for
998 a static composition.
1000 2011-05-24 Leo Liu <sdl.web@gmail.com>
1003 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
1005 * fns.c (crypto_hash_function, Fsha1): New function.
1006 (Fmd5): Use crypto_hash_function.
1007 (syms_of_fns): Add Ssha1.
1009 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
1011 * gnutls.c: Remove unused macros.
1012 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
1013 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
1014 Remove macros that are defined and never used.
1015 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
1017 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
1019 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
1020 (Fx_get_selection_internal): Minor cleanup.
1021 (Fx_own_selection_internal): Rename arguments for consistency with
1024 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
1026 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
1028 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
1030 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
1032 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1034 * dispnew.c (scrolling_window): Don't exclude the case that the
1035 last enabled row in the desired matrix touches the bottom boundary.
1037 2011-05-21 Glenn Morris <rgm@gnu.org>
1039 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
1040 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
1041 and add some more files.
1043 2011-05-20 Eli Zaretskii <eliz@gnu.org>
1045 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
1046 report_file_error introduced by the change from 2011-05-07.
1048 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
1050 * systime.h (Time): Define only if emacs is defined.
1051 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
1052 where the include path doesn't have X11/X.h by default. See
1053 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
1055 2011-05-20 Kenichi Handa <handa@m17n.org>
1057 * composite.c (find_automatic_composition): Fix previous change.
1059 2011-05-20 Glenn Morris <rgm@gnu.org>
1061 * lisp.mk: New file, split from Makefile.in.
1062 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
1063 (shortlisp): Remove.
1064 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
1066 2011-05-19 Glenn Morris <rgm@gnu.org>
1068 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
1069 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
1070 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
1071 (lisp): Set the order to that of loadup.el.
1072 (shortlisp): Make it a copy of $lisp.
1073 (SOME_MACHINE_LISP): Remove.
1074 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
1075 Use just $shortlisp, not $SOME_MACHINE_LISP too.
1077 2011-05-18 Kenichi Handa <handa@m17n.org>
1079 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
1080 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
1081 (find_automatic_composition): Mostly rewrite for efficiency.
1083 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
1085 * makefile.w32-in: Update dependencies.
1087 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
1089 * menu.c: Include limits.h (fixes the MS-Windows build broken by
1092 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
1094 Fix some integer overflow issues, such as string length overflow.
1096 * insdel.c (count_size_as_multibyte): Check for string overflow.
1098 * character.c (lisp_string_width): Check for string overflow.
1099 Use EMACS_INT, not int, for string indexes and lengths; in
1100 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
1101 the resulting string length overflows an EMACS_INT; instead,
1102 report a string overflow if no precision given. When checking for
1103 precision exhaustion, use a check that cannot possibly have
1104 integer overflow. (Bug#8675)
1105 * character.h (lisp_string_width): Adjust to new signature.
1107 * alloc.c (string_overflow): New function.
1108 (Fmake_string): Use it. This doesn't change behavior, but saves
1109 a few bytes and will simplify future changes.
1110 * character.c (string_escape_byte8): Likewise.
1111 * lisp.h (string_overflow): New decl.
1113 Fixups, following up to the user-interface timestamp change.
1114 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
1115 for UI timestamps, instead of unsigned long.
1116 * msdos.c (mouse_get_pos): Likewise.
1117 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1118 * w32gui.h (Time): Define by including "systime.h" rather than by
1119 declaring it ourselves. (Bug#8664)
1121 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
1122 * image.c (clear_image_cache): Likewise.
1124 * term.c (term_mouse_position): Don't assume time_t wraparound.
1126 Be more systematic about user-interface timestamps.
1127 Before, the code sometimes used 'Time', sometimes 'unsigned long',
1128 and sometimes 'EMACS_UINT', to represent these timestamps.
1129 This change causes it to use 'Time' uniformly, as that's what X uses.
1130 This makes the code easier to follow, and makes it easier to catch
1131 integer overflow bugs such as Bug#8664.
1132 * frame.c (Fmouse_position, Fmouse_pixel_position):
1133 Use Time, not unsigned long, for user-interface timestamps.
1134 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
1135 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
1136 * keyboard.h (last_event_timestamp): Likewise.
1137 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
1138 * menu.h (xmenu_show): Likewise.
1139 * term.c (term_mouse_position): Likewise.
1140 * termhooks.h (struct input_event.timestamp): Likewise.
1141 (struct terminal.mouse_position_hook): Likewise.
1142 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
1143 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
1144 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
1145 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
1147 * menu.h, termhooks.h: Include "systime.h", for Time.
1149 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
1150 Don't assume that the difference between two unsigned long values
1151 can fit into an integer. At this point, we know button_down_time
1152 <= event->timestamp, so the difference must be nonnegative, so
1153 there's no need to cast the result if double-click-time is
1154 nonnegative, as it should be; check that it's nonnegative, just in
1155 case. This bug is triggered when events are more than 2**31 ms
1156 apart (about 25 days). (Bug#8664)
1158 * xselect.c (last_event_timestamp): Remove duplicate decl.
1159 (x_own_selection): Remove needless cast to unsigned long.
1161 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
1162 that always fit in int. Use a sentinel instead of a counter, to
1163 avoid a temp and to allay GCC's concerns about possible int overflow.
1164 * frame.h (struct frame): Use int for menu_bar_items_used
1165 instead of EMACS_INT, since it always fits in int.
1167 * menu.c (grow_menu_items): Check for int overflow.
1169 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
1171 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
1172 Before, the code was not consistent. These values cannot exceed
1173 2**31 - 1 so there's no need to make them unsigned.
1174 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
1175 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
1176 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
1178 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
1180 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
1181 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
1182 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
1183 presumably because the widths might not match.
1185 * window.c (size_window): Avoid needless test at loop start.
1187 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
1189 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
1191 2011-05-12 Drew Adams <drew.adams@oracle.com>
1193 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
1195 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1197 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
1198 `width' to `bar_area_x' and `bar_area_width', respectively.
1199 (x_scroll_run): Take account of fringe background extension.
1201 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
1202 Rename local vars `left' and `width' to `bar_area_x' and
1203 `bar_area_width', respectively.
1204 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
1205 background extension.
1207 2011-05-10 Jim Meyering <meyering@redhat.com>
1209 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
1211 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
1213 * image.c (Finit_image_library): Return t for built-in image types,
1214 like pbm and xbm. (Bug#8640)
1216 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
1218 * w32menu.c (set_frame_menubar): Fix submenu allocation.
1220 2011-05-07 Eli Zaretskii <eliz@gnu.org>
1222 * w32console.c (Fset_screen_color): Doc fix.
1223 (Fget_screen_color): New function.
1224 (syms_of_ntterm): Defsubr it.
1226 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
1227 unlink the temporary file if Fcall_process didn't create it in the
1229 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
1230 child process will be redirected to a file specified with `:file'.
1231 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
1232 cue to call_process_cleanup not to close that handle.
1234 2011-05-07 Ben Key <bkey76@gmail.com>
1236 * makefile.w32-in: The bootstrap-temacs rule now makes use of
1237 one of two shell specific rules, either bootstrap-temacs-CMD or
1238 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
1239 to the previous implementation of the bootstrap-temacs rule.
1240 The bootstrap-temacs-CMD rule is similar to the previous
1241 implementation of the bootstrap-temacs rule except that it
1242 makes use of the ESC_CFLAGS variable instead of the CFLAGS
1245 These changes, along with some changes to nt/configure.bat,
1246 nt/gmake.defs, and nt/nmake.defs, are required to extend my
1247 earlier fix to add support for --cflags and --ldflags options
1248 that include quotes so that it works whether make uses cmd or
1251 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
1253 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
1254 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
1256 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
1257 a string. Handle both cases.
1258 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
1259 (Fdbus_register_method): Use Qinvalid_function.
1261 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
1263 * makefile.w32-in: Update dependencies.
1264 (LISP_H): Add inttypes.h and stdin.h.
1265 (PROCESS_H): Add unistd.h.
1267 2011-05-06 Eli Zaretskii <eliz@gnu.org>
1269 * lread.c: Include limits.h (fixes the MS-Windows build broken by
1270 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
1272 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
1274 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
1276 * term.c (vfatal): Remove stray call to va_end.
1277 It's not needed and the C Standard doesn't allow it here anyway.
1279 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
1280 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
1282 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
1285 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
1287 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
1289 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
1291 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
1293 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
1295 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
1296 * charset.c (Fdefine_charset_internal): Don't initialize
1297 charset.code_space[15]. The value was garbage, on hosts with
1298 32-bit int (Bug#8600).
1300 * lread.c (read_integer): Be more consistent with string-to-number.
1301 Use string_to_number to do the actual conversion; this avoids
1302 rounding errors and fixes some other screwups. Without this fix,
1303 for example, #x1fffffffffffffff was misread as -2305843009213693952.
1304 (digit_to_number): Move earlier, for benefit of read_integer.
1305 Return -1 if the digit is out of range for the base, -2 if it is
1306 not a digit in any supported base. (Bug#8602)
1308 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
1310 * dispnew.c (scrolling_window): Return 1 if we scrolled,
1311 to match comment at start of function. This also removes a
1312 GCC warning about overflow in a 32+64-bit port.
1314 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
1316 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
1317 Reported by Stefan Monnier in
1318 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
1319 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
1320 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
1322 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
1323 (EMACS_UINTPTR): Likewise, with uintptr_t.
1325 * lisp.h: Prefer 64-bit EMACS_INT if available.
1326 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
1327 on 32-bit hosts that have 64-bit int, so that they can access
1329 However, temporarily disable this change unless the temporary
1330 symbol WIDE_EMACS_INT is defined.
1332 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
1334 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
1335 This removes an assumption that EMACS_INT and long are the same
1336 width as pointers. The assumption is true for Emacs porting targets
1337 now, but we want to make other targets possible.
1338 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
1339 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
1340 In the rest of the code, change types of integers that hold casted
1341 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
1342 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
1343 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
1344 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
1345 No need to cast type when ORing.
1346 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
1347 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
1348 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
1349 assume EMACS_INT is the same width as char *.
1350 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
1351 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
1352 Remove no-longer-needed casts.
1353 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
1354 (xg_tool_bar_help_callback, xg_make_tool_item):
1355 Use EMACS_INTPTR to hold an integer
1356 that will be cast to void *; this can avoid a GCC warning
1357 if EMACS_INT is not the same width as void *.
1358 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
1359 * xdisp.c (display_echo_area_1, resize_mini_window_1):
1360 (current_message_1, set_message_1):
1361 Use a local to convert to proper width without a cast.
1362 * xmenu.c (dialog_selection_callback): Likewise.
1364 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
1365 Also, don't assume VALBITS / RAND_BITS is less than 5,
1366 and don't rely on undefined behavior when shifting a 1 left into
1368 * lisp.h (get_random): Change signature to match.
1370 * lread.c (hash_string): Use size_t, not int, for hash computation.
1371 Normally we prefer signed values; but hashing is special, because
1372 it's better to use unsigned division on hash table sizes so that
1373 the remainder is nonnegative. Also, size_t is the natural width
1374 for hashing into memory. The previous code used 'int', which doesn't
1375 retain enough info to hash well into very large tables.
1376 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
1378 * dbusbind.c: Don't possibly lose pointer info when converting.
1379 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
1380 Use XPNTR rather than XHASH, so that the high-order bits of
1381 the pointer aren't lost when converting through void *.
1383 * eval.c (Fautoload): Don't double-shift a pointer.
1385 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
1387 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
1389 * gnutls.c (DEF_GNUTLS_FN):
1390 * image.c (DEF_IMGLIB_FN): Make function pointers static.
1392 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
1394 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
1397 2011-05-05 Eli Zaretskii <eliz@gnu.org>
1399 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
1400 New version that can reserve upto 2GB of heap space.
1402 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
1404 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
1406 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
1408 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
1409 `gnutls_certificate_set_x509_key_file'.
1411 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
1413 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
1414 Update dependencies.
1416 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
1418 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
1419 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
1420 Remove unused parameter `fildes'.
1421 * process.c (read_process_output, send_process): Don't pass it.
1423 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
1425 Fix previous change: the library cache is defined in w32.c.
1426 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
1427 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
1429 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
1431 Implement dynamic loading of GnuTLS on Windows.
1433 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
1434 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
1435 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
1438 * gnutls.c (Qgnutls_dll): Define.
1439 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
1440 (gnutls_*): Declare function pointers.
1441 (init_gnutls_functions): New function to initialize function pointers.
1442 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
1443 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
1444 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
1445 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
1446 (emacs_gnutls_write, emacs_gnutls_read)
1447 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
1448 (Fgnutls_available_p): New function.
1449 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
1450 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
1451 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
1453 * image.c: Include w32.h.
1454 (Vimage_type_cache): Delete.
1455 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
1456 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
1457 (w32_delayed_load): Move to w32.c.
1459 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
1461 * w32.c (QCloaded_from, Vlibrary_cache): Define.
1462 (w32_delayed_load): Move from image.c. When loading a library, record
1463 its filename in the :loaded-from property of the library id.
1464 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
1465 Initialize and staticpro them.
1466 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
1468 * process.c: Include lisp.h before w32.h, not after.
1469 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
1470 instead of gnutls_record_check_pending.
1472 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
1474 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
1476 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
1477 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
1480 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
1482 * xterm.c (x_set_frame_alpha): Do not set property on anything
1483 else than FRAME_X_OUTER_WINDOW (Bug#8608).
1485 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
1487 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
1489 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
1491 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
1492 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
1493 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
1494 (gnutls_global_initialized, Qgnutls_bootprop_priority)
1495 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
1496 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
1497 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
1498 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
1499 (Qgnutls_bootprop_callbacks_verify): Make static.
1501 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
1503 * callproc.c: Indentation fixup.
1505 * sysdep.c (wait_for_termination_1): Make static.
1506 (wait_for_termination, interruptible_wait_for_termination):
1507 Move after wait_for_termination_1.
1509 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
1511 * sysdep.c (interruptible_wait_for_termination): New function
1512 which is like wait_for_termination, but allows keyboard
1515 * callproc.c (Fcall_process): Add (:file "file") as an option for
1517 (Fcall_process_region): Ditto.
1519 2011-04-30 Eli Zaretskii <eliz@gnu.org>
1521 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
1522 rather than `XVECTOR (FOO)->size'.
1524 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
1525 inttypes.h, as a gnulib replacement is used if it not available in
1528 2011-04-21 Eli Zaretskii <eliz@gnu.org>
1530 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
1531 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
1532 of MOST_POSITIVE_FIXNUM. (Bug#8528)
1534 * coding.c (coding_alloc_by_realloc): Error out if destination
1535 will grow beyond MOST_POSITIVE_FIXNUM.
1536 (decode_coding_emacs_mule): Abort if there isn't enough place in
1537 charbuf for the composition carryover bytes. Reserve an extra
1538 space for up to 2 characters produced in a loop.
1539 (decode_coding_iso_2022): Abort if there isn't enough place in
1540 charbuf for the composition carryover bytes.
1542 2011-04-21 Eli Zaretskii <eliz@gnu.org>
1544 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
1545 aborting when %lld or %lll format is passed.
1546 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
1547 %llo or %llx format is passed. (Bug#8545)
1549 * window.c (window_scroll_line_based): Use a marker instead of
1550 simple variables to record original value of point. (Bug#7952)
1552 * doprnt.c (doprnt): Fix the case where a multibyte sequence
1553 produced by %s or %c overflows available buffer space. (Bug#8545)
1555 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
1557 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
1558 (SIZE_MAX): Move defn after all includes, as they might #define it.
1560 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
1562 * w32.c (init_environment): Warn about defaulting HOME to C:\.
1564 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
1566 * keyboard.c (Qdelayed_warnings_hook): Define.
1567 (command_loop_1): Run `delayed-warnings-hook'
1568 if Vdelayed_warnings_list is non-nil.
1569 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
1570 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
1572 2011-04-28 Eli Zaretskii <eliz@gnu.org>
1574 * doprnt.c (doprnt): Don't return value smaller than the buffer
1575 size if the message was truncated. (Bug#8545).
1577 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
1579 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
1580 (Fx_window_property): #if-0 the whole functions, not just the bodies.
1582 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
1584 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
1586 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
1588 * makefile.w32-in: Update dependencies.
1590 2011-04-27 Eli Zaretskii <eliz@gnu.org>
1592 Improve `doprnt' and its usage. (Bug#8545)
1593 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
1594 `format_end'. Remove support for %l as a conversion specifier.
1595 Don't use xrealloc. Improve diagnostics when the %l size modifier
1596 is used. Update the commentary.
1598 * eval.c (verror): Simplify calculation of size_t.
1600 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
1603 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
1605 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
1608 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
1610 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
1611 This makes this file independent of the recent pseudovector change.
1613 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
1615 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
1617 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
1618 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
1619 Remove unused local.
1620 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
1622 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
1623 GCC 4.6.0 optimizes based on type-based alias analysis.
1624 For example, if b is of type struct buffer * and v of type struct
1625 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
1626 != &v->size, and therefore "v->size = 1; b->size = 2; return
1627 v->size;" must therefore return 1. This assumption is incorrect
1628 for Emacs, since it type-puns struct Lisp_Vector * with many other
1629 types. To fix this problem, this patch adds a new type struct
1630 vectorlike_header that documents the constraints on layout of vectors
1631 and pseudovectors, and helps optimizing compilers not get fooled
1632 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
1633 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
1634 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
1636 (XSETPVECTYPE): Rewrite in terms of new macro.
1637 (XSETPVECTYPESIZE): New macro, specifying both type and size.
1638 This is a bit clearer, and further avoids the possibility of
1639 undesirable aliasing.
1640 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
1641 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
1642 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
1643 since Lisp_Subr is a special case (no "next" field).
1644 (ASIZE): Now uses header.size rather than size.
1645 All previous uses of XVECTOR (foo)->size replaced to use this macro,
1646 to avoid the hassle of writing XVECTOR (foo)->header.size.
1647 (struct vectorlike_header): New type.
1648 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
1649 object, to help avoid aliasing.
1650 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
1651 (SUBRP): Likewise, since Lisp_Subr is a special case.
1652 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
1653 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
1654 (struct Lisp_Hash_Table): Combine first two members into a single
1655 struct vectorlike_header member. All uses of "size" and "next" members
1656 changed to be "header.size" and "header.next".
1657 * buffer.h (struct buffer): Likewise.
1658 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
1659 * frame.h (struct frame): Likewise.
1660 * process.h (struct Lisp_Process): Likewise.
1661 * termhooks.h (struct terminal): Likewise.
1662 * window.c (struct save_window_data, struct saved_window): Likewise.
1663 * window.h (struct window): Likewise.
1664 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
1665 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
1666 * buffer.c (init_buffer_once): Likewise.
1667 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
1669 * process.c (Fformat_network_address): Use local var for size,
1672 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
1674 Make the Lisp reader and string-to-float more consistent (Bug#8525)
1675 * data.c (atof): Remove decl; no longer used or needed.
1676 (digit_to_number): Move to lread.c.
1677 (Fstring_to_number): Use new string_to_number function, to be
1678 consistent with how the Lisp reader treats infinities and NaNs.
1679 Do not assume that floating-point numbers represent EMACS_INT
1680 without losing information; this is not true on most 64-bit hosts.
1681 Avoid double-rounding errors, by insisting on integers when
1682 parsing non-base-10 numbers, as the documentation specifies.
1683 * lisp.h (string_to_number): New decl, replacing ...
1684 (isfloat_string): Remove.
1685 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
1686 (read1): Do not accept +. and -. as integers; this
1687 appears to have been a coding error. Similarly, do not accept
1688 strings like +-1e0 as floating point numbers. Do not report
1689 overflow for integer overflows unless the base is not 10 which
1690 means we have no simple and reliable way to continue.
1691 Break out the floating-point parsing into a new
1692 function string_to_number, so that Fstring_to_number parses
1693 floating point numbers consistently with the Lisp reader.
1694 (digit_to_number): Move here from data.c. Make it static inline.
1695 (E_CHAR, EXP_INT): Remove, replacing with ...
1696 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
1697 (string_to_number): New function, replacing isfloat_string.
1698 This function checks for valid syntax and produces the resulting
1699 Lisp float number too. Rework it so that string-to-number
1700 no longer mishandles examples like "1.0e+". Use strtoumax,
1701 so that overflow for non-base-10 numbers is reported only when
1702 there's no portable and simple way to convert to floating point.
1704 * textprop.c (set_text_properties_1): Rewrite for clarity,
1705 and to avoid GCC warning about integer overflow.
1707 * intervals.h (struct interval): Use EMACS_INT for members
1708 where EMACS_UINT might cause problems. See
1709 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
1710 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
1711 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
1713 (offset_intervals): Tell GCC not to worry about length overflow
1714 when negating a negative length.
1716 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
1717 (overrun_check_free): Likewise.
1719 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
1720 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
1723 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
1724 (gnutls_make_error): Rename local to avoid shadowing.
1725 (gnutls_emacs_global_deinit): ifdef out; not used.
1726 (Fgnutls_boot): Use const for pointer to readonly storage.
1727 Comment out unused local. Fix pointer signedness problems.
1729 * lread.c (openp): Don't stuff size_t into an 'int'.
1730 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
1731 about possible signed overflow.
1733 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
1734 (GDK_KEY_g): Don't define if already defined.
1735 (xg_prepare_tooltip): Avoid pointer signedness problem.
1736 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
1738 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
1739 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
1741 * xfns.c (Fx_window_property): Simplify a bit,
1742 to make a bit faster and to avoid GCC 4.6.0 warning.
1743 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
1745 * fns.c (internal_equal): Don't assume size_t fits in int.
1747 * alloc.c (compact_small_strings): Tighten assertion a little.
1749 Replace pEd with more-general pI, and fix some printf arg casts.
1750 * lisp.h (pI): New macro, generalizing old pEd macro to other
1751 conversion specifiers. For example, use "...%"pI"d..." rather
1752 than "...%"pEd"...".
1753 (pEd): Remove. All uses replaced with similar uses of pI.
1754 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
1755 * alloc.c (check_pure_size): Don't overflow by converting size to int.
1756 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
1757 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
1758 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
1759 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
1760 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
1762 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
1763 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
1764 * print.c (safe_debug_print, print_object): Likewise.
1765 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
1767 Use pI instead of if-then-else-abort. Use %p to avoid casts,
1768 avoiding the 0 flag, which is not portable.
1769 * process.c (Fmake_network_process): Use pI to avoid cast.
1770 * region-cache.c (pp_cache): Likewise.
1771 * xdisp.c (decode_mode_spec): Likewise.
1772 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
1773 behavior on 64-bit hosts with printf arg.
1774 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
1775 (x_stop_queuing_selection_requests): Likewise.
1776 (x_get_window_property): Don't truncate byte count to an 'int'
1779 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
1780 here, since it parses constructs like leading '-' and spaces,
1781 which are not wanted; and it overflows with large numbers.
1782 Instead, simply match F[0-9]+, which is what is wanted anyway.
1784 * alloc.c: Remove unportable assumptions about struct layout.
1785 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
1786 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
1787 (allocate_vectorlike, make_pure_vector): Use the new macros,
1788 plus offsetof, to remove unportable assumptions about struct layout.
1789 These assumptions hold on all porting targets that I know of, but
1790 they are not guaranteed, they're easy to remove, and removing them
1791 makes further changes easier.
1793 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
1794 This doesn't fix a bug but makes the code clearer.
1795 (string_overrun_cookie): Now const. Use initializers that
1796 don't formally overflow signed char, to avoid warnings.
1797 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
1798 can cause Emacs to crash when string overrun checking is enabled.
1799 (allocate_buffer): Don't assume sizeof (struct buffer) is a
1800 multiple of sizeof (EMACS_INT); it need not be, if
1801 alignof(EMACS_INT) < sizeof (EMACS_INT).
1802 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
1804 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
1806 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
1808 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
1810 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
1811 supposed to be handshaking. (Bug#8556)
1812 Reported by Paul Eggert <eggert@cs.ucla.edu>.
1814 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
1816 * lisp.h (Qdebug): List symbol.
1817 * eval.c (Qdebug): Restore global linkage.
1818 * keyboard.c (debug-on-event): New variable.
1819 (handle_user_signal): Break into debugger when debug-on-event
1820 matches the current signal symbol.
1822 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
1824 * alloc.c (check_sblock, check_string_bytes)
1825 (check_string_free_list): Convert to standard C.
1827 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
1829 * w32.c (emacs_gnutls_push): Fix typo.
1831 2011-04-25 Eli Zaretskii <eliz@gnu.org>
1833 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
1834 "cast to pointer from integer of different size".
1836 Improve doprnt and its use in verror. (Bug#8545)
1837 * doprnt.c (doprnt): Document the set of format control sequences
1838 supported by the function. Use SAFE_ALLOCA instead of always
1841 * eval.c (verror): Don't limit the buffer size at size_max-1, that
1842 is one byte too soon. Don't use xrealloc; instead xfree and
1845 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
1847 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
1850 * gnutls.c: Renamed global_initialized to
1851 gnutls_global_initialized. Added internals for the
1852 :verify-hostname-error, :verify-error, and :verify-flags
1853 parameters of `gnutls-boot' and documented those parameters in the
1854 docstring. Start callback support.
1855 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
1856 unless a fatal error occured. Call gnutls_alert_send_appropriate
1857 on error. Return error code.
1858 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
1859 (emacs_gnutls_read): Likewise.
1860 (Fgnutls_boot): Return handshake error code.
1861 (emacs_gnutls_handle_error): New function.
1862 (wsaerror_to_errno): Likewise.
1864 * w32.h (emacs_gnutls_pull): Add prototype.
1865 (emacs_gnutls_push): Likewise.
1867 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
1868 (emacs_gnutls_push): Likewise.
1870 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
1872 * process.c (wait_reading_process_output): Check if GnuTLS
1873 buffered some data internally if no FDs are set for TLS
1876 * makefile.w32-in (OBJ2): Add gnutls.$(O).
1877 (LIBS): Link to USER_LIBS.
1878 ($(BLD)/gnutls.$(0)): New target.
1880 2011-04-24 Eli Zaretskii <eliz@gnu.org>
1882 * xdisp.c (handle_single_display_spec): Rename the
1883 display_replaced_before_p argument into display_replaced_p, to
1884 make it consistent with the commentary. Fix typos in the
1887 * textprop.c (syms_of_textprop): Remove dead code.
1888 (copy_text_properties): Delete obsolete commentary about an
1889 interface that was deleted long ago. Fix typos in the description
1892 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
1893 to changes in oldXMenu/XMenu.h from 2011-04-16.
1894 <menu_help_message, prev_menu_help_message>: Constify.
1895 (IT_menu_make_room): menu->help_text is now `const char **';
1898 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
1899 to changes in oldXMenu/XMenu.h from 2011-04-16.
1900 (struct XMenu): Declare `help_text' `const char **'.
1902 * xfaces.c <Qunspecified>: Make extern again.
1904 * syntax.c: Include sys/types.h before including regex.h, as
1907 * doc.c (get_doc_string): Improve the format passed to `error'.
1909 * doprnt.c (doprnt): Improve commentary.
1911 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
1913 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
1916 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
1917 changes in globals.h immediately force recompilation.
1918 (TAGS): Depend on $(CURDIR)/m/intel386.h and
1919 $(CURDIR)/s/ms-w32.h.
1920 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
1922 * character.c (Fchar_direction): Function deleted.
1923 (syms_of_character): Don't defsubr it.
1924 <char-direction-table>: Deleted.
1926 2011-04-23 Eli Zaretskii <eliz@gnu.org>
1928 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
1929 * doprnt.c: Include limits.h.
1930 (SIZE_MAX): New macro.
1931 (doprnt): Return a size_t value. 2nd arg is now size_t.
1932 Many local variables are now size_t instead of int or unsigned.
1933 Improve overflow protection. Support `l' modifier for integer
1934 conversions. Support %l conversion. Don't assume an EMACS_INT
1935 argument for integer conversions and for %c.
1937 * lisp.h (doprnt): Restore prototype.
1939 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
1942 * Makefile.in (base_obj): Add back doprnt.o.
1944 * deps.mk (doprnt.o): Add back prerequisites.
1945 (callint.o): Depend on character.h.
1947 * eval.c (internal_lisp_condition_case): Include the handler
1948 representation in the error message.
1949 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
1950 when breaking from the loop.
1952 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
1954 * callint.c (Fcall_interactively): When displaying error message
1955 about invalid control letter, pass the character's codepoint, not
1956 a pointer to its multibyte form. Improve display of the character
1957 in octal and display also its hex code.
1959 * character.c (char_string): Use %x to display the (unsigned)
1960 codepoint of an invalid character, to avoid displaying a bogus
1963 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
1964 `error', not SYMBOL_NAME itself.
1966 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
1967 character arguments to `error'.
1969 * charset.c (check_iso_charset_parameter): Fix incorrect argument
1970 to `error' in error message about FINAL_CHAR argument. Make sure
1971 FINAL_CHAR is a character, and use %c when it is passed as
1972 argument to `error'.
1974 2011-04-23 Eli Zaretskii <eliz@gnu.org>
1976 * s/ms-w32.h (localtime): Redirect to sys_localtime.
1978 * w32.c: Include <time.h>.
1979 (sys_localtime): New function.
1981 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
1983 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
1985 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
1987 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
1989 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
1992 2011-04-19 Eli Zaretskii <eliz@gnu.org>
1994 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
1995 gl_state.e_property when gl_state.object is Qt.
1997 * insdel.c (make_gap_larger): Remove limitation of buffer size
2000 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
2002 * xdisp.c (lookup_glyphless_char_display)
2003 (produce_glyphless_glyph): Handle cons cell entry in
2004 glyphless-char-display.
2005 (Vglyphless_char_display): Document it.
2007 * term.c (produce_glyphless_glyph): Handle cons cell entry in
2008 glyphless-char-display.
2010 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
2012 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
2014 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
2016 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
2017 definition for no-X builds.
2019 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
2021 Static checks with GCC 4.6.0 and non-default toolkits.
2023 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
2025 * process.c (keyboard_bit_set): Define only if SIGIO.
2026 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
2027 (send_process): Repair possible setjmp clobbering.
2029 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
2031 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
2033 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
2035 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
2036 Define only if needed.
2038 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
2039 by pacifying GCC about it. Maybe it's time to retire it?
2040 * xfaces.c (USG, __TIMEVAL__): Likewise.
2042 * dispextern.h (struct redisplay_interface): Rename param
2044 * termhooks.h (struct terminal): Likewise.
2045 * xterm.c (xembed_send_message): Likewise.
2047 * insdel.c (make_gap_smaller): Define only if
2048 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
2050 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
2053 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
2054 so that we aren't warned about unused symbols.
2056 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
2058 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
2060 * xfns.c (x_real_positions): Mark locals as initialized.
2062 * xmenu.c (xmenu_show): Don't use uninitialized vars.
2064 * xterm.c: Fix problems found by static analysis with other toolkits.
2065 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
2066 (x_dispatch_event): Declare static if USE_GTK, and
2067 define if USE_GTK || USE_X_TOOLKIT.
2068 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
2069 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
2070 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
2071 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
2073 * xmenu.c (menu_help_callback): Pointer type fixes.
2074 Use const pointers when pointing at readonly data. Avoid pointer
2076 (FALSE): Remove unused macro.
2077 (update_frame_menubar): Remove unused decl.
2079 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
2081 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
2082 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
2083 (single_menu_item): Rename local to avoid shadowing.
2085 * keyboard.c (make_lispy_event): Remove unused local var.
2087 * frame.c, frame.h (x_get_resource_string): Bring this back, but
2088 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
2090 * bitmaps: Change bitmaps from unsigned char back to the X11
2091 compatible char. Avoid the old compiler warnings about
2092 out-of-range initializers by using, for example, '\xab' rather
2095 * xgselect.c (xgselect_initialize): Check vs interface
2096 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
2098 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
2100 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
2101 to read-only memory.
2103 * fns.c (vector): Remove; this old hack is no longer needed.
2105 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
2107 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2109 * xrdb.c (x_load_resources): Omit unused local.
2111 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
2112 (x_window): Rename locals to avoid shadowing.
2113 (USG): Use the kludged USG macro, to pacify gcc.
2115 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
2116 (x_term_init): Remove local to avoid shadowing.
2118 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
2120 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
2121 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
2123 2011-04-16 Eli Zaretskii <eliz@gnu.org>
2125 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
2127 Fix regex.c, syntax.c and friends for buffers > 2GB.
2128 * syntax.h (struct gl_state_s): Declare character position members
2131 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
2133 * textprop.c (verify_interval_modification, interval_of):
2134 Declare arguments EMACS_INT.
2136 * intervals.c (adjust_intervals_for_insertion): Declare arguments
2139 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
2141 * indent.c (Fvertical_motion): Local variable it_start is now
2144 * regex.c (re_match, re_match_2, re_match_2_internal)
2145 (bcmp_translate, regcomp, regexec, print_double_string)
2146 (group_in_compile_stack, re_search, re_search_2, regex_compile)
2147 (re_compile_pattern, re_exec): Declare arguments and local
2148 variables `size_t' and `ssize_t' and return values `regoff_t', as
2150 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
2151 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
2152 <compile_stack_type>: `size' and `avail' are now `size_t'.
2154 * regex.h <regoff_t>: Use ssize_t, not int.
2155 (re_search, re_search_2, re_match, re_match_2): Arguments that
2156 specify buffer/string position and length are now ssize_t and
2157 size_t. Return type is regoff_t.
2159 2011-04-16 Ben Key <bkey76@gmail.com>
2161 * nsfont.m: Fixed bugs in ns_get_family and
2162 ns_descriptor_to_entity that were caused by using free to
2163 deallocate memory blocks that were allocated by xmalloc (via
2164 xstrdup). This caused Emacs to crash when compiled with
2165 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
2166 --enable-checking=xmallocoverrun). xfree is now used to
2167 deallocate these memory blocks.
2169 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
2171 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
2173 emacs_write: Accept and return EMACS_INT for sizes.
2174 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
2176 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
2177 Accept and return EMACS_INT.
2178 (emacs_gnutls_write): Return the number of bytes written on
2180 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
2181 (emacs_read, emacs_write): Remove check for negative size, as the
2182 Emacs source code has been audited now.
2183 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
2184 (emacs_read, emacs_write): Use it.
2185 * process.c (send_process): Adjust to the new signatures of
2186 emacs_write and emacs_gnutls_write. Do not attempt to store
2187 a byte offset into an 'int'; it might overflow.
2188 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
2190 * sound.c: Don't assume sizes fit in 'int'.
2191 (struct sound_device.period_size, alsa_period_size):
2192 Return EMACS_INT, not int.
2193 (struct sound_device.write, vox_write, alsa_write):
2194 Accept EMACS_INT, not int.
2195 (wav_play, au_play): Use EMACS_INT to store sizes and to
2196 record read return values.
2198 2011-04-15 Ben Key <bkey76@gmail.com>
2200 * keyboard.c (Qundefined): Don't declare static since it is used
2202 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
2203 static since they are used in nsfont.m.
2205 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
2207 * process.c (Qprocessp): Don't declare static.
2208 * lisp.h (Qprocessp): Declare again.
2210 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
2212 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
2214 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
2216 Improve C-level modularity by making more things 'static'.
2218 Don't publish debugger-only interfaces to other modules.
2219 * lisp.h (safe_debug_print, debug_output_compilation_hack):
2220 (verify_bytepos, count_markers): Move decls to the only modules
2222 * region-cache.h (pp_cache): Likewise.
2223 * window.h (check_all_windows): Likewise.
2224 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
2226 * sysdep.c (croak): Now static, if
2227 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
2228 * syssignal.h (croak): Declare only if not static.
2230 * alloc.c (refill_memory_reserve): Now static if
2231 !defined REL_ALLOC || defined SYSTEM_MALLOC.
2232 * lisp.h (refill_memory_reserve): Declare only if not static.
2234 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
2235 Define only if USE_LUCID.
2237 * xrdb.c (x_customization_string, x_rm_string): Now static.
2239 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
2240 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
2242 * xdisp.c (draw_row_with_mouse_face): Now static.
2243 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
2245 * window.h (check_all_windows): Mark externally visible.
2247 * window.c (window_deletion_count): Now static.
2249 * undo.c: Make symbols static if they're not exported.
2250 (last_undo_buffer, last_boundary_position, pending_boundary):
2253 * textprop.c (interval_insert_behind_hooks): Now static.
2254 (interval_insert_in_front_hooks): Likewise.
2256 * term.c: Make symbols static if they're not exported.
2257 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
2258 (max_frame_lines, tty_set_terminal_modes):
2259 (tty_reset_terminal_modes, tty_turn_off_highlight):
2260 (get_tty_terminal): Now static.
2261 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
2262 * termhooks.h (term_mouse_moveto): Do not declare if
2264 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
2265 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
2267 * sysdep.c: Make symbols static if they're not exported.
2268 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
2270 (sigprocmask_set, full_mask): Remove; unused.
2271 (wait_debugging): Mark as visible.
2272 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
2273 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
2275 * syntax.c (syntax_temp): Define only if !__GNUC__.
2277 * sound.c (current_sound_device, current_sound): Now static.
2279 * search.c (searchbufs, searchbuf_head): Now static.
2281 * scroll.c (scroll_cost): Remove; unused.
2282 * dispextern.h (scroll_cost): Remove decl.
2284 * region-cache.h (pp_cache): Mark as externally visible.
2286 * process.c: Make symbols static if they're not exported.
2287 (process_tick, update_tick, create_process, chan_process):
2288 (Vprocess_alist, proc_buffered_char, datagram_access):
2289 (fd_callback_data, send_process_frame, process_sent_to): Now static.
2290 (deactivate_process): Mark defn as static, as well as decl.
2291 * lisp.h (create_process): Remove decl.
2292 * process.h (chan_process, Vprocess_alist): Remove decls.
2294 * print.c: Make symbols static if they're not exported.
2295 (print_depth, new_backquote_output, being_printed, print_buffer):
2296 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
2297 (print_interval, print_number_index, initial_stderr_stream):
2299 * lisp.h (Fprinc): Remove decl.
2300 (debug_output_compilation_hack): Mark as externally visible.
2302 * sysdep.c (croak): Move decl from here to syssignal.h.
2303 * syssignal.h (croak): Put it here, so the API can be checked when
2304 'croak' is called from dissociate_if_controlling_tty.
2306 * minibuf.c: Make symbols static if they're not exported.
2307 (minibuf_save_list, choose_minibuf_frame): Now static.
2308 * lisp.h (choose_minibuf_frame): Remove decl.
2310 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
2312 * lread.c: Make symbols static if they're not exported.
2313 (read_objects, initial_obarray, oblookup_last_bucket_number):
2315 (make_symbol): Remove; unused.
2316 * lisp.h (initial_obarray, make_symbol): Remove decls.
2318 * keyboard.c: Make symbols static if they're not exported.
2319 (single_kboard, recent_keys_index, total_keys, recent_keys):
2320 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
2321 (this_single_command_key_start, echoing, last_auto_save):
2322 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
2323 (command_loop, echo_now, keyboard_init_hook, help_char_p):
2324 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
2325 (Vlispy_mouse_stem, double_click_count):
2327 (force_auto_save_soon): Define only if SIGDANGER.
2328 (ignore_mouse_drag_p): Now static if
2329 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
2330 (print_help): Remove; unused.
2331 (stop_character, last_timer_event): Mark as externally visible.
2332 * keyboard.h (ignore_mouse_drag_p): Declare only if
2333 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
2334 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
2335 * lisp.h (echoing): Remove decl.
2336 (force_auto_save_soon): Declare only if SIGDANGER.
2337 * xdisp.c (redisplay_window): Simplify code, to make it more
2338 obvious that ignore_mouse_drag_p is not accessed if !defined
2339 USE_GTK && !defined HAVE_NS.
2341 * intervals.c: Make symbols static if they're not exported.
2342 (merge_properties_sticky, merge_interval_right, delete_interval):
2344 * intervals.h (merge_interval_right, delete_interval): Remove decls.
2346 * insdel.c: Make symbols static if they're not exported.
2347 However, leave prepare_to_modify_buffer alone. It's never
2348 called from outside this function, but that appears to be a bug.
2349 (combine_after_change_list, combine_after_change_buffer):
2350 (adjust_after_replace, signal_before_change): Now static.
2351 (adjust_after_replace_noundo): Remove; unused.
2352 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
2353 (signal_before_change): Remove decls.
2355 * indent.c (val_compute_motion, val_vmotion): Now static.
2357 * image.c: Make symbols static if they're not exported.
2358 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
2360 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
2361 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
2363 * fringe.c (standard_bitmaps): Now static.
2364 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
2366 * frame.c: Make symbols static if they're not exported.
2367 (x_report_frame_params, make_terminal_frame): Now static.
2368 (get_frame_param): Now static, unless HAVE_NS.
2369 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
2370 (x_get_resource_string): Remove; not used.
2371 * frame.h (make_terminal_frame, x_report_frame_params):
2372 (x_get_resource_string); Remove decls.
2373 (x_fullscreen_adjust): Declare only if WINDOWSNT.
2374 * lisp.h (get_frame_param): Declare only if HAVE_NS.
2376 * font.c, fontset.c: Make symbols static if they're not exported.
2377 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
2378 (FACE_SUITABLE_FOR_CHAR_P): Use it.
2379 * font.c (font_close_object): Now static.
2380 * font.h (font_close_object): Remove.
2381 * fontset.c (FONTSET_OBJLIST): Remove.
2382 (free_realized_fontset) #if-0 the body, which does nothing.
2383 (face_suitable_for_char_p): #if-0, as it's never called.
2384 * fontset.h (face_suitable_for_char_p): Remove decl.
2385 * xfaces.c (face_at_string_position):
2386 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
2387 since 0 is always ASCII.
2389 * fns.c (weak_hash_tables): Now static.
2391 * fileio.c: Make symbols static if they're not exported.
2392 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
2393 (Vwrite_region_annotation_buffers): Now static.
2395 * eval.c: Make symbols static if they're not exported.
2396 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
2397 * lisp.h (backtrace_list): Remove decl.
2399 * emacs.c: Make symbols static if they're not exported.
2400 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
2401 (fatal_error_code, fatal_error_signal_hook, standard_args):
2403 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
2404 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
2405 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
2406 * lisp.h (fatal_error_signal_hook): Remove decl.
2407 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
2409 * editfns.c: Move a (normally-unused) function to its only use.
2410 * editfns.c, lisp.h (get_operating_system_release): Remove.
2411 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
2412 worth the hassle of breaking this out.
2414 * xterm.c: Make symbols static if they're not exported.
2415 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
2416 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
2417 (x_destroy_window, x_delete_display):
2419 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
2420 (x_mouse_leave): Remove; unused.
2421 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
2422 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
2423 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
2425 (x_mouse_leave): Declare only if WINDOWSNT.
2426 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
2427 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
2430 * ftxfont.c: Make symbols static if they're not exported.
2431 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
2433 * font.h (ftxfont_driver): Likewise.
2435 * xfns.c: Make symbols static if they're not exported.
2436 (x_last_font_name, x_display_info_for_name):
2437 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
2438 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
2439 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
2440 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
2441 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
2442 (last_show_tip_args): Now static.
2443 (xic_defaut_fontset, xic_create_fontsetname): Define only if
2444 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
2445 (x_screen_planes): Remove; unused.
2446 * dispextern.h (x_screen_planes): Remove decl.
2448 * dispnew.c: Make symbols static if they're not exported.
2449 * dispextern.h (redraw_garbaged_frames, scrolling):
2450 (increment_row_positions): Remove.
2451 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
2452 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
2454 (redraw_garbaged_frames): Remove; unused.
2456 * xfaces.c: Make symbols static if they're not exported.
2457 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
2459 * xterm.h (defined_color): Remove decls.
2460 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
2461 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
2462 (menu_face_changed_default, defined_color, free_realized_face):
2463 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
2464 (ascii_face_of_lisp_face): Remove; unused.
2466 * xdisp.c: Make symbols static if they're not exported.
2467 * dispextern.h (scratch_glyph_row, window_box_edges):
2468 (glyph_to_pixel_coords, set_cursor_from_row):
2469 (get_next_display_element, set_iterator_to_next):
2470 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
2471 (show_mouse_face): Remove decls
2472 * frame.h (message_buf_print): Likewise.
2473 * lisp.h (pop_message, set_message, check_point_in_composition):
2475 * xterm.h (set_vertical_scroll_bar): Likewise.
2476 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
2477 (message_buf_print, scratch_glyph_row, displayed_buffer):
2478 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
2479 (get_next_display_element, show_mouse_face, window_box_edges):
2480 (frame_to_window_pixel_xy, check_point_in_composition):
2481 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
2482 (glyph_to_pixel_coords): Remove; unused.
2484 * dired.c (file_name_completion): Now static.
2486 * dbusbind.c (xd_in_read_queued_messages): Now static.
2488 * lisp.h (circular_list_error, FOREACH): Remove; unused.
2489 * data.c (circular_list_error): Remove.
2491 * commands.h (last_point_position, last_point_position_buffer):
2492 (last_point_position_window): Remove decls.
2493 * keyboard.c: Make these variables static.
2495 * coding.h (coding, code_convert_region, encode_coding_gap):
2497 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
2498 (iso_code_class, detect_coding, code_convert_region): Now static.
2499 (encode_coding_gap): Remove; unused.
2501 * chartab.c (chartab_chars, chartab_bits): Now static.
2503 * charset.h (charset_iso_8859_1): Remove decl.
2504 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
2507 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
2508 * ccl.c (Vccl_program_table): Now static.
2509 (check_ccl_update): Remove; unused.
2511 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
2512 * category.h: ... from here.
2513 * category.c (check_category_table, set_category_set): Now static.
2515 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
2516 * lisp.h: Remove these decls.
2518 * buffer.c (buffer_count): Remove unused var.
2520 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
2521 so that it's not optimized away.
2522 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
2523 * dispextern.h (bidi_dump_cached_states): Remove, since it's
2524 exported only to the debugger.
2526 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
2527 * atimer.h (run_all_atimers): Remove; not exported.
2529 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
2530 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
2531 was inaccessible from Lisp.
2532 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
2533 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
2535 alloc.c: Import and export fewer symbols, and remove unused items.
2536 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
2538 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
2539 it's not optimized away by whole-program optimization.
2540 (message_enable_multibyte, free_misc): Remove.
2541 (catchlist, handlerlist, mark_backtrace):
2542 Declare only if BYTE_MARK_STACK.
2543 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
2544 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
2545 (message_enable_multibyte): Remove decl.
2546 (free_misc, interval_free_list, float_block, float_block_index):
2547 (n_float_blocks, float_free_list, cons_block, cons_block_index):
2548 (cons_free_list, last_marked_index):
2550 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
2551 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
2552 (mark_backtrace): Define only if BYTE_MARK_STACK.
2553 * xdisp.c (message_enable_multibyte): Now static.
2555 Declare Lisp_Object Q* variables to be 'static' if not exported.
2556 This makes it easier for human readers (and static analyzers)
2557 to see whether these variables are used from other modules.
2558 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
2559 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
2560 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
2561 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
2562 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
2563 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
2564 * xmenu.c, xselect.c:
2565 Declare Q* vars static if they are not used in other modules.
2566 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
2567 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
2568 Remove decls of unexported vars.
2569 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
2571 * lisp.h (DEFINE_FUNC): Make sname 'static'.
2573 Make Emacs functions such as Fatom 'static' by default.
2574 This makes it easier for human readers (and static analyzers)
2575 to see whether these functions can be called from other modules.
2576 DEFUN now defines a static function. To make the function external
2577 so that it can be used in other C modules, use the new macro DEFUE.
2578 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
2579 (Finit_image_library):
2580 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
2581 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
2582 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
2583 Remove decls, since these functions are now static.
2584 (Funintern, Fget_internal_run_time): New decls, since these functions
2585 were already external.
2587 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
2588 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
2589 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
2590 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
2591 * keyboard.c, keymap.c, lread.c:
2592 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
2593 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
2594 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
2595 Mark functions with DEFUE instead of DEFUN,
2596 if they are used in other modules.
2597 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
2598 decls for now-static functions.
2599 * buffer.h (Fdelete_overlay): Remove decl.
2600 * callproc.c (Fgetenv_internal): Mark as internal.
2601 * composite.c (Fremove_list_of_text_properties): Remove decl.
2602 (Fcomposition_get_gstring): New forward static decl.
2603 * composite.h (Fcomposite_get_gstring): Remove decl.
2604 * dired.c (Ffile_attributes): New forward static decl.
2605 * doc.c (Fdocumntation_property): New forward static decl.
2606 * eval.c (Ffetch_bytecode): New forward static decl.
2607 (Funintern): Remove extern decl; now in .h file where it belongs.
2608 * fileio.c (Fmake_symbolic_link): New forward static decl.
2609 * image.c (Finit_image_library): New forward static decl.
2610 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
2611 * intervals.h (Fprevious_property_change):
2612 (Fremove_list_of_text_properties): Remove decls.
2613 * keyboard.c (Fthis_command_keys): Remove decl.
2614 (Fcommand_execute): New forward static decl.
2615 * keymap.c (Flookup_key): New forward static decl.
2616 (Fcopy_keymap): Now static.
2617 * keymap.h (Flookup_key): Remove decl.
2618 * process.c (Fget_process): New forward static decl.
2619 (Fprocess_datagram_address): Mark as internal.
2620 * syntax.c (Fsyntax_table_p): New forward static decl.
2621 (skip_chars): Remove duplicate decl.
2622 * textprop.c (Fprevious_property_change): New forward static decl.
2623 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
2625 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
2626 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
2628 * editfns.c (Fformat): Remove unreachable code.
2630 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
2632 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
2635 2011-04-13 Eli Zaretskii <eliz@gnu.org>
2637 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
2638 when at ZV. (Bug#8487)
2640 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
2642 * charset.c (Fclear_charset_maps): Use xfree instead of free.
2644 * keyboard.c (parse_tool_bar_item): Likewise.
2645 * sound.c (sound_cleanup, alsa_close): Likewise.
2646 * termcap.c (tgetent): Likewise.
2647 * xfns.c (x_default_font_parameter): Likewise.
2648 * xsettings.c (read_and_apply_settings): Likewise.
2650 * alloc.c (overrun_check_malloc, overrun_check_realloc)
2651 (overrun_check_free): Protoize.
2653 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
2655 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
2656 since callers should never pass a negative size.
2657 Change the signature to match that of plain 'read' and 'write'; see
2658 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
2659 * lisp.h: Update prototypes of emacs_write and emacs_read.
2661 2011-04-11 Eli Zaretskii <eliz@gnu.org>
2663 * xdisp.c (redisplay_window): Don't try to determine the character
2664 position of the scroll margin if the window start point w->startp
2665 is outside the buffer's accessible region. (Bug#8468)
2667 2011-04-10 Eli Zaretskii <eliz@gnu.org>
2669 Fix write-region and its subroutines for buffers > 2GB.
2670 * fileio.c (a_write, e_write): Modify declaration of arguments and
2671 local variables to support buffers larger than 2GB.
2672 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
2674 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
2675 argument, local variables, and return value.
2677 * lisp.h: Update prototypes of emacs_write and emacs_read.
2679 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
2681 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
2683 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
2685 Fix more problems found by GCC 4.6.0's static checks.
2687 * xdisp.c (vmessage): Use a better test for character truncation.
2689 * charset.c (load_charset_map): <, not <=, for optimization,
2690 and to avoid potential problems with integer overflow.
2691 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
2692 * casetab.c (set_identity, shuffle): Likewise.
2693 * editfns.c (Fformat): Likewise.
2694 * syntax.c (skip_chars): Likewise.
2696 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
2697 This also lets GCC 4.6.0 generate slightly better loop code.
2699 * callint.c (Fcall_interactively): <, not <=, for optimization.
2700 (Fcall_interactively): Count the number of arguments produced,
2701 not the number of arguments given. This is simpler and lets GCC
2702 4.6.0 generate slightly better code.
2704 * ftfont.c: Distingish more carefully between FcChar8 and char.
2705 The previous code passed unsigned char * to a functions like
2706 strlen and xstrcasecmp that expect char *, which does not
2707 conform to the C standard.
2708 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
2709 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
2710 char * when the C standard requires it.
2712 * keyboard.c (read_char): Remove unused var.
2714 * eval.c: Port to Windows vsnprintf (Bug#8435).
2716 (SIZE_MAX): Define if the headers do not.
2717 (verror): Do not give up if vsnprintf returns a negative count.
2718 Instead, grow the buffer. This ports to Windows vsnprintf, which
2719 does not conform to C99. Problem reported by Eli Zaretskii.
2720 Also, simplify the allocation scheme, by avoiding the need for
2721 calling realloc, and removing the ALLOCATED variable.
2723 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
2725 Remove invocations of doprnt, as Emacs now uses vsnprintf.
2726 But keep the doprint source code for now, as we might revamp it
2727 and use it again (Bug#8435).
2728 * lisp.h (doprnt): Remove.
2729 * Makefile.in (base_obj): Remove doprnt.o.
2730 * deps.mk (doprnt.o): Remove.
2732 error: Print 32- and 64-bit integers portably (Bug#8435).
2733 Without this change, on typical 64-bit hosts error ("...%d...", N)
2734 was used to print both 32- and 64-bit integers N, which relied on
2736 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
2738 * lisp.h (error, verror): Mark as printf-like functions.
2739 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
2740 Report overflow in size calculations when allocating printf buffer.
2741 Do not truncate output string at its first null byte.
2742 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
2743 Truncate the output at a character boundary, since vsnprintf does not
2745 * charset.c (check_iso_charset_parameter): Convert internal
2746 character to string before calling 'error', since %c now has the
2748 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
2749 overflow when computing char to be passed to 'error'. Do not
2750 pass Lisp_Object to 'error'; pass the integer instead.
2751 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
2752 formatted with plain %d.
2754 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
2756 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
2758 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
2760 * xterm.c (x_catch_errors): Remove duplicate declaration.
2762 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
2764 * xdisp.c, lisp.h (message_nolog): Remove; unused.
2766 2011-04-10 Jim Meyering <meyering@redhat.com>
2768 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
2769 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
2770 return ssize_t not "int", and use size_t as the buffer length.
2771 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
2772 * gnutls.h: Update declarations.
2773 * process.c (read_process_output): Use ssize_t, to match.
2774 (send_process): Likewise.
2776 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
2778 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
2780 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
2782 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
2783 Use unsigned char, to match FcChar8 type definition.
2785 * xterm.c (handle_one_xevent):
2786 * xmenu.c (create_and_show_popup_menu):
2787 * xselect.c (x_decline_selection_request)
2788 (x_reply_selection_request): Avoid type-punned deref of X events.
2790 2011-04-09 Eli Zaretskii <eliz@gnu.org>
2792 Fix some uses of `int' instead of EMACS_INT.
2793 * search.c (string_match_1, fast_string_match)
2794 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
2795 (scan_buffer, find_next_newline_no_quit)
2796 (find_before_next_newline, search_command, Freplace_match)
2797 (Fmatch_data): Make some `int' variables be EMACS_INT.
2799 * xdisp.c (display_count_lines): 3rd argument and return value now
2800 EMACS_INT. All callers changed.
2801 (pint2hrstr): Last argument is now EMACS_INT.
2803 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
2804 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2805 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
2806 (decode_coding_utf_16, decode_coding_emacs_mule)
2807 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
2808 (decode_coding_ccl, decode_coding_charset)
2809 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
2810 (decode_coding_iso_2022, decode_coding_emacs_mule)
2811 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
2812 <char_offset, last_offset>: Declare EMACS_INT.
2813 (encode_coding_utf_8, encode_coding_utf_16)
2814 (encode_coding_emacs_mule, encode_invocation_designation)
2815 (encode_designation_at_bol, encode_coding_iso_2022)
2816 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
2817 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
2819 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
2820 (encode_invocation_designation): Last argument P_NCHARS is now
2822 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
2823 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
2825 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
2828 * ccl.c (Fccl_execute_on_string): Declare some variables
2831 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
2833 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
2835 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
2837 * process.c (Fformat_network_address): Doc fix.
2839 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
2841 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
2843 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
2845 * keyboard.c (read_char): Call Lisp function help-form-show,
2846 instead of using internal_with_output_to_temp_buffer.
2847 (Qhelp_form_show): New var.
2848 (syms_of_keyboard): Use DEFSYM macro.
2850 * print.c (internal_with_output_to_temp_buffer): Function deleted.
2852 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
2854 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
2856 * process.c (Flist_processes): Remove to Lisp.
2857 (list_processes_1): Delete.
2859 2011-04-06 Eli Zaretskii <eliz@gnu.org>
2861 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
2863 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
2865 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
2867 Fix more problems found by GCC 4.6.0's static checks.
2869 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
2871 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
2873 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
2875 * xdisp.c (vmessage): Mark as a printf-like function.
2877 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
2879 * sound.c (sound_warning): Don't crash if arg contains a printf format.
2881 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
2882 printf-like functions.
2883 (tiff_load): Add casts to remove these marks before passing them
2884 to system-supplied API.
2886 * eval.c (Fsignal): Remove excess argument to 'fatal'.
2888 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
2889 This avoids several warnings with gcc -Wstrict-overflow.
2890 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
2891 directly, rather than having caller test rule sign. This avoids
2892 some unnecessary tests.
2893 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
2894 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
2895 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
2897 * xfont.c (xfont_text_extents): Remove var that was set but not used.
2898 (xfont_open): Avoid unnecessary tests.
2900 * composite.c (composition_gstring_put_cache): Use unsigned integer.
2902 * composite.h, composite.c (composition_gstring_put_cache):
2903 Use EMACS_INT, not int, for length.
2905 * composite.h (COMPOSITION_DECODE_REFS): New macro,
2906 breaking out part of COMPOSITION_DECODE_RULE.
2907 (COMPOSITION_DECODE_RULE): Use it.
2908 * composite.c (get_composition_id): Remove unused local vars,
2909 by using the new macro.
2911 * textprop.c (set_text_properties_1): Change while to do-while,
2912 since the condition is always true at first.
2914 * intervals.c (graft_intervals_into_buffer): Mark var as used.
2915 (interval_deletion_adjustment): Return unsigned value.
2918 * process.c (list_processes_1, create_pty, read_process_output):
2919 (exec_sentinel): Remove vars that were set but not used.
2920 (create_pty): Remove unnecessary "volatile"s.
2921 (Fnetwork_interface_info): Avoid possibility of int overflow.
2922 (read_process_output): Do adaptive read buffering even if carryover.
2923 (read_process_output): Simplify nbytes computation if buffered.
2925 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
2927 * syntax.c (scan_words): Remove var that was set but not used.
2928 (update_syntax_table): Use unsigned instead of int.
2930 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
2931 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
2932 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
2934 * print.c (print_error_message): Avoid int overflow.
2936 * font.c (font_list_entities): Redo for clarity,
2937 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
2939 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
2940 (font_score): Avoid potential overflow in diff calculation.
2942 * fns.c (substring_both): Remove var that is set but not used.
2943 (sxhash): Redo loop for clarity and to avoid wraparound warning.
2945 * eval.c (funcall_lambda): Rename local to avoid shadowing.
2947 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
2948 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
2949 can always succeed if overflow has undefined behavior.
2951 * search.c (boyer_moore, wordify): Remove vars set but not used.
2952 (wordify): Omit three unnecessary tests.
2954 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
2955 All callers changed. This avoids the need for an unused var.
2957 * casefiddle.c (casify_region): Remove var that is set but not used.
2959 * dired.c (file_name_completion): Remove var that is set but not used.
2961 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
2963 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
2964 (Finsert_file_contents): Remove unnecessary code checking fd.
2966 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
2967 Check for integer overflow on size calculations.
2969 * buffer.c (Fprevious_overlay_change): Remove var that is set
2972 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
2973 Remove vars that are set but not used.
2974 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
2975 (timer_check_2): Mark vars as initialized.
2977 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
2979 * image.c (lookup_image): Remove var that is set but not used.
2980 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
2982 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
2983 that are set but not used.
2985 * xfns.c (make_invisible_cursor): Don't return garbage
2986 if XCreateBitmapFromData fails (Bug#8410).
2988 * xselect.c (x_get_local_selection, x_handle_property_notify):
2989 Remove vars that are set but not used.
2991 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
2992 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
2994 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
2995 Remove var that is set but not used.
2996 (scroll_bar_windows_size): Now size_t, not int.
2997 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
3000 * xfaces.c (realize_named_face): Remove vars that are set but not used.
3001 (map_tty_color) [!defined MSDOS]: Likewise.
3003 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
3005 * coding.c: Remove vars that are set but not used.
3006 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
3007 All callers changed.
3008 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
3009 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
3010 (decode_coding_charset): Remove vars that are set but not used.
3012 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
3013 that is set but not used.
3015 * print.c (print_object): Remove var that is set but not used.
3017 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
3018 The gnulib version avoids calling malloc in the usual case,
3019 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
3020 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
3021 * filelock.c (current_lock_owner): Likewise.
3022 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
3023 * sysdep.c: Include allocator.h, careadlinkat.h.
3024 (emacs_no_realloc_allocator): New static constant.
3025 (emacs_readlink): New function.
3026 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
3027 ../lib/careadlinkat.h.
3029 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
3031 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
3032 first non-nil return value).
3034 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
3036 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
3037 if not defined (Bug#8403).
3039 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
3041 * xdisp.c (display_count_lines): Remove parameter `start',
3042 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
3043 (get_char_face_and_encoding): Remove parameter `multibyte_p',
3044 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
3045 (fill_stretch_glyph_string): Remove parameters `row' and `area',
3046 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
3047 and thereabouts. All callers changed.
3048 (get_per_char_metric): Remove parameter `f', unused since
3049 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
3051 2011-04-02 Jim Meyering <meyering@redhat.com>
3053 do not dereference NULL upon failed strdup
3054 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
3055 (ns_get_family): Likewise.
3057 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
3059 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
3061 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
3063 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
3066 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
3068 Add lexical binding.
3070 * window.c (Ftemp_output_buffer_show): New fun.
3071 (Fsave_window_excursion):
3072 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
3074 * lread.c (lisp_file_lexically_bound_p): New function.
3075 (Fload): Bind Qlexical_binding.
3076 (readevalloop): Remove `evalfun' arg.
3077 Bind Qinternal_interpreter_environment.
3078 (Feval_buffer): Bind Qlexical_binding.
3079 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
3081 (syms_of_lread): Declare `lexical-binding'.
3083 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
3085 * keyboard.c (eval_dyn): New fun.
3086 (menu_item_eval_property): Use it.
3088 * image.c (parse_image_spec): Use Ffunctionp.
3090 * fns.c (concat, mapcar1): Accept byte-code-functions.
3092 * eval.c (Fsetq): Handle lexical vars.
3093 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
3094 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
3095 (FletX, Flet): Obey lexical binding.
3096 (Fcommandp): Handle closures.
3097 (Feval): New `lexical' arg.
3098 (eval_sub): New function extracted from Feval. Use it almost
3099 everywhere where Feval was used. Look up vars in lexical env.
3101 (Ffunctionp): Move from subr.el.
3102 (Ffuncall): Handle closures.
3103 (apply_lambda): Remove `eval_flags'.
3104 (funcall_lambda): Handle closures and new byte-code-functions.
3105 (Fspecial_variable_p): New function.
3106 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
3107 but without exporting it to Lisp.
3109 * doc.c (Fdocumentation, store_function_docstring):
3110 * data.c (Finteractive_form): Handle closures.
3112 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
3115 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
3117 (exec_byte_code): New function extracted from Fbyte_code to handle new
3118 calling convention for byte-code-functions. Add new byte-codes.
3120 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
3122 * alloc.c (Fmake_symbol): Init new `declared_special' field.
3124 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
3126 * xdisp.c (redisplay_internal): Fix prototype.
3128 2011-03-31 Eli Zaretskii <eliz@gnu.org>
3130 * xdisp.c (SCROLL_LIMIT): New macro.
3131 (try_scrolling): Use it when setting scroll_limit.
3132 Limit scrolling to 100 screen lines.
3133 (redisplay_window): Even when falling back on "recentering",
3134 position point in the window according to scroll-conservatively,
3135 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
3137 (try_scrolling): When point is above the window, allow searching
3138 as far as scroll_max, or one screenful, to compute vertical
3139 distance from PT to the scroll margin position. This prevents
3140 try_scrolling from unnecessarily failing when
3141 scroll-conservatively is set to a value slightly larger than the
3142 window height. Clean up the case of PT below the margin at bottom
3143 of window: scroll_max can no longer be INT_MAX. When aggressive
3144 scrolling is in use, don't let point enter the opposite scroll
3145 margin as result of the scroll.
3146 (syms_of_xdisp) <scroll-conservatively>: Document the
3147 threshold of 100 lines for never-recentering scrolling.
3149 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
3151 * dispextern.h (move_it_by_lines):
3152 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
3153 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
3154 (message_log_check_duplicate): Remove parameters `prev_bol' and
3155 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
3156 (redisplay_internal): Remove parameter `preserve_echo_area',
3157 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
3159 * indent.c (Fvertical_motion):
3160 * window.c (window_scroll_pixel_based, Frecenter):
3161 Don't pass `need_y_p' to `move_it_by_lines'.
3163 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
3165 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
3166 steal a few bits to be more compact.
3167 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
3168 Remove unneeded casts.
3170 * bytecode.c (Fbyte_code): CAR and CDR can GC.
3172 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
3174 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
3175 binding" message (bug#7967).
3177 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
3179 Fix more problems found by GCC 4.6.0's static checks.
3181 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
3182 Remove unused local var.
3184 * editfns.c (Fmessage_box): Remove unused local var.
3186 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
3187 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3188 Omit unused local vars.
3189 * window.c (shrink_windows): Omit unused local var.
3190 * menu.c (digest_single_submenu): Omit unused local var.
3191 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
3192 Omit unused local var.
3194 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
3195 Don't assume string length fits in int.
3196 (keyremap_step, read_key_sequence): Use size_t for sizes.
3197 (read_key_sequence): Don't check last_real_key_start redundantly.
3199 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
3200 instead of alloca (Bug#8344).
3202 * eval.c (Fbacktrace): Don't assume nargs fits in int.
3203 (Fbacktrace_frame): Don't assume nframes fits in int.
3205 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
3207 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
3210 * term.c (produce_glyphless_glyph): Remove unnecessary test.
3212 * cm.c (calccost): Turn while-do into do-while, for clarity.
3214 * keyboard.c (syms_of_keyboard): Use the same style as later
3215 in this function when indexing through an array. This also
3216 works around GCC bug 48267.
3218 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
3220 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
3222 * chartab.c (sub_char_table_ref_and_range): Redo for slight
3223 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
3225 * keyboard.c, keyboard.h (num_input_events): Now size_t.
3226 This avoids undefined behavior on integer overflow, and is a bit
3227 more convenient anyway since it is compared to a size_t variable.
3229 Variadic C functions now count arguments with size_t, not int.
3230 This avoids an unnecessary limitation on 64-bit machines, which
3231 caused (substring ...) to crash on large vectors (Bug#8344).
3232 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
3233 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
3234 All variadic functions and their callers changed accordingly.
3235 (struct gcpro.nvars): Now size_t, not int. All uses changed.
3236 * data.c (arith_driver, float_arith_driver): Likewise.
3237 * editfns.c (general_insert_function): Likewise.
3238 * eval.c (struct backtrace.nargs, interactive_p)
3239 (internal_condition_case_n, run_hook_with_args, apply_lambda)
3240 (funcall_lambda, mark_backtrace): Likewise.
3241 * fns.c (concat): Likewise.
3242 * frame.c (x_set_frame_parameters): Likewise.
3243 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
3244 0 if not found, not -1. All callers changed.
3246 * alloc.c (garbage_collect): Don't assume stack size fits in int.
3247 (stack_copy_size): Now size_t, not int.
3248 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
3250 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
3252 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
3253 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
3254 All callers changed.
3256 * lisp.h (multibyte_char_to_unibyte):
3257 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
3258 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
3259 * character.h (CHAR_TO_BYTE8):
3260 * cmds.c (internal_self_insert):
3261 * editfns.c (general_insert_function):
3262 * keymap.c (push_key_description):
3263 * search.c (Freplace_match):
3264 * xdisp.c (message_dolog, set_message_1): All callers changed.
3266 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
3268 * keyboard.c (safe_run_hook_funcall): New function.
3269 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
3270 don't set the hook to nil, but remove the offending function instead.
3271 (Qcommand_hook_internal): Remove, unused.
3272 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
3273 Vcommand_hook_internal.
3275 * eval.c (enum run_hooks_condition): Remove.
3276 (funcall_nil, funcall_not): New functions.
3277 (run_hook_with_args): Call each function through a `funcall' argument.
3278 Remove `cond' argument, now redundant.
3279 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
3280 (Frun_hook_with_args_until_failure): Adjust accordingly.
3281 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
3283 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
3285 * dispextern.h (string_buffer_position): Remove declaration.
3287 * print.c (strout): Remove parameter `multibyte', unused since
3288 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
3290 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
3291 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
3292 All callers changed.
3294 * w32.c (_wsa_errlist): Use braces for struct initializers.
3296 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
3297 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
3298 All callers changed.
3299 (string_buffer_position): Likewise. Also, make static (it's never
3300 used outside xdisp.c).
3301 (cursor_row_p): Remove parameter `w', unused since
3302 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
3303 (decode_mode_spec): Remove parameter `precision', introduced during
3304 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
3305 All callers changed.
3307 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
3309 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
3311 2011-03-27 Anders Lindgren <andlind@gmail.com>
3313 * nsterm.m (ns_menu_bar_is_hidden): New variable.
3314 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
3315 (ns_update_auto_hide_menu_bar): New functions.
3316 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
3317 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
3318 ns_constrain_all_frames.
3319 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
3320 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
3322 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
3324 * nsmenu.m (runDialogAt): Remove argument to timer_check.
3326 2011-03-27 Glenn Morris <rgm@gnu.org>
3328 * syssignal.h: Replace RETSIGTYPE with void.
3329 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
3330 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
3331 Replace SIGTYPE with void everywhere.
3332 * s/usg5-4-common.h (SIGTYPE): Remove definition.
3333 * s/template.h (SIGTYPE): Remove commented out definition.
3335 2011-03-26 Eli Zaretskii <eliz@gnu.org>
3337 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
3338 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
3340 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
3342 * w32.c (read_unc_volume): Use parameter `henum', instead of
3343 global variable `wget_enum_handle'.
3345 * keymap.c (describe_vector): Remove parameters `indices' and
3346 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
3347 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
3349 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
3351 * keyboard.c (timer_check): Remove parameter `do_it_now',
3352 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
3353 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
3354 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
3356 * keyboard.c (read_char):
3357 * w32menu.c (w32_menu_display_help):
3358 * xmenu.c (show_help_event, menu_help_callback):
3359 Adjust calls to `show_help_echo'.
3361 * gtkutil.c (xg_maybe_add_timer):
3362 * keyboard.c (readable_events):
3363 * process.c (wait_reading_process_output):
3364 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
3366 * insdel.c (adjust_markers_gap_motion):
3367 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
3368 (gap_left, gap_right): Don't call it.
3370 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
3372 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
3373 incurred during fontification.
3375 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
3377 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
3378 (DEFVAR_PER_BUFFER): Don't pass it.
3380 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
3381 (scrolling_window): Don't pass it.
3383 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
3385 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
3387 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
3389 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
3390 of variables specific to SELinux and computation of `encoded_absname'.
3392 * image.c (XPutPixel): Remove unused variable `height'.
3394 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
3396 * unexw32.c (get_section_info): Remove unused variable `section'.
3398 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
3399 (system_process_attributes): Remove unused variable `sess'.
3400 (sys_read): Remove unused variable `err'.
3402 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
3403 (w32_wnd_proc): Remove unused variable `isdead'.
3404 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
3405 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
3406 (x_create_tip_frame): Remove unused variable `tem'.
3408 * w32inevt.c (w32_console_read_socket):
3409 Remove unused variable `no_events'.
3411 * w32term.c (x_draw_composite_glyph_string_foreground):
3412 Remove unused variable `width'.
3414 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
3416 * w32term.c (x_set_glyph_string_clipping):
3417 Don't pass uninitialized region to CombineRgn.
3419 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
3421 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
3422 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
3423 (Fx_close_connection): Remove unused variable `i'.
3425 * w32font.c (w32font_draw): Return number of glyphs.
3426 (w32font_open_internal): Remove unused variable `i'.
3427 (w32font_driver): Add missing initializer.
3429 * w32menu.c (utf8to16): Remove unused variable `utf16'.
3430 (fill_in_menu): Remove unused variable `items_added'.
3432 * w32term.c (last_mouse_press_frame): Remove static global variable.
3433 (w32_clip_to_row): Remove unused variable `f'.
3434 (x_delete_terminal): Remove unused variable `i'.
3436 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
3437 (NOTHING): Remove unused static global variable.
3438 (uniscribe_check_otf): Remove unused variable `table'.
3439 (uniscribe_font_driver): Add missing initializers.
3441 2011-03-23 Julien Danjou <julien@danjou.info>
3443 * term.c (Fsuspend_tty, Fresume_tty):
3444 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
3445 * window.c (temp_output_buffer_show):
3446 * insdel.c (signal_before_change):
3447 * frame.c (Fhandle_switch_frame):
3448 * fileio.c (Fdo_auto_save):
3449 * emacs.c (Fkill_emacs):
3450 * editfns.c (save_excursion_restore):
3451 * cmds.c (internal_self_insert):
3452 * callint.c (Fcall_interactively):
3453 * buffer.c (Fkill_all_local_variables):
3454 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
3456 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
3457 unconditionnaly since it does the check itself.
3459 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
3461 Fix more problems found by GCC 4.5.2's static checks.
3463 * coding.c (encode_coding_raw_text): Avoid unnecessary test
3464 the first time through the loop, since we know p0 < p1 then.
3465 This also avoids a gcc -Wstrict-overflow warning.
3467 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
3468 leading to a memory leak, possible in functions like
3469 load_charset_map_from_file that can allocate an unbounded number
3470 of objects (Bug#8318).
3472 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
3473 that could (at least in theory) be that large.
3475 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
3476 This is less likely to overflow, and avoids undefined behavior if
3477 overflow does occur. All callers changed. Use strtoul to scan
3478 for the unsigned long integer.
3479 (pint2hrstr): Simplify and tune code slightly.
3480 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
3482 * scroll.c (do_scrolling): Work around GCC bug 48228.
3483 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
3485 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
3486 This also avoids a warning with gcc -Wstrict-overflow.
3487 (validate_x_resource_name): Simplify count usage.
3488 This also avoids a warning with gcc -Wstrict-overflow.
3490 * fileio.c (Fcopy_file): Report error if fchown or fchmod
3493 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
3495 * process.c (Fmake_network_process): Use socklen_t, not int,
3496 where POSIX says socklen_t is required in portable programs.
3497 This fixes a porting bug on hosts like 64-bit HP-UX, where
3498 socklen_t is wider than int (Bug#8277).
3499 (Fmake_network_process, server_accept_connection):
3500 (wait_reading_process_output, read_process_output):
3503 * process.c: Rename or move locals to avoid shadowing.
3504 (list_processes_1, Fmake_network_process):
3505 (read_process_output_error_handler, exec_sentinel_error_handler):
3506 Rename or move locals.
3507 (Fmake_network_process): Define label "retry_connect" only if needed.
3508 (Fnetwork_interface_info): Fix pointer signedness.
3509 (process_send_signal): Add cast to avoid pointer signedness problem.
3510 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
3511 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
3513 Make tparam.h and terminfo.c consistent.
3514 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
3515 Include tparam.h instead, since it declares them.
3516 * cm.h (PC): Remove extern decl; tparam.h now does this.
3517 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
3518 * terminfo.c: Include tparam.h, to check interfaces.
3519 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
3520 (tparam): Adjust signature to match interface in tparam.h;
3521 this removes some undefined behavior. Check that outstring and len
3522 are zero, which they always are with Emacs.
3523 * tparam.h (PC, BC, UP): New extern decls.
3525 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
3526 (xftfont_open): Rename locals to avoid shadowing.
3528 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
3529 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
3530 (OTF_TAG_SYM): Omit macro if not needed.
3531 (ftfont_list): Remove unused local.
3532 (get_adstyle_property, ftfont_pattern_entity):
3533 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
3534 Rename locals to avoid shadowing.
3536 * xfont.c (xfont_list_family): Mark var as initialized.
3538 * xml.c (make_dom): Now static.
3540 * composite.c (composition_compute_stop_pos): Rename local to
3542 (composition_reseat_it): Remove unused locals.
3543 (find_automatic_composition, composition_adjust_point): Likewise.
3544 (composition_update_it): Mark var as initialized.
3545 (find_automatic_composition): Mark vars as initialized,
3546 with a FIXME (Bug#8290).
3548 character.h: Rename locals to avoid shadowing.
3549 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
3550 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
3551 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
3552 (BUF_DEC_POS): Be more systematic about renaming local temporaries
3555 * textprop.c (property_change_between_p): Remove; unused.
3557 * intervals.c (interval_start_pos): Now static.
3559 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
3561 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
3562 Rename locals to avoid shadowing.
3564 * sound.c (wav_play, au_play, Fplay_sound_internal):
3565 Fix pointer signedness.
3566 (alsa_choose_format): Remove unused local var.
3567 (wav_play): Initialize a variable to 0, to prevent undefined
3568 behavior (Bug#8278).
3570 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
3572 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
3574 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
3575 clobbering (Bug#8298).
3576 * sysdep.c (sys_subshell): Likewise.
3577 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
3579 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
3580 This should get cleaned up, so that child_setup has the
3581 same signature on all platforms.
3583 * callproc.c (call_process_cleanup): Now static.
3584 (relocate_fd): Rename locals to avoid shadowing.
3586 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
3588 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
3589 not to be necessary, and produces flickering.
3591 2011-03-20 Glenn Morris <rgm@gnu.org>
3593 * config.in: Remove file.
3595 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
3597 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
3598 are now in src/globals.h.
3599 (syms_of_minibuf): Remove spurious & from previous change.
3601 2011-03-20 Leo <sdl.web@gmail.com>
3603 * minibuf.c (completing-read-function): New variable.
3604 (completing-read-default): Rename from completing-read.
3605 (completing-read): Call completing-read-function.
3607 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
3609 * xfaces.c (Fx_load_color_file):
3610 Read color file from absolute filename (bug#8250).
3612 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
3614 * makefile.w32-in: Update dependencies.
3616 2011-03-17 Eli Zaretskii <eliz@gnu.org>
3618 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
3620 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
3622 Fix more problems found by GCC 4.5.2's static checks.
3624 * process.c (make_serial_process_unwind, send_process_trap):
3625 (sigchld_handler): Now static.
3627 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
3628 That way, the code declares only the vars that it needs.
3629 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
3630 * s/cygwin.h (PTY_ITERATION): Likewise.
3631 * s/darwin.h (PTY_ITERATION): Likewise.
3632 * s/gnu-linux.h (PTY_ITERATION): Likewise.
3634 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
3635 * process.c (allocate_pty): Don't declare stb unless it's needed.
3637 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
3638 (CONSTANTLIM): Remove; unused.
3639 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
3640 Define only if needed.
3642 * unexelf.c (unexec): Name an expression,
3643 to avoid gcc -Wbad-function-cast warning.
3644 Use a different way to cause a compilation error if anyone uses
3645 n rather than nn, a way that does not involve shadowing.
3646 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
3648 * deps.mk (unexalpha.o): Remove; unused.
3650 New file unexec.h, the (simple) interface for unexec (Bug#8267).
3651 * unexec.h: New file.
3652 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
3653 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
3655 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
3656 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
3657 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
3658 Change as necessary to match prototype in unexec.h.
3660 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
3662 (back_comment, skip_chars): Mark vars as initialized.
3664 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
3665 Rename locals to avoid shadowing.
3667 * lread.c (read1): Rewrite so as not to use empty "else".
3668 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
3670 * print.c (Fredirect_debugging_output): Fix pointer signedess.
3672 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
3673 warning when compiling print.c.
3675 * font.c (font_unparse_fcname): Abort in an "impossible" situation
3676 instead of using an uninitialized var.
3677 (font_sort_entities): Mark var as initialized.
3679 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
3681 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
3682 pointers to constants.
3683 (font_parse_fcname): Remove unused vars.
3684 (font_delete_unmatched): Now static.
3685 (font_get_spec): Remove; unused.
3686 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
3687 (font_update_drivers, Ffont_get_glyphs, font_add_log):
3688 Rename or move locals to avoid shadowing.
3690 * fns.c (require_nesting_list, require_unwind): Now static.
3691 (Ffillarray): Rename locals to avoid shadowing.
3693 * floatfns.c (domain_error2): Define only if needed.
3694 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
3696 * alloc.c (mark_backtrace): Move decl from here ...
3697 * lisp.h: ... to here, so that it can be checked.
3699 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
3700 (Fdefvar): Rewrite so as not to use empty "else".
3701 (lisp_indirect_variable): Name an expression,
3702 to avoid gcc -Wbad-function-cast warning.
3703 (Fdefvar): Rename locals to avoid shadowing.
3705 * callint.c (quotify_arg, quotify_args): Now static.
3706 (Fcall_interactively): Rename locals to avoid shadowing.
3707 Use const pointer when appropriate.
3709 * lisp.h (get_system_name, get_operating_system_release):
3710 Move decls here, to check interfaces.
3711 * process.c (get_operating_system_release): Move decl to lisp.h.
3712 * xrdb.c (get_system_name): Likewise.
3713 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
3714 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
3715 some of which prompt warnings from gcc -Wbad-function-cast.
3716 (Fformat_time_string, Fencode_time, Finsert_char):
3717 (Ftranslate_region_internal, Fformat):
3718 Rename or remove local vars to avoid shadowing.
3719 (Ftranslate_region_internal): Mark var as initialized.
3721 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
3724 * lisp.h (eassert): Check that the argument compiles, even if
3725 ENABLE_CHECKING is not defined.
3727 * data.c (Findirect_variable): Name an expression, to avoid
3728 gcc -Wbad-function-cast warning.
3729 (default_value, arithcompare, arith_driver, arith_error): Now static.
3730 (store_symval_forwarding): Rename local to avoid shadowing.
3731 (Fmake_variable_buffer_local, Fmake_local_variable):
3732 Mark variables as initialized.
3733 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
3735 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
3736 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
3737 Rename locals to avoid shadowing.
3738 (mark_stack): Move local variables into the #ifdef region where
3740 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
3741 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
3743 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
3744 (GC_STRING_CHARS): Remove; not used.
3745 (Fmemory_limit): Cast sbrk's returned value to char *.
3747 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
3748 avoids undefined behavior in theory.
3750 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
3752 Use functions, not macros, for up- and down-casing (Bug#8254).
3753 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
3754 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
3755 to use the following functions instead of these macros.
3756 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
3757 EMACS_INT, since callers assume the returned value fits in int.
3758 (upcase1): Likewise, for UPCASE_TABLE.
3759 (uppercasep, lowercasep, upcase): New static inline functions.
3760 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
3761 the race-condition problem in the old DOWNCASE.
3763 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
3764 Rename locals to avoid shadowing.
3765 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
3766 (regex_compile, re_search_2, re_match_2_internal):
3767 Remove unused local vars.
3768 (FREE_VAR): Rewrite so as not to use empty "else",
3769 which gcc can warn about.
3770 (regex_compile, re_match_2_internal): Mark locals as initialized.
3771 (RETALLOC_IF): Define only if needed.
3772 (WORDCHAR_P): Likewise. This one is never needed, but is used
3773 only in a comment talking about a compiler bug, so put inside
3774 the #if 0 of that comment.
3775 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
3776 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
3779 * search.c (boyer_moore): Rename locals to avoid shadowing.
3780 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
3781 (PREV_CHAR_BOUNDARY): Likewise.
3783 * search.c (simple_search): Remove unused var.
3785 * dired.c (compile_pattern): Move decl from here ...
3786 * lisp.h: ... to here, so that it can be checked.
3787 (struct re_registers): New forward decl.
3789 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
3791 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
3793 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
3794 Rename locals to avoid shadowing.
3795 (Fvertical_motion): Mark locals as initialized.
3797 * casefiddle.c (casify_object, casify_region): Now static.
3798 (casify_region): Mark local as initialized.
3800 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
3802 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
3803 New macros, so that the caller can use some names other than
3804 gcpro1, gcpro2, etc.
3805 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
3807 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
3808 argument, for consistency with GCPRO2_VAR, etc: it is now the
3809 prefix of the variable, not the variable itself. All uses
3811 * dired.c (directory_files_internal, file_name_completion):
3812 Rename locals to avoid shadowing.
3814 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
3815 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
3816 dired.c's scmp function, had undefined behavior.
3817 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
3818 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
3819 * buffer.h: ... to here, because these macros use current_buffer,
3820 and the new implementation with inline functions needs to have
3821 current_buffer in scope now, rather than later when the macros
3823 (downcase, upcase1): New static inline functions.
3824 (DOWNCASE, UPCASE1): Reimplement using these functions.
3825 This avoids undefined behavior in expressions like
3826 DOWNCASE (x) == DOWNCASE (y), which previously suffered
3827 from race conditions in accessing the global variables
3828 case_temp1 and case_temp2.
3829 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
3830 * lisp.h (case_temp1, case_temp2): Remove their decls.
3831 * character.h (ASCII_CHAR_P): Move from here ...
3832 * lisp.h: ... to here, so that the inline functions mentioned
3835 * dired.c (directory_files_internal_unwind): Now static.
3837 * fileio.c (file_name_as_directory, directory_file_name):
3838 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
3840 (file_name_as_directory): Use const pointers when appropriate.
3841 (Fexpand_file_name): Likewise. In particular, newdir might
3842 point at constant storage, so make it a const pointer.
3843 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
3844 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
3846 (Fset_file_times, Finsert_file_contents, auto_save_error):
3847 Rename locals to avoid shadowing.
3849 * minibuf.c (choose_minibuf_frame_1): Now static.
3850 (Ftry_completion, Fall_completions): Rename or remove locals
3853 * marker.c (bytepos_to_charpos): Remove; unused.
3855 * lisp.h (verify_bytepos, count_markers): New decls,
3856 so that gcc does not warn that these functions aren't declared.
3858 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
3859 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
3860 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
3861 (copy_text): Remove unused local var.
3863 * filelock.c (within_one_second): Now static.
3864 (lock_file_1): Rename local to avoid shadowing.
3866 * buffer.c (fix_overlays_before): Mark locals as initialized.
3867 (fix_start_end_in_overlays): Likewise. This function should be
3868 simplified by using pointers-to-pointers, but that's a different
3870 (switch_to_buffer_1): Now static.
3871 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
3872 (report_overlay_modification): Rename locals to avoid shadowing.
3874 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
3875 Fix pointer signedness issue.
3876 (sys_subshell): Mark local as volatile if checking for lint,
3877 to suppress a gcc -Wclobbered warning that does not seem to be right.
3878 (MAXPATHLEN): Define only if needed.
3880 * process.c (serial_open, serial_configure): Move decls from here ...
3881 * systty.h: ... to here, so that they can be checked.
3883 * fns.c (get_random, seed_random): Move extern decls from here ...
3884 * lisp.h: ... to here, so that they can be checked.
3886 * sysdep.c (reset_io): Now static.
3887 (wait_for_termination_signal): Remove; unused.
3889 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
3890 (copy_keymap_item, append_key, push_text_char_description):
3892 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
3893 (DENSE_TABLE_SIZE): Remove; unused.
3894 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
3895 (describe_map_tree):
3896 Rename locals to avoid shadowing.
3898 * keyboard.c: Declare functions static if they are not used elsewhere.
3899 (echo_char, echo_dash, cmd_error, top_level_2):
3900 (poll_for_input, handle_async_input): Now static.
3901 (read_char, kbd_buffer_get_event, make_lispy_position):
3902 (make_lispy_event, make_lispy_movement, apply_modifiers):
3903 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
3904 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
3905 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
3906 (read_key_sequence, read_char): Mark locals as initialized.
3907 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
3909 * keyboard.h (make_ctrl_char): New decl.
3910 (mark_kboards): Move decl here ...
3911 * alloc.c (mark_kboards): ... from here.
3913 * lisp.h (force_auto_save_soon): New decl.
3915 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
3916 (DEFINE_DUMMY_FUNCTION): New macro.
3917 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
3919 (main): Add casts to avoid warnings
3920 if GCC considers string literals to be constants.
3922 * lisp.h (fatal_error_signal): Add decl, since it's exported.
3924 * dbusbind.c: Pointer signedness fixes.
3925 (xd_signature, xd_append_arg, xd_initialize):
3926 (Fdbus_call_method, Fdbus_call_method_asynchronously):
3927 (Fdbus_method_return_internal, Fdbus_method_error_internal):
3928 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
3929 (Fdbus_register_signal): Use SSDATA when the context wants char *.
3931 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
3932 if GCC considers string literals to be constants.
3933 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
3935 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
3937 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
3938 (print_preprocess, print_object): New macro to fix last change.
3940 * print.c (print_preprocess): Don't forget font objects.
3942 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
3944 * emacs.c (USAGE3): Doc fixes.
3946 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
3948 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
3951 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
3953 * lisp.h (VWindow_system, Qfile_name_history):
3954 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
3955 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
3956 (w32_system_caret_x, w32_system_caret_y): Declare extern.
3958 * w32select.c: Don't #include "keyboard.h".
3959 (run_protected): Add extern declaration for waiting_for_input.
3961 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
3962 * w32console.c (detect_input_pending, read_input_pending)
3963 (encode_terminal_code):
3964 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
3965 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
3966 (w32_system_caret_y, Qfile_name_history):
3967 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
3968 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
3969 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
3970 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
3971 * w32proc.c (Qlocal, report_file_error):
3972 * w32term.c (Vwindow_system, updating_frame):
3973 * w32uniscribe.c (initialized, uniscribe_font_driver):
3974 Remove unneeded extern declarations.
3976 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
3978 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
3980 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
3982 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
3983 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
3984 These macros can no longer be used for assignment.
3986 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3987 Assign struct members directly, instead of using BUF_BEGV etc.
3988 (record_buffer_markers, fetch_buffer_markers): New functions for
3989 recording and fetching special buffer markers.
3990 (set_buffer_internal_1, set_buffer_temp): Use them.
3992 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
3994 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
3996 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
3997 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
3999 * xdisp.c (hscroll_window_tree):
4000 (reconsider_clip_changes): Use PT instead of BUF_PT.
4002 2011-03-13 Eli Zaretskii <eliz@gnu.org>
4004 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
4005 $(EMACS_ROOT)/lib/intprops.h.
4007 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
4009 Fix more problems found by GCC 4.5.2's static checks.
4011 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
4012 to unsigned char * to avoid compiler diagnostic.
4013 (xg_free_frame_widgets): Make it clear that a local variable is
4014 needed only if USE_GTK_TOOLTIP.
4015 (gdk_window_get_screen): Make it clear that this macro is needed
4016 only if USE_GTK_TOOLTIP.
4017 (int_gtk_range_get_value): New function, which avoids a diagnostic
4018 from gcc -Wbad-function-cast.
4019 (xg_set_toolkit_scroll_bar_thumb): Use it.
4020 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
4021 diagnostic from gcc -Wbad-function-cast.
4022 (get_utf8_string, xg_get_file_with_chooser):
4023 Rename locals to avoid shadowing.
4024 (create_dialog): Move locals to avoid shadowing.
4026 * xgselect.c (xg_select): Remove unused var.
4028 * image.c (four_corners_best): Mark locals as initialized.
4029 (gif_load): Initialize transparent_p to zero (Bug#8238).
4030 Mark another local as initialized.
4031 (my_png_error, my_error_exit): Mark with NO_RETURN.
4033 * image.c (clear_image_cache): Now static.
4034 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
4035 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
4036 (x_edge_detection): Remove unnecessary cast that
4037 gcc -Wbad-function-cast diagnoses.
4038 (gif_load): Fix pointer signedness.
4039 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
4040 (jpeg_load, gif_load): Rename locals to avoid shadowing.
4042 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
4044 Improve quality of tests for time stamp overflow.
4045 For example, without this patch (encode-time 0 0 0 1 1
4046 1152921504606846976) returns the obviously-bogus value (-948597
4047 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
4048 reports time overflow. See
4049 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
4050 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
4051 * editfns.c: Include limits.h and intprops.h.
4052 (TIME_T_MIN, TIME_T_MAX): New macros.
4053 (time_overflow): Move earlier, to before first use.
4054 (hi_time, lo_time): New functions, for an accurate test for
4056 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
4057 (Fget_internal_run_time): Don't assume time_t fits in int.
4058 (make_time): Use list2 instead of Fcons twice.
4059 (Fdecode_time): More accurate test for out-of-range times.
4060 (check_tm_member): New function.
4061 (Fencode_time): Use it, to test for out-of-range times.
4062 (lisp_time_argument): Don't rely on undefined left-shift and
4063 right-shift behavior when checking for time stamp overflow.
4065 * editfns.c (time_overflow): New function, refactoring common code.
4066 (Fformat_time_string, Fdecode_time, Fencode_time):
4067 (Fcurrent_time_string): Use it.
4069 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
4070 * dired.c (make_time): Move to ...
4071 * editfns.c (make_time): ... here.
4072 * systime.h: Note the move.
4074 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4076 * fringe.c (update_window_fringes): Remove unused variables.
4078 * unexmacosx.c (copy_data_segment): Also copy __got section.
4081 2011-03-12 Eli Zaretskii <eliz@gnu.org>
4083 * termcap.c [MSDOS]: Include "msdos.h".
4084 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
4085 Constify `char *' arguments and their references according to
4086 prototypes in tparam.h.
4088 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
4090 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
4091 Adapt all references accordingly.
4093 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
4095 2011-03-11 Tom Tromey <tromey@redhat.com>
4097 * buffer.c (syms_of_buffer): Remove obsolete comment.
4099 2011-03-11 Eli Zaretskii <eliz@gnu.org>
4101 * termhooks.h (encode_terminal_code): Declare prototype.
4103 * msdos.c (encode_terminal_code): Don't declare prototype.
4105 * term.c (encode_terminal_code): Now external again, used by
4106 w32console.c and msdos.c.
4108 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
4109 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
4111 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
4113 Fix some minor problems found by GCC 4.5.2's static checks.
4115 * fringe.c (update_window_fringes): Mark locals as initialized
4117 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
4119 * alloc.c (mark_fringe_data): Move decl from here ...
4120 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
4121 to check its interface.
4122 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
4124 * fontset.c (free_realized_fontset): Now static.
4125 (Fset_fontset_font): Rename local to avoid shadowing.
4126 (fontset_font): Mark local as initialized.
4127 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
4129 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
4131 * xselect.c (x_disown_buffer_selections): Remove; not used.
4132 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
4133 (x_own_selection, Fx_disown_selection_internal): Rename locals
4135 (x_handle_dnd_message): Remove local to avoid shadowing.
4137 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
4138 so that the caller can use some name other than gcpro1.
4139 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
4140 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
4141 (Fx_backspace_delete_keys_p):
4142 Use them to avoid shadowing, and rename vars to avoid shadowing.
4143 (x_decode_color, x_set_name, x_window): Now static.
4144 (Fx_create_frame): Add braces to silence GCC warning.
4145 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
4146 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
4147 Remove unused locals.
4148 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
4149 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
4150 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
4153 * xterm.h (x_mouse_leave): New decl.
4155 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
4156 Remove unused functions.
4157 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
4158 (x_calc_absolute_position): Now static.
4159 (XTread_socket): Don't define label "out" unless it's used.
4160 Don't declare local "event" unless it's used.
4161 (x_iconify_frame, x_free_frame_resources): Don't declare locals
4162 unless they are used.
4163 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
4164 (x_fatal_error_signal): Remove; not used.
4165 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
4166 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
4167 (x_error_catcher, x_connection_closed, x_error_handler):
4168 (x_error_quitter, xembed_send_message, x_iconify_frame):
4169 (my_log_handler): Rename locals to avoid shadowing.
4170 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
4171 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
4173 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
4174 Rename or move locals to avoid shadowing.
4175 (tty_defined_color, merge_face_heights): Now static.
4176 (free_realized_faces_for_fontset): Remove; not used.
4177 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
4178 does not deduce is never used uninitialized.
4179 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
4180 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
4182 * terminal.c (store_terminal_param): Now static.
4184 * xmenu.c (menu_highlight_callback): Now static.
4185 (set_frame_menubar): Remove unused local.
4186 (xmenu_show): Rename parameter to avoid shadowing.
4187 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
4188 since they might point to immutable storage.
4189 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
4190 since it's unused otherwise.
4192 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
4193 Add a FIXME, since the code still doesn't look right. (Bug#8215)
4194 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
4195 avoids a gcc -Wuninitialized diagnostic.
4196 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
4197 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
4198 does not deduce are never used uninitialized.
4200 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
4202 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4203 * window.c (window_loop, size_window):
4204 (run_window_configuration_change_hook, enlarge_window): Likewise.
4206 * window.c (display_buffer): Now static.
4207 (size_window): Mark variables that gcc -Wuninitialized
4208 does not deduce are never used uninitialized.
4209 * window.h (check_all_windows): New decl, to forestall
4210 gcc -Wmissing-prototypes diagnostic.
4211 * dispextern.h (bidi_dump_cached_states): Likewise.
4213 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
4215 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
4217 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
4218 and to avoid gcc -Wuninitialized warning.
4219 (load_charset_map): Mark variables that gcc -Wuninitialized
4220 does not deduce are never used uninitialized.
4221 (load_charset): Abort instead of using uninitialized var (Bug#8229).
4223 * coding.c (coding_set_source, coding_set_destination):
4224 Use "else { /* comment */ }" rather than "else /* comment */;"
4225 for clarity, and to avoid gcc -Wempty-body warning.
4226 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
4227 a block, when the outer 'i' will do.
4228 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
4229 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
4230 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
4231 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
4232 (Fdecode_sjis_char, Fdefine_coding_system_internal):
4233 Rename locals to avoid shadowing.
4234 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
4235 * coding.c (emacs_mule_char, encode_invocation_designation):
4236 Now static, since they're not used elsewhere.
4237 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
4238 (decode_coding_object, encode_coding_object, detect_coding_system):
4239 (decode_coding_emacs_mule): Mark variables that gcc
4240 -Wuninitialized does not deduce are never used uninitialized.
4241 (detect_coding_iso_2022): Initialize a local variable that might
4242 be used uninitialized. Leave a FIXME because it's not clear that
4243 this initialization is needed. (Bug#8211)
4244 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
4245 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
4246 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
4247 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
4248 Remove unused macros.
4250 * category.c (hash_get_category_set): Remove unused local var.
4251 (copy_category_table): Now static, since it's not used elsewhere.
4252 * character.c (string_count_byte8): Likewise.
4254 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
4255 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
4257 * chartab.c (copy_sub_char_table): Now static, since it's not used
4259 (sub_char_table_ref_and_range, char_table_ref_and_range):
4260 Rename locals to avoid shadowing.
4261 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
4263 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
4264 (BIDI_BOB): Remove unused macro.
4266 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
4267 deduce are never used uninitialized.
4268 * term.c (encode_terminal_code): Likewise.
4270 * term.c (encode_terminal_code): Now static. Remove unused local.
4272 * tparam.h: New file.
4273 * term.c, tparam.h: Include it.
4274 * deps.mk (term.o, tparam.o): Depend on tparam.h.
4275 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
4276 Move these decls to tparam.h, and make them agree with what
4277 is actually in tparam.c. The previous trick of using incompatible
4278 decls in different modules does not conform to the C standard.
4279 All callers of tparam changed to use tparam's actual API.
4280 * tparam.c (tparam1, tparam, tgoto):
4281 Use const pointers where appropriate.
4283 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
4284 * cm.h (struct cm): Likewise.
4285 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
4286 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
4287 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
4288 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
4289 (turn_on_face, init_tty): Likewise.
4290 * termchar.h (struct tty_display_info): Likewise.
4292 * term.c (term_mouse_position): Rename local to avoid shadowing.
4294 * alloc.c (mark_ttys): Move decl from here ...
4295 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
4297 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
4299 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
4301 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
4303 * search.c (compile_pattern_1): Remove argument regp, unused since
4304 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
4305 (compile_pattern): Don't pass it.
4307 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
4309 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
4310 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
4312 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
4314 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
4316 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
4317 gdk_window_get_screen, gdk_window_get_geometry,
4318 gdk_x11_window_lookup_for_display and GDK_KEY_g.
4319 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
4320 (xg_get_pixbuf_from_pixmap): New function.
4321 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
4322 to Pixmap, take frame as parameter, remove GdkColormap parameter.
4323 Call xg_get_pixbuf_from_pixmap instead of
4324 gdk_pixbuf_get_from_drawable.
4325 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
4326 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
4327 (xg_check_special_colors): Use GtkStyleContext and its functions
4329 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
4330 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
4331 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
4332 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
4333 Call gtk_widget_get_preferred_size.
4334 (xg_frame_resized): gdk_window_get_geometry only takes 5
4336 (xg_win_to_widget, xg_event_is_for_menubar):
4337 Call gdk_x11_window_lookup_for_display.
4338 (xg_set_widget_bg): New function.
4339 (delete_cb): New function.
4340 (xg_create_frame_widgets): Connect delete-event to delete_cb.
4341 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
4342 (xg_set_background_color): Call xg_set_widget_bg.
4343 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
4344 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
4345 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
4346 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
4348 (update_frame_tool_bar): Call gtk_widget_hide.
4349 (xg_initialize): Use GDK_KEY_g.
4351 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
4353 (x_session_initialize): Call gdk_x11_set_sm_client_id.
4355 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
4356 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
4357 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
4359 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
4361 * w32xfns.c (select_palette): Check success of RealizePalette against
4362 GDI_ERROR, not zero.
4364 See ChangeLog.11 for earlier changes.
4370 Copyright (C) 2011 Free Software Foundation, Inc.
4372 This file is part of GNU Emacs.
4374 GNU Emacs is free software: you can redistribute it and/or modify
4375 it under the terms of the GNU General Public License as published by
4376 the Free Software Foundation, either version 3 of the License, or
4377 (at your option) any later version.
4379 GNU Emacs is distributed in the hope that it will be useful,
4380 but WITHOUT ANY WARRANTY; without even the implied warranty of
4381 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4382 GNU General Public License for more details.
4384 You should have received a copy of the GNU General Public License
4385 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.