1 2011-06-19 Paul Eggert <eggert@cs.ucla.edu>
3 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
4 (XD_DEBUG_MESSAGE): Don't waste a byte.
6 * callproc.c (getenv_internal_1, getenv_internal)
8 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
10 * lread.c (invalid_syntax): Omit length argument.
11 All uses changed. This doesn't fix a bug, but it simplifies the
12 code away from its former Hollerith-constant appearance, and it's
13 one less 'int' to worry about when looking at integer-overflow issues.
14 (string_to_number): Simplify the 2011-04-26 change by invoking xsignal1.
16 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
17 This didn't break anything, but it didn't help either.
18 It's confusing to put a bogus integer in a place where the actual
19 value does not matter.
20 (LIST_END_P): Remove unused macro and its bogus comment.
21 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
23 2011-06-18 Paul Eggert <eggert@cs.ucla.edu>
25 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
26 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
28 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
29 We prefer signed types, and the value cannot exceed the EMACS_INT
30 range anyway (because otherwise the length would not be representable).
31 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
32 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
33 This avoids a GCC warning when WIDE_EMACS_INT.
35 * indent.c (sane_tab_width): New function.
36 (current_column, scan_for_column, Findent_to, position_indentation)
37 (compute_motion): Use it. This is just for clarity.
38 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
40 * image.c (xbm_image_p): Don't assume stated width and height fit in int.
42 * lisp.h (lint_assume): New macro.
43 * composite.c (composition_gstring_put_cache):
44 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
46 * editfns.c, insdel.c:
47 Omit unnecessary forward decls, to simplify future changes.
49 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
51 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
53 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
54 Use much-faster test for byte-length change.
55 Don't assume string byte-length fits in 'int'.
56 Check that character arg fits in 'int'.
57 (mapcar1): Declare byte as byte, for clarity.
59 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
61 * fns.c (concat): Catch string overflow earlier.
62 Do not rely on integer wraparound.
64 * dispextern.h (struct it.overlay_strings_charpos): EMACS_INT, not int.
66 2011-06-17 Paul Eggert <eggert@cs.ucla.edu>
68 * dispextern.h (struct it.selective): Now EMACS_INT, not int.
69 * xdisp.c (forward_to_next_line_start)
70 (back_to_previous_visible_line_start)
71 (reseat_at_next_visible_line_start, next_element_from_buffer):
72 Don't arbitrarily truncate the value of 'selective' to int.
74 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
76 * composite.c: Don't truncate sizes to 'int'.
77 (composition_gstring_p, composition_reseat_it)
78 (composition_adjust_point): Use EMACS_INT, not int.
79 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
80 not EMACS_UINT, for indexes.
82 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
84 * buffer.c: Include <verify.h>.
85 (struct sortvec.priority, struct sortstr.priority):
86 Now EMACS_INT, not int.
87 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
88 (struct sortstr.size, record_overlay_string)
89 (struct sortstrlist.size, struct sortlist.used):
90 Don't truncate size to int.
91 (record_overlay_string): Check for size-calculation overflow.
92 (init_buffer_once): Check at compile-time, not run-time.
94 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
96 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
97 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
98 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
100 Improve buffer-overflow checking (Bug#8873).
101 * fileio.c (Finsert_file_contents):
102 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
103 Remove the old (too-loose) buffer overflow checks.
104 They weren't needed, since make_gap checks for buffer overflow.
105 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
106 The old code merely checked for Emacs fixnum overflow, and relied
107 on undefined (wraparound) behavior. The new code avoids undefined
108 behavior, and also checks for ptrdiff_t and/or size_t overflow.
110 * editfns.c (Finsert_char): Don't dump core with very negative counts.
111 Tune. Don't use wider integers than needed. Don't use alloca.
112 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
114 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
116 * insdel.c, lisp.h (buffer_overflow): New function.
117 (insert_from_buffer_1, replace_range, replace_range_2):
118 * insdel.c (make_gap_larger):
119 * editfns.c (Finsert_char):
120 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
122 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
124 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
126 Integer overflow and signedness fixes (Bug#8873).
128 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
129 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
131 * fileio.c: Don't assume EMACS_INT fits in off_t.
132 (emacs_lseek): New static function.
133 (Finsert_file_contents, Fwrite_region): Use it.
134 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
136 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
138 * fns.c: Don't overflow int when computing a list length.
139 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
140 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
141 truncation on 64-bit hosts. Check for QUIT every
142 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
143 faster and is responsive enough.
144 (Flength): Report an error instead of overflowing an integer.
145 (Fsafe_length): Return a float if the value is not representable
146 as a fixnum. This shouldn't happen except in contrived situations.
147 (Fnthcdr, Fsort): Don't assume list length fits in int.
148 (Fcopy_sequence): Don't assume vector length fits in int.
150 * alloc.c: Check that resized vectors' lengths fit in fixnums.
151 (header_size, word_size): New constants.
152 (allocate_vectorlike): Don't check size overflow here.
153 (allocate_vector): Check it here instead, since this is the only
154 caller of allocate_vectorlike that could cause overflow.
155 Check that the new vector's length is representable as a fixnum.
157 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
158 The previous code was bogus. For example, next_almost_prime (32)
159 returned 39, which is undesirable as it is a multiple of 3; and
160 next_almost_prime (24) returned 25, which is a multiple of 5 so
161 why was the code bothering to check for multiples of 7?
163 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
165 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
167 Variadic C functions now count arguments with ptrdiff_t.
168 This partly undoes my 2011-03-30 change, which replaced int with size_t.
169 Back then I didn't know that the Emacs coding style prefers signed int.
170 Also, in the meantime I found a few more instances where arguments
171 were being counted with int, which may truncate counts on 64-bit
172 machines, or EMACS_INT, which may be unnecessarily wide.
173 * lisp.h (struct Lisp_Subr.function.aMANY)
174 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
175 Arg counts are now ptrdiff_t, not size_t.
176 All variadic functions and their callers changed accordingly.
177 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
178 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
179 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
180 * callint.c (Fcall_interactively): Check arg count for overflow,
181 to avoid potential buffer overrun. Use signed char, not 'int',
182 for 'varies' array, so that we needn't bother to check its size
183 calculation for overflow.
184 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
185 * eval.c (apply_lambda):
186 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
187 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
188 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
190 * callint.c (Fcall_interactively): Don't use index var as event count.
192 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
193 * mem-limits.h (SIZE): Remove; no longer used.
195 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
197 Remove unnecessary casts.
198 * xterm.c (x_term_init):
199 * xfns.c (x_set_border_pixel):
200 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
201 These aren't needed now that we assume ANSI C.
203 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
204 It's more likely to cause problems (due to unsigned overflow)
207 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
209 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
211 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
213 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
215 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
217 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
219 GLYPH_CODE_FACE returns EMACS_INT, not int.
220 * dispextern.h (merge_faces):
221 * xfaces.c (merge_faces):
222 * xdisp.c (get_next_display_element, next_element_from_display_vector):
223 Don't assume EMACS_INT fits in int.
225 * character.h (CHAR_VALID_P): Remove unused parameter.
226 * fontset.c, lisp.h, xdisp.c: All uses changed.
228 * editfns.c (Ftranslate_region_internal): Omit redundant test.
230 * fns.c (concat): Minor tuning based on overflow analysis.
231 This doesn't fix any bugs. Use int to hold character, instead
232 of constantly refetching from Emacs object. Use XFASTINT, not
233 XINT, for value known to be a character. Don't bother comparing
234 a single byte to 0400, as it's always less.
236 * floatfns.c (Fexpt):
237 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
239 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
242 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
244 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
245 Without this fix, on a 64-bit host (aset S 0 4294967386) would
246 incorrectly succeed when S was a string, because 4294967386 was
247 truncated before it was used.
249 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
250 Otherwise, an out-of-range integer could cause undefined behavior
253 * composite.c: Use int, not EMACS_INT, for characters.
254 (fill_gstring_body, composition_compute_stop_pos): Use int, not
255 EMACS_INT, for values that are known to be in character range.
256 This doesn't fix any bugs but is the usual style inside Emacs and
257 may generate better code on 32-bit machines.
259 Make sure a 64-bit char is never passed to ENCODE_CHAR.
260 This is for reasons similar to the recent CHAR_STRING fix.
261 * charset.c (Fencode_char): Check that character arg is actually
262 a character. Pass an int to ENCODE_CHAR.
263 * charset.h (ENCODE_CHAR): Verify that the character argument is no
264 wider than 'int', as a compile-time check to prevent future regressions
267 * character.c (char_string): Remove unnecessary casts.
269 Make sure a 64-bit char is never passed to CHAR_STRING.
270 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
271 by silently ignoring the top 32 bits, allowing some values
272 that were far too large to be valid characters.
273 * character.h: Include <verify.h>.
274 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
275 arguments are no wider than unsigned, as a compile-time check
276 to prevent future regressions in this area.
278 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
279 (Fsubst_char_in_region):
281 * xdisp.c (decode_mode_spec_coding):
282 Adjust to CHAR_STRING's new requirement.
283 * editfns.c (Finsert_char, Fsubst_char_in_region):
284 * fns.c (concat): Check that character args are actually
285 characters. Without this test, these functions did the wrong
286 thing with wildly out-of-range values on 64-bit hosts.
288 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
289 These casts should not be needed on 32-bit hosts, either.
290 * keyboard.c (read_char):
291 * lread.c (Fload): Remove casts to unsigned.
293 * lisp.h (UNSIGNED_CMP): New macro.
294 This fixes comparison bugs on 64-bit hosts.
295 (ASCII_CHAR_P): Use it.
296 * casefiddle.c (casify_object):
297 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
298 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
299 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
300 * dispextern.h (FACE_FROM_ID):
301 * keyboard.c (read_char): Use UNSIGNED_CMP.
303 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
304 not to EMACS_INT, to avoid GCC warning.
306 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
308 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
309 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
310 isn't needed on 32-bit machines.
312 * buffer.c (Fgenerate_new_buffer_name):
313 Use EMACS_INT for count, not int.
314 (advance_to_char_boundary): Return EMACS_INT, not int.
316 * data.c (Qcompiled_function): Now static.
318 * window.c (window_body_lines): Now static.
320 * image.c (gif_load): Rename local to avoid shadowing.
322 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
323 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
324 * alloc.c (make_save_value): Integer argument is now of type
326 (mark_object): Use ptrdiff_t, not int.
327 * lisp.h (pD): New macro.
328 * print.c (print_object): Use it.
330 * alloc.c: Use EMACS_INT, not int, to count objects.
331 (total_conses, total_markers, total_symbols, total_vector_size)
332 (total_free_conses, total_free_markers, total_free_symbols)
333 (total_free_floats, total_floats, total_free_intervals)
334 (total_intervals, total_strings, total_free_strings):
335 Now EMACS_INT, not int. All uses changed.
336 (Fgarbage_collect): Compute overall total using a double, so that
337 integer overflow is less likely to be a problem. Check for overflow
338 when converting back to an integer.
339 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
340 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
341 These were 'int' variables that could overflow on 64-bit hosts;
342 they were never used, so remove them instead of repairing them.
343 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
344 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
345 Previously, this ceilinged at INT_MAX, but that doesn't work on
347 (allocate_pseudovector): Don't use EMACS_INT when int would do.
349 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
350 (allocate_vectorlike): Check for ptrdiff_t overflow.
351 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
352 when a (possibly-narrower) signed value would do just as well.
353 We prefer using signed arithmetic, to avoid comparison confusion.
355 * alloc.c: Catch some string size overflows that we were missing.
356 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
357 for convenience in STRING_BYTES_MAX.
358 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
359 The definition here is exact; the one in lisp.h was approximate.
360 (allocate_string_data): Check for string overflow. This catches
361 some instances we weren't catching before. Also, it catches
362 size_t overflow on (unusual) hosts where SIZE_MAX <= min
363 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
364 and ptrdiff_t and EMACS_INT are both 64 bits.
366 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
367 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
368 * lisp.h (STRING_BYTES_BOUND): Renamed from STRING_BYTES_MAX.
370 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
372 * alloc.c (Fmake_string): Check for out-of-range init.
374 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
376 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
378 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
380 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
381 xg_get_default_scrollbar_width.
383 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
384 (int_gtk_range_get_value): Move to the scroll bar part of the file.
385 (style_changed_cb): Call update_theme_scrollbar_width and call
386 x_set_scroll_bar_default_width and xg_frame_set_char_size for
387 all frames (Bug#8505).
388 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
389 Call gtk_window_set_resizable if HAVE_GTK3.
390 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
391 and height if HAVE_GTK3 (Bug#8505).
392 (scroll_bar_width_for_theme): New variable.
393 (update_theme_scrollbar_width): New function.
394 (xg_get_default_scrollbar_width): Move code to
395 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
396 (xg_initialize): Call update_theme_scrollbar_width.
398 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
400 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
402 2011-06-12 Martin Rudalics <rudalics@gmx.at>
404 * frame.c (make_frame): Call other_buffer_safely instead of
407 * window.c (temp_output_buffer_show): Call display_buffer with
408 second argument Vtemp_buffer_show_specifiers and reset latter
409 immediately after the call.
410 (Vtemp_buffer_show_specifiers): New variable.
411 (auto_window_vscroll_p, next_screen_context_lines)
412 (Vscroll_preserve_screen_position): Remove leading asterisks from
415 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
417 Fix minor problems found by GCC 4.6.0 static checking.
418 * buffer.c (Qclone_number): Remove for now, as it's unused.
419 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
420 (record_buffer): Remove unused local.
421 * frame.c (other_visible_frames, frame_buffer_list): Now static.
422 (set_frame_buffer_list): Remove; unused.
423 * frame.h (other_visible_frames): Remove decl.
424 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
425 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
426 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
428 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
429 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
430 Define only if HAVE_GPM.
431 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
432 (update_hints_inhibit): Remove; never set. All uses removed.
433 * widgetprv.h (emacsFrameClassRec): Remove decl.
434 * window.c (delete_deletable_window): Now returns void, since it
435 wasn't returning anything.
436 (compare_window_configurations): Remove unused locals.
437 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
438 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
439 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
440 the same widths as pointers. This follows up on the 2011-05-06 patch.
441 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
443 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
445 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
447 * makefile.w32-in: Update dependencies.
448 (LISP_H): Add lib/intprops.h.
450 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
452 * image.c (gif_load): Add animation frame delay to the metadata.
453 (syms_of_image): Use DEFSYM. New symbol `delay'.
455 2011-06-11 Martin Rudalics <rudalics@gmx.at>
457 * window.c (delete_deletable_window): Re-add.
458 (Fset_window_configuration): Rewrite to handle dead buffers and
459 consequently deletable windows.
460 (window_tree, Fwindow_tree): Remove. Supply functionality in
462 (compare_window_configurations): Simplify code.
464 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
466 * image.c (imagemagick_load_image): Fix type mismatch.
467 (Fimagemagick_types): Likewise.
469 * window.h (replace_buffer_in_windows): Declare.
471 2011-06-11 Martin Rudalics <rudalics@gmx.at>
473 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
474 Qclone_number. Remove external declaration of Qdelete_window.
475 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
477 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run
478 Qbuffer_list_update_hook if allowed.
479 (Fother_buffer): Rewrite doc-string. Major rewrite for new
480 buffer list implementation.
481 (other_buffer_safely): New function.
482 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
483 calls to replace_buffer_in_windows and
484 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
486 (record_buffer): Inhibit quitting and rewrite using quittable
487 functions. Run Qbuffer_list_update_hook if allowed.
488 (Frecord_buffer, Funrecord_buffer): New functions.
489 (switch_to_buffer_1, Fswitch_to_buffer): Remove. Move
490 switch-to-buffer to window.el.
491 (bury-buffer): Move to window.el.
492 (Vbuffer_list_update_hook): New variable.
494 * lisp.h (other_buffer_safely): Add prototype in buffer.c
497 * window.h (resize_frame_windows): Move up in code.
498 (Fwindow_frame): Remove EXFUN.
499 (replace_buffer_in_all_windows): Remove prototype.
500 (replace_buffer_in_windows_safely): Add prototype.
502 * window.c: Declare Qdelete_window static again. Move down
503 declaration of select_count.
504 (Fnext_window, Fprevious_window): Rewrite doc-strings.
505 (Fother_window): Move to window.el.
506 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
507 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
508 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
510 (replace_buffer_in_windows): Implement by calling
511 Qreplace_buffer_in_windows.
512 (replace_buffer_in_all_windows): Remove with some functionality
513 moved into replace_buffer_in_windows_safely.
514 (replace_buffer_in_windows_safely): New function.
515 (select_window_norecord, select_frame_norecord): Move in front
516 of run_window_configuration_change_hook. Remove now obsolete
518 (Fset_window_buffer): Rewrite doc-string. Call
519 Qrecord_window_buffer.
520 (keys_of_window): Move binding for other-window to window.el.
522 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
524 * dispextern.h (struct image): Replace data member, whose int_val
525 and ptr_val fields were not used by anything, with a single
528 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
529 (gif_clear_image, gif_load, imagemagick_load_image)
530 (gs_clear_image, gs_load): Callers changed.
532 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
534 * buffer.h: Include <time.h>, for time_t.
535 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
537 Fix minor problems found by static checking.
539 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
541 Make identifiers static if they are not used in other modules.
542 * data.c (Qcompiled_function, Qframe, Qvector):
543 * image.c (QimageMagick, Qsvg):
544 * minibuf.c (Qmetadata):
545 * window.c (resize_window_check, resize_root_window): Now static.
546 * window.h (resize_window_check, resize_root_window): Remove decls.
548 * window.c (window_deletion_count, delete_deletable_window):
550 (window_body_lines): Now static.
551 (Fdelete_other_windows_internal): Mark vars as initialized.
552 Make sure 'resize_failed' is initialized.
553 (run_window_configuration_change_hook): Rename local to avoid shadowing.
554 (resize_window_apply): Remove unused local.
555 * window.h (delete_deletable_window): Remove decl.
557 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
558 (imagemagick_load_image): Fix pointer signedness problem by changing
559 last arg from unsigned char * to char *. All uses changed.
560 Also, fix a local for similar reasons.
561 Remove unused locals. Remove locals to avoid shadowing.
562 (fn_rsvg_handle_free): Remove; unused.
563 (svg_load, svg_load_image): Fix pointer signedness problem.
564 (imagemagick_load_image): Don't use garbage pointer image_wand.
566 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
568 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
570 * image.c (gif_load): Fix omitted cast error introduced by
573 2011-06-10 Martin Rudalics <rudalics@gmx.at>
575 * window.h (resize_proportionally, orig_total_lines)
576 (orig_top_line): Remove from window structure.
577 (set_window_height, set_window_width, change_window_heights)
578 (Fdelete_window): Remove prototypes.
579 (resize_frame_windows): Remove duplicate declaration.
581 2011-06-10 Eli Zaretskii <eliz@gnu.org>
583 * window.h (resize_frame_windows, resize_window_check)
584 (delete_deletable_window, resize_root_window)
585 (resize_frame_windows): Declare prototypes.
587 * window.c (resize_window_apply): Make definition be "static" to
590 2011-06-10 Martin Rudalics <rudalics@gmx.at>
592 * window.c: Remove declarations of Qwindow_size_fixed,
593 window_min_size_1, window_min_size_2, window_min_size,
594 size_window, window_fixed_size_p, enlarge_window, delete_window.
595 Remove static from declaration of Qdelete_window, it's
596 temporarily needed by Fbury_buffer.
597 (replace_window): Don't assign orig_top_line and
599 (Fdelete_window, delete_window): Remove. Window deletion is
600 handled by window.el.
601 (window_loop): Remove DELETE_OTHER_WINDOWS case. Replace
602 Fdelete_window calls with calls to Qdelete_window.
603 (Fdelete_other_windows): Remove. Deleting other windows is
604 handled by window.el.
605 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
606 handled in window.el.
607 (window_min_size_2, window_min_size_1, window_min_size): Remove.
608 Window minimum sizes are handled in window.el.
609 (shrink_windows, size_window, set_window_height)
610 (set_window_width, change_window_heights, window_height)
611 (window_width, CURBEG, CURSIZE, enlarge_window)
612 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
613 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
614 handled in window.el.
615 (make_dummy_parent): Rename to make_parent_window and give it a
616 second argument horflag.
617 (make_window): Don't set resize_proportionally any more.
618 (Fsplit_window): Remove. Windows are split in window.el.
619 (save_restore_action, save_restore_orig_size)
620 (shrink_window_lowest_first, save_restore_orig_size): Remove.
621 Resize mini windows in window.el.
622 (grow_mini_window, shrink_mini_window): Implement by calling
623 Qresize_root_window_vertically, resize_window_check and
625 (saved_window, Fset_window_configuration, save_window_save): Do
626 not handle orig_top_line, orig_total_lines, and
627 resize_proportionally.
628 (window_min_height, window_min_width): Move to window.el.
629 (keys_of_window): Move bindings for delete-other-windows,
630 split-window, delete-window and enlarge-window to window.el.
632 * buffer.c: Temporarily extern Qdelete_window.
633 (Fbury_buffer): Temporarily call Qdelete_window instead of
634 Fdelete_window (Fbury_buffer will move to window.el soon).
636 * frame.c (set_menu_bar_lines_1): Remove code handling
637 orig_top_line and orig_total_lines.
639 * dispnew.c (adjust_frame_glyphs_initially): Don't use
640 set_window_height but set heights directly.
641 (change_frame_size_1): Use resize_frame_windows.
643 * xdisp.c (init_xdisp): Don't use set_window_height but set
646 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Use
647 resize_frame_windows instead of change_window_heights and run
648 run_window_configuration_change_hook.
650 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
651 instead of change_window_heights and run
652 run_window_configuration_change_hook.
654 2011-06-09 Martin Rudalics <rudalics@gmx.at>
656 * window.c (replace_window): Rename second argument REPLACEMENT to
657 NEW. New third argument SETFLAG. Rewrite.
658 (delete_window, make_dummy_parent): Call replace_window with
660 (window_list_1): Move down in code.
661 (run_window_configuration_change_hook): Move set_buffer part
662 before select_frame_norecord part in order to unwind correctly.
663 Rename count1 to count.
664 (recombine_windows, delete_deletable_window, resize_root_window)
665 (Fdelete_other_windows_internal)
666 (Frun_window_configuration_change_hook, make_parent_window)
667 (resize_window_check, resize_window_apply, Fresize_window_apply)
668 (resize_frame_windows, Fsplit_window_internal)
669 (Fdelete_window_internal, Fresize_mini_window_internal): New
671 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
673 2011-06-08 Martin Rudalics <rudalics@gmx.at>
675 * window.h (window): Add some new members to window structure -
676 normal_lines, normal_cols, new_total, new_normal, clone_number,
677 splits, nest, prev_buffers, next_buffers.
678 (WINDOW_TOTAL_SIZE): Move here from window.c.
679 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
681 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
683 (make_dummy_parent): Set new members of windows structure.
684 (make_window): Move down in code. Handle new members of window
686 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
687 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
688 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
689 (Fset_window_prev_buffers, Fwindow_next_buffers)
690 (Fset_window_next_buffers, Fset_window_clone_number): New
692 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
693 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
695 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
696 Argument WINDOW can be now internal window too.
697 (Fwindow_use_time): Move up in code.
698 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
700 (Fset_window_configuration, saved_window)
701 (Fcurrent_window_configuration, save_window_save): Handle new
702 members of window structure.
703 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
704 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
705 (syms_of_window): New Lisp objects Qrecord_window_buffer,
706 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
707 Qget_mru_window, Qresize_root_window,
708 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
709 Qauto_buffer_name; staticpro them.
711 2011-06-07 Martin Rudalics <rudalics@gmx.at>
713 * window.c (Fwindow_total_size, Fwindow_left_column)
714 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
715 (Fwindow_list_1): New functions.
716 (window_box_text_cols): Replace with window_body_cols.
717 (Fwindow_width, Fscroll_left, Fscroll_right): Use
718 window_body_cols instead of window_box_text_cols.
719 (delete_window, Fset_window_configuration): Call
720 delete_all_subwindows with window as argument.
721 (delete_all_subwindows): Take a window as argument and not a
723 (window_loop): Remove handling of GET_LRU_WINDOW and
725 (Fget_lru_window, Fget_largest_window): Move to window.el.
727 * window.h: Extern window_body_cols instead of
728 window_box_text_cols. delete_all_subwindows now takes a
729 Lisp_Object as argument.
731 * indent.c (compute_motion, Fcompute_motion): Use
732 window_body_cols instead of window_box_text_cols.
734 * frame.c (delete_frame): Call delete_all_subwindows with root
737 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
739 * fns.c (Fputhash): Document return value.
741 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
743 * image.c (gif_load): Implement gif89a spec "no disposal" method.
745 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
747 Cons<->int and similar integer overflow fixes (Bug#8794).
749 Check for overflow when converting integer to cons and back.
750 * charset.c (Fdefine_charset_internal, Fdecode_char):
751 Use cons_to_unsigned to catch overflow.
752 (Fencode_char): Use INTEGER_TO_CONS.
753 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
754 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
755 * data.c (long_to_cons, cons_to_long): Remove.
756 (cons_to_unsigned, cons_to_signed): New functions.
757 These signal an error for invalid or out-of-range values.
758 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
759 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
760 * font.c (Ffont_variation_glyphs):
761 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
762 * lisp.h: Include <intprops.h>.
763 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
764 (cons_to_signed, cons_to_unsigned): New decls.
765 (long_to_cons, cons_to_long): Remove decls.
766 * undo.c (record_first_change): Use INTEGER_TO_CONS.
767 (Fprimitive_undo): Use CONS_TO_INTEGER.
768 * xfns.c (Fx_window_property): Likewise.
769 * xselect.c: Include <limits.h>.
770 (x_own_selection, selection_data_to_lisp_data):
772 (x_handle_selection_request, x_handle_selection_clear)
773 (x_get_foreign_selection, Fx_disown_selection_internal)
774 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
775 (lisp_data_to_selection_data): Use cons_to_unsigned.
776 (x_fill_property_data): Use cons_to_signed.
777 Report values out of range.
779 Check for buffer and string overflow more precisely.
780 * buffer.h (BUF_BYTES_MAX): New macro.
781 * lisp.h (STRING_BYTES_MAX): New macro.
782 * alloc.c (Fmake_string):
783 * character.c (string_escape_byte8):
784 * coding.c (coding_alloc_by_realloc):
786 * editfns.c (Fformat):
788 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
789 since they may not be the same number.
790 * editfns.c (Finsert_char):
791 * fileio.c (Finsert_file_contents):
792 Likewise for BUF_BYTES_MAX.
794 * image.c: Use ptrdiff_t, not int, for sizes.
795 (slurp_file): Switch from int to ptrdiff_t.
797 (slurp_file): Check that file size fits in both size_t (for
798 malloc) and ptrdiff_t (for sanity and safety).
800 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
801 if b->modtime has its maximal value.
803 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
805 Don't assume time_t can fit into int.
806 * buffer.h (struct buffer.modtime): Now time_t, not int.
807 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
808 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
810 Minor fixes for signed vs unsigned integers.
811 * character.h (MAYBE_UNIFY_CHAR):
812 * charset.c (maybe_unify_char):
813 * keyboard.c (read_char, reorder_modifiers):
814 XINT -> XFASTINT, since the integer must be nonnegative.
815 * ftfont.c (ftfont_spec_pattern):
816 * keymap.c (access_keymap, silly_event_symbol_error):
817 XUINT -> XFASTINT, since the integer must be nonnegative.
818 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
819 since it makes no difference and we prefer signed.
820 * keyboard.c (record_char): Use XUINT when all the neighbors do.
821 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
824 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
826 * window.h (Fwindow_frame): Declare.
828 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
830 * alloc.c: Simplify handling of large-request failures (Bug#8800).
831 (SPARE_MEMORY): Always define.
832 (LARGE_REQUEST): Remove.
833 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
835 2011-06-06 Martin Rudalics <rudalics@gmx.at>
837 * lisp.h: Move EXFUNS for Fframe_root_window,
838 Fframe_first_window and Fset_frame_selected_window to window.h.
840 * window.h: Move EXFUNS for Fframe_root_window,
841 Fframe_first_window and Fset_frame_selected_window here from
844 * frame.c (Fwindow_frame, Fframe_first_window)
845 (Fframe_root_window, Fframe_selected_window)
846 (Fset_frame_selected_window): Move to window.c.
847 (Factive_minibuffer_window): Move to minibuf.c.
848 (Fother_visible_frames_p): New function.
850 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
852 * window.c (decode_window, decode_any_window): Move up in code.
853 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
854 (inhibit_frame_unsplittable): Remove unused variable.
855 (Fwindow_buffer): Move up and rewrite doc-string.
856 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
857 (Fwindow_prev): New functions.
858 (Fwindow_frame): Move here from frame.c. Accept any window as
860 (Fframe_root_window, Fframe_first_window)
861 (Fframe_selected_window): Move here from frame.c. Accept frame
862 or arbitrary window as argument. Update doc-strings.
863 (Fminibuffer_window): Move up in code.
864 (Fwindow_minibuffer_p): Move up in code and simplify.
865 (Fset_frame_selected_window): Move here from frame.c.
867 (Fselected_window, select_window, Fselect_window): Move up in
868 code. Minor doc-string fixes.
870 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
872 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
873 Do not assume that spare memory exists; that assumption is valid
874 only if SYSTEM_MALLOC.
875 (LARGE_REQUEST): New macro, so that the issue of large requests
876 is separated from the issue of spare memory.
878 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
880 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
883 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
885 * xfns.c (x_set_scroll_bar_default_width): Move declarations
888 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
890 * gtkutil.c (xg_get_default_scrollbar_width): New function.
892 * gtkutil.h: Declare xg_get_default_scrollbar_width.
894 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
895 min width by calling x_set_scroll_bar_default_width (Bug#8505).
897 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
899 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
901 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
903 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
904 (x_clipboard_manager_save): Add return value.
905 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
907 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
908 Obey Vx_select_enable_clipboard_manager. Catch errors in
909 x_clipboard_manager_save (Bug#8779).
910 (Vx_select_enable_clipboard_manager): New variable.
911 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
913 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
915 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
917 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
919 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
920 in the current matrix if keep_current_p is non-zero.
922 2011-06-04 Eli Zaretskii <eliz@gnu.org>
924 * bidi.c (bidi_level_of_next_char): Fix last change.
926 2011-06-03 Eli Zaretskii <eliz@gnu.org>
928 Support bidi reordering of text covered by display properties.
930 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
931 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
932 (bidi_cache_search, bidi_cache_iterator_state)
933 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
934 (bidi_level_of_next_char, bidi_move_to_visually_next):
935 Support character positions inside a run of characters covered by a
937 (bidi_paragraph_init, bidi_resolve_explicit_1)
938 (bidi_level_of_next_char): Call bidi_fetch_char and
939 bidi_fetch_char_advance instead of FETCH_CHAR and
941 (bidi_init_it): Initialize new members.
942 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
944 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
945 instead of using explicit *_CHAR codes.
946 (bidi_resolve_explicit, bidi_resolve_weak):
947 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
948 bidirectional text is supported only in multibyte buffers.
949 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
950 it to initialize the frame_window_p member of struct bidi_it.
951 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
952 (bidi_resolve_explicit, bidi_resolve_weak)
953 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
954 bidi_it->nchars is non-positive.
955 (bidi_level_of_next_char): Don't try to lookup the cache for the
956 next/previous character if nothing is cached there yet, or if we
957 were just reseat()'ed to a new position.
959 * xdisp.c (set_cursor_from_row): Set start and stop points
960 according to the row's direction when priming the loop that looks
961 for the glyph on which to display cursor.
962 (single_display_spec_intangible_p): Function deleted.
963 (display_prop_intangible_p): Reimplement to call
964 handle_display_spec instead of single_display_spec_intangible_p.
965 Accept 3 additional arguments needed by handle_display_spec.
966 This fixes incorrect cursor motion across display property with complex
967 values: lists, `(when COND...)' forms, etc.
968 (single_display_spec_string_p): Support property values that are
969 lists with the argument STRING its top-level element.
970 (display_prop_string_p): Fix the condition for processing a
971 property that is a list to be consistent with handle_display_spec.
972 (handle_display_spec): New function, refactored from the
973 last portion of handle_display_prop.
974 (compute_display_string_pos): Accept additional argument
975 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
976 value of a `display' property is a "replacing spec".
977 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
978 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
979 the display property, but just return a value indicating whether
980 the display property will replace the characters it covers.
981 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
982 frame_window_p members of struct bidi_it.
983 (compute_display_string_pos, compute_display_string_end):
985 (push_it): Accept second argument POSITION, where pop_it should
986 jump to continue iteration.
987 (reseat_1): Initialize bidi_it.disp_pos.
989 * keyboard.c (adjust_point_for_property): Adjust the call to
990 display_prop_intangible_p to its new signature.
992 * dispextern.h (struct bidi_it): New member frame_window_p.
993 (bidi_init_it): Update prototypes.
994 (display_prop_intangible_p): Update prototype.
995 (compute_display_string_pos, compute_display_string_end):
997 (struct bidi_it): New members nchars and disp_pos. ch_len is now
1000 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
1002 Malloc failure behavior now depends on size of allocation.
1003 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
1004 * lisp.h: Change signatures accordingly.
1005 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
1006 All callers changed. (Bug#8762)
1008 * gnutls.c: Use Emacs's memory allocators.
1009 Without this change, the gnutls library would invoke malloc etc.
1010 directly, which causes problems on non-SYNC_INPUT hosts, and which
1011 runs afoul of improving memory_full behavior. (Bug#8761)
1012 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
1013 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
1014 xfree instead of the default malloc, realloc, free.
1015 (Fgnutls_boot): No need to check for memory allocation failure,
1016 since xmalloc does that for us.
1018 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
1019 * category.c (hash_get_category_set):
1020 * ccl.c (ccl_driver):
1021 * charset.c (Fdefine_charset_internal):
1022 * charset.h (struct charset.hash_index):
1023 * composite.c (get_composition_id, gstring_lookup_cache)
1024 (composition_gstring_put_cache):
1025 * composite.h (struct composition.hash_index):
1026 * dispextern.h (struct image.hash):
1027 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
1028 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1029 (hashfn_equal, hashfn_user_defined, make_hash_table)
1030 (maybe_resize_hash_table, hash_lookup, hash_put)
1031 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
1032 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
1033 (Fsxhash, Fgethash, Fputhash, Fmaphash):
1034 * image.c (make_image, search_image_cache, lookup_image)
1035 (xpm_put_color_table_h):
1036 * lisp.h (struct Lisp_Hash_Table):
1037 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
1038 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
1039 for hashes and hash indexes, instead of 'unsigned' and 'int'.
1040 * alloc.c (allocate_vectorlike):
1041 Check for overflow in vector size calculations.
1042 * ccl.c (ccl_driver):
1043 Check for overflow when converting EMACS_INT to int.
1044 * fns.c, image.c: Remove unnecessary static decls that would otherwise
1045 need to be updated by these changes.
1046 * fns.c (make_hash_table, maybe_resize_hash_table):
1047 Check for integer overflow with large hash tables.
1048 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
1049 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
1050 (SXHASH_REDUCE): New macro.
1051 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
1052 Use it instead of discarding useful hash info with large hash values.
1053 (sxhash_float): New function.
1054 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
1055 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
1056 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
1057 Rewrite to use FIXNUM_BITS, as this simplifies things.
1058 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
1059 Adjust signatures to match updated version of code.
1060 (consing_since_gc): Now EMACS_INT, since a single hash table can
1061 use more than INT_MAX bytes.
1063 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
1065 Make it possible to build with GCC-4.6+ -O2 -flto.
1067 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
1069 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
1071 * minibuf.c (get_minibuffer, read_minibuf_unwind):
1072 Call minibuffer-inactive-mode.
1074 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
1076 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
1077 Update dependencies.
1079 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
1081 * data.c (init_data): Remove code for UTS, this system is not
1084 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
1086 Don't force ./temacs to start in terminal mode.
1088 * frame.c (make_initial_frame): Initialize faces in all cases, not
1089 only when CANNOT_DUMP is defined.
1090 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
1092 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
1094 * dispnew.c (add_window_display_history): Use const for the string
1095 pointer. Remove declaration, not needed.
1097 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
1099 Use 'inline', not 'INLINE'.
1100 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
1101 * alloc.c, fontset.c (INLINE): Remove.
1102 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
1103 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
1104 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
1105 * gmalloc.c (register_heapinfo): Use inline unconditionally.
1106 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
1108 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
1110 Make it possible to run ./temacs.
1112 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
1113 syms_of_callproc does the same thing. Remove test for
1114 "initialized", do it in the caller.
1115 * emacs.c (main): Avoid calling set_initial_environment when dumping.
1117 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
1119 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
1120 (read_minibuf): Use get_minibuffer.
1121 (syms_of_minibuf): Use DEFSYM.
1122 (Qmetadata): New var.
1123 * data.c (Qbuffer): Don't make it static.
1124 (syms_of_data): Use DEFSYM.
1126 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
1128 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
1129 (CCL_CODE_MIN): New macro.
1131 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
1133 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
1135 * eval.c (Qdebug): Now static.
1136 * lisp.h (Qdebug): Remove decl. This reverts a part of the
1137 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
1138 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
1140 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
1142 * image.c: Various fixes to ImageMagick code comments.
1143 (Fimagemagick_types): Doc fix.
1145 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
1147 Minor fixes prompted by GCC 4.6.0 warnings.
1149 * xselect.c (converted_selections, conversion_fail_tag): Now static.
1151 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
1152 (x_clipboard_manager_save_all): Move extern decl to ...
1153 * xterm.h: ... here, so that it can be checked for consistency.
1155 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
1157 * xselect.c (x_clipboard_manager_save_frame)
1158 (x_clipboard_manager_save_all): New functions.
1159 (Fx_clipboard_manager_save): Lisp function deleted.
1161 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
1162 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
1164 * xterm.h: Update prototype.
1166 2011-05-28 William Xu <william.xwl@gmail.com>
1168 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
1171 2011-05-28 Jim Meyering <meyering@redhat.com>
1173 Avoid a sign-extension bug in crypto_hash_function.
1174 * fns.c (to_uchar): Define.
1175 (crypto_hash_function): Use it to convert some newly-signed
1176 variables to unsigned, to avoid sign-extension bugs. For example,
1177 without this change, (md5 "truc") would evaluate to
1178 45723a2aff78ff4fff7fff1114760e62 rather than the expected
1179 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
1180 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
1182 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
1184 Integer overflow fixes.
1186 * dbusbind.c: Serial number integer overflow fixes.
1187 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
1188 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
1189 to hold a serial number that is too large for a fixnum.
1190 (Fdbus_method_return_internal, Fdbus_method_error_internal):
1191 Check for serial numbers out of range. Decode any serial number
1192 that was so large that it became a float. (Bug#8722)
1194 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
1195 (Fdbus_call_method, Fdbus_call_method_asynchronously):
1196 Use XFASTINT rather than XUINT when numbers are nonnegative.
1197 (xd_append_arg, Fdbus_method_return_internal):
1198 (Fdbus_method_error_internal): Likewise. Also, for unsigned
1199 arguments, check that Lisp number is nonnegative, rather than
1200 silently wrapping negative numbers around. (Bug#8722)
1201 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
1204 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
1206 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
1208 ccl: add integer overflow checks
1209 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
1210 (IN_INT_RANGE): New macros.
1211 (ccl_driver): Use them to check for integer overflow when
1212 decoding a CCL program. Many of the new checks are whether XINT (x)
1213 fits in int; it doesn't always, on 64-bit hosts. The new version
1214 doesn't catch all possible integer overflows, but it's an
1215 improvement. (Bug#8719)
1217 * alloc.c (make_event_array): Use XINT, not XUINT.
1218 There's no need for unsigned here.
1220 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
1221 This follows up to the 2011-05-06 change that substituted uintptr_t
1222 for EMACS_INT. This case wasn't caught back then.
1224 Rework Fformat to avoid integer overflow issues.
1225 * editfns.c: Include <float.h> unconditionally, as it's everywhere
1226 now (part of C89). Include <verify.h>.
1227 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
1228 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
1229 (Fformat): Avoid the prepass trying to compute sizes; it was only
1230 approximate and thus did not catch overflow reliably. Instead, walk
1231 through the format just once, formatting and computing sizes as we go,
1232 checking for integer overflow at every step, and allocating a larger
1233 buffer as needed. Keep track separately whether the format is
1234 multibyte. Keep only the most-recently calculated precision, rather
1235 than them all. Record whether each argument has been converted to
1236 string. Use EMACS_INT, not int, for byte and char and arg counts.
1237 Support field widths and precisions larger than INT_MAX. Avoid
1238 sprintf's undefined behavior with conversion specifications such as %#d
1239 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
1240 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
1241 formatting out-of-range floating point numbers with int
1244 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
1246 * data.c: Avoid integer truncation in expressions involving floats.
1247 * data.c: Include <intprops.h>.
1248 (arith_driver): When there's an integer overflow in an expression
1249 involving floating point, convert the integers to floating point
1250 so that the resulting value does not suffer from catastrophic
1251 integer truncation. For example, on a 64-bit host (* 4
1252 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
1253 Do not rely on undefined behavior after integer overflow.
1255 merge count_size_as_multibyte, parse_str_to_multibyte
1256 * character.c, character.h (count_size_as_multibyte):
1257 Rename from parse_str_to_multibyte; all uses changed.
1258 Check for integer overflow.
1259 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
1260 since it's now a duplicate of the other. This is more of
1261 a character than a buffer op, so better that it's in character.c.
1262 * fns.c, print.c: Adjust to above changes.
1264 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
1266 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
1268 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
1270 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
1271 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
1272 (x_clipboard_manager_save): Now static.
1273 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
1275 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
1276 (crypto_hash_function): Now static.
1277 Fix pointer signedness problems. Avoid unnecessary initializations.
1279 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
1281 * termhooks.h (Vselection_alist): Make it terminal-local.
1283 * terminal.c (create_terminal): Initialize it.
1285 * xselect.c: Support for clipboard managers.
1286 (Vselection_alist): Move to termhooks.h as terminal-local var.
1287 (LOCAL_SELECTION): New macro.
1288 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
1289 (symbol_to_x_atom): Remove gratuitous arg.
1290 (x_handle_selection_request, lisp_data_to_selection_data)
1291 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
1292 (x_own_selection, x_get_local_selection, x_convert_selection):
1293 New arg, specifying work frame. Use terminal-local Vselection_alist.
1294 (some_frame_on_display): Delete unused function.
1295 (Fx_own_selection_internal, Fx_get_selection_internal)
1296 (Fx_disown_selection_internal, Fx_selection_owner_p)
1297 (Fx_selection_exists_p): New optional frame arg.
1298 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
1299 (x_handle_selection_clear): Don't treat other terminals with the
1300 same keyboard specially. Use the terminal-local Vselection_alist.
1301 (x_clear_frame_selections): Use Frun_hook_with_args.
1303 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
1305 * xterm.h: Add support for those atoms.
1307 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
1309 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
1310 (converted_selections, conversion_fail_tag): New global variables.
1311 (x_selection_request_lisp_error): Free the above.
1312 (x_get_local_selection): Remove unnecessary code.
1313 (x_reply_selection_request): Args changed; handle arbitrary array
1314 of converted selections stored in converted_selections.
1315 Separate the XChangeProperty and SelectionNotify steps.
1316 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
1317 (x_convert_selection): New function.
1318 (x_handle_selection_event): Simplify.
1319 (x_get_foreign_selection): Don't ignore incoming requests while
1320 waiting for an answer; this will fail when we implement
1321 SAVE_TARGETS, and seems unnecessary anyway.
1322 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
1323 (Vx_sent_selection_functions): Doc fix.
1325 2011-05-26 Leo Liu <sdl.web@gmail.com>
1327 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
1329 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1331 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
1333 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
1334 for fringe update if it has periodic bitmap.
1335 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
1336 and fringe_bitmap_periodic_p.
1338 * fringe.c (get_fringe_bitmap_data): New function.
1339 (draw_fringe_bitmap_1, update_window_fringes): Use it.
1340 (update_window_fringes): Record periodicity of fringe bitmap in glyph
1341 row. Mark glyph row for fringe update if periodicity changed.
1343 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
1344 for fringe update unless it has periodic bitmap.
1346 2011-05-25 Kenichi Handa <handa@m17n.org>
1348 * xdisp.c (get_next_display_element): Set correct it->face_id for
1349 a static composition.
1351 2011-05-24 Leo Liu <sdl.web@gmail.com>
1354 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
1356 * fns.c (crypto_hash_function, Fsha1): New function.
1357 (Fmd5): Use crypto_hash_function.
1358 (syms_of_fns): Add Ssha1.
1360 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
1362 * gnutls.c: Remove unused macros.
1363 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
1364 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
1365 Remove macros that are defined and never used.
1366 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
1368 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
1370 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
1371 (Fx_get_selection_internal): Minor cleanup.
1372 (Fx_own_selection_internal): Rename arguments for consistency with
1375 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
1377 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
1379 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
1381 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
1383 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1385 * dispnew.c (scrolling_window): Don't exclude the case that the
1386 last enabled row in the desired matrix touches the bottom boundary.
1388 2011-05-21 Glenn Morris <rgm@gnu.org>
1390 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
1391 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
1392 and add some more files.
1394 2011-05-20 Eli Zaretskii <eliz@gnu.org>
1396 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
1397 report_file_error introduced by the change from 2011-05-07.
1399 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
1401 * systime.h (Time): Define only if emacs is defined.
1402 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
1403 where the include path doesn't have X11/X.h by default. See
1404 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
1406 2011-05-20 Kenichi Handa <handa@m17n.org>
1408 * composite.c (find_automatic_composition): Fix previous change.
1410 2011-05-20 Glenn Morris <rgm@gnu.org>
1412 * lisp.mk: New file, split from Makefile.in.
1413 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
1414 (shortlisp): Remove.
1415 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
1417 2011-05-19 Glenn Morris <rgm@gnu.org>
1419 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
1420 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
1421 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
1422 (lisp): Set the order to that of loadup.el.
1423 (shortlisp): Make it a copy of $lisp.
1424 (SOME_MACHINE_LISP): Remove.
1425 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
1426 Use just $shortlisp, not $SOME_MACHINE_LISP too.
1428 2011-05-18 Kenichi Handa <handa@m17n.org>
1430 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
1431 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
1432 (find_automatic_composition): Mostly rewrite for efficiency.
1434 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
1436 * makefile.w32-in: Update dependencies.
1438 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
1440 * menu.c: Include limits.h (fixes the MS-Windows build broken by
1441 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
1443 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
1445 Fix some integer overflow issues, such as string length overflow.
1447 * insdel.c (count_size_as_multibyte): Check for string overflow.
1449 * character.c (lisp_string_width): Check for string overflow.
1450 Use EMACS_INT, not int, for string indexes and lengths; in
1451 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
1452 the resulting string length overflows an EMACS_INT; instead,
1453 report a string overflow if no precision given. When checking for
1454 precision exhaustion, use a check that cannot possibly have
1455 integer overflow. (Bug#8675)
1456 * character.h (lisp_string_width): Adjust to new signature.
1458 * alloc.c (string_overflow): New function.
1459 (Fmake_string): Use it. This doesn't change behavior, but saves
1460 a few bytes and will simplify future changes.
1461 * character.c (string_escape_byte8): Likewise.
1462 * lisp.h (string_overflow): New decl.
1464 Fixups, following up to the user-interface timestamp change.
1465 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
1466 for UI timestamps, instead of unsigned long.
1467 * msdos.c (mouse_get_pos): Likewise.
1468 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1469 * w32gui.h (Time): Define by including "systime.h" rather than by
1470 declaring it ourselves. (Bug#8664)
1472 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
1473 * image.c (clear_image_cache): Likewise.
1475 * term.c (term_mouse_position): Don't assume time_t wraparound.
1477 Be more systematic about user-interface timestamps.
1478 Before, the code sometimes used 'Time', sometimes 'unsigned long',
1479 and sometimes 'EMACS_UINT', to represent these timestamps.
1480 This change causes it to use 'Time' uniformly, as that's what X uses.
1481 This makes the code easier to follow, and makes it easier to catch
1482 integer overflow bugs such as Bug#8664.
1483 * frame.c (Fmouse_position, Fmouse_pixel_position):
1484 Use Time, not unsigned long, for user-interface timestamps.
1485 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
1486 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
1487 * keyboard.h (last_event_timestamp): Likewise.
1488 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
1489 * menu.h (xmenu_show): Likewise.
1490 * term.c (term_mouse_position): Likewise.
1491 * termhooks.h (struct input_event.timestamp): Likewise.
1492 (struct terminal.mouse_position_hook): Likewise.
1493 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
1494 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
1495 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
1496 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
1498 * menu.h, termhooks.h: Include "systime.h", for Time.
1500 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
1501 Don't assume that the difference between two unsigned long values
1502 can fit into an integer. At this point, we know button_down_time
1503 <= event->timestamp, so the difference must be nonnegative, so
1504 there's no need to cast the result if double-click-time is
1505 nonnegative, as it should be; check that it's nonnegative, just in
1506 case. This bug is triggered when events are more than 2**31 ms
1507 apart (about 25 days). (Bug#8664)
1509 * xselect.c (last_event_timestamp): Remove duplicate decl.
1510 (x_own_selection): Remove needless cast to unsigned long.
1512 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
1513 that always fit in int. Use a sentinel instead of a counter, to
1514 avoid a temp and to allay GCC's concerns about possible int overflow.
1515 * frame.h (struct frame): Use int for menu_bar_items_used
1516 instead of EMACS_INT, since it always fits in int.
1518 * menu.c (grow_menu_items): Check for int overflow.
1520 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
1522 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
1523 Before, the code was not consistent. These values cannot exceed
1524 2**31 - 1 so there's no need to make them unsigned.
1525 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
1526 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
1527 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
1529 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
1531 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
1532 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
1533 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
1534 presumably because the widths might not match.
1536 * window.c (size_window): Avoid needless test at loop start.
1538 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
1540 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
1542 2011-05-12 Drew Adams <drew.adams@oracle.com>
1544 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
1546 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1548 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
1549 `width' to `bar_area_x' and `bar_area_width', respectively.
1550 (x_scroll_run): Take account of fringe background extension.
1552 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
1553 Rename local vars `left' and `width' to `bar_area_x' and
1554 `bar_area_width', respectively.
1555 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
1556 background extension.
1558 2011-05-10 Jim Meyering <meyering@redhat.com>
1560 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
1562 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
1564 * image.c (Finit_image_library): Return t for built-in image types,
1565 like pbm and xbm. (Bug#8640)
1567 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
1569 * w32menu.c (set_frame_menubar): Fix submenu allocation.
1571 2011-05-07 Eli Zaretskii <eliz@gnu.org>
1573 * w32console.c (Fset_screen_color): Doc fix.
1574 (Fget_screen_color): New function.
1575 (syms_of_ntterm): Defsubr it.
1577 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
1578 unlink the temporary file if Fcall_process didn't create it in the
1580 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
1581 child process will be redirected to a file specified with `:file'.
1582 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
1583 cue to call_process_cleanup not to close that handle.
1585 2011-05-07 Ben Key <bkey76@gmail.com>
1587 * makefile.w32-in: The bootstrap-temacs rule now makes use of
1588 one of two shell specific rules, either bootstrap-temacs-CMD or
1589 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
1590 to the previous implementation of the bootstrap-temacs rule.
1591 The bootstrap-temacs-CMD rule is similar to the previous
1592 implementation of the bootstrap-temacs rule except that it
1593 makes use of the ESC_CFLAGS variable instead of the CFLAGS
1596 These changes, along with some changes to nt/configure.bat,
1597 nt/gmake.defs, and nt/nmake.defs, are required to extend my
1598 earlier fix to add support for --cflags and --ldflags options
1599 that include quotes so that it works whether make uses cmd or
1602 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
1604 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
1605 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
1607 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
1608 a string. Handle both cases.
1609 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
1610 (Fdbus_register_method): Use Qinvalid_function.
1612 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
1614 * makefile.w32-in: Update dependencies.
1615 (LISP_H): Add inttypes.h and stdin.h.
1616 (PROCESS_H): Add unistd.h.
1618 2011-05-06 Eli Zaretskii <eliz@gnu.org>
1620 * lread.c: Include limits.h (fixes the MS-Windows build broken by
1621 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
1623 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
1625 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
1627 * term.c (vfatal): Remove stray call to va_end.
1628 It's not needed and the C Standard doesn't allow it here anyway.
1630 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
1631 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
1633 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
1636 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
1638 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
1640 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
1642 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
1644 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
1646 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
1647 * charset.c (Fdefine_charset_internal): Don't initialize
1648 charset.code_space[15]. The value was garbage, on hosts with
1649 32-bit int (Bug#8600).
1651 * lread.c (read_integer): Be more consistent with string-to-number.
1652 Use string_to_number to do the actual conversion; this avoids
1653 rounding errors and fixes some other screwups. Without this fix,
1654 for example, #x1fffffffffffffff was misread as -2305843009213693952.
1655 (digit_to_number): Move earlier, for benefit of read_integer.
1656 Return -1 if the digit is out of range for the base, -2 if it is
1657 not a digit in any supported base. (Bug#8602)
1659 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
1661 * dispnew.c (scrolling_window): Return 1 if we scrolled,
1662 to match comment at start of function. This also removes a
1663 GCC warning about overflow in a 32+64-bit port.
1665 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
1667 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
1668 Reported by Stefan Monnier in
1669 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
1670 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
1671 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
1673 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
1674 (EMACS_UINTPTR): Likewise, with uintptr_t.
1676 * lisp.h: Prefer 64-bit EMACS_INT if available.
1677 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
1678 on 32-bit hosts that have 64-bit int, so that they can access
1680 However, temporarily disable this change unless the temporary
1681 symbol WIDE_EMACS_INT is defined.
1683 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
1685 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
1686 This removes an assumption that EMACS_INT and long are the same
1687 width as pointers. The assumption is true for Emacs porting targets
1688 now, but we want to make other targets possible.
1689 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
1690 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
1691 In the rest of the code, change types of integers that hold casted
1692 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
1693 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
1694 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
1695 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
1696 No need to cast type when ORing.
1697 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
1698 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
1699 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
1700 assume EMACS_INT is the same width as char *.
1701 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
1702 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
1703 Remove no-longer-needed casts.
1704 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
1705 (xg_tool_bar_help_callback, xg_make_tool_item):
1706 Use EMACS_INTPTR to hold an integer
1707 that will be cast to void *; this can avoid a GCC warning
1708 if EMACS_INT is not the same width as void *.
1709 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
1710 * xdisp.c (display_echo_area_1, resize_mini_window_1):
1711 (current_message_1, set_message_1):
1712 Use a local to convert to proper width without a cast.
1713 * xmenu.c (dialog_selection_callback): Likewise.
1715 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
1716 Also, don't assume VALBITS / RAND_BITS is less than 5,
1717 and don't rely on undefined behavior when shifting a 1 left into
1719 * lisp.h (get_random): Change signature to match.
1721 * lread.c (hash_string): Use size_t, not int, for hash computation.
1722 Normally we prefer signed values; but hashing is special, because
1723 it's better to use unsigned division on hash table sizes so that
1724 the remainder is nonnegative. Also, size_t is the natural width
1725 for hashing into memory. The previous code used 'int', which doesn't
1726 retain enough info to hash well into very large tables.
1727 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
1729 * dbusbind.c: Don't possibly lose pointer info when converting.
1730 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
1731 Use XPNTR rather than XHASH, so that the high-order bits of
1732 the pointer aren't lost when converting through void *.
1734 * eval.c (Fautoload): Don't double-shift a pointer.
1736 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
1738 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
1740 * gnutls.c (DEF_GNUTLS_FN):
1741 * image.c (DEF_IMGLIB_FN): Make function pointers static.
1743 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
1745 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
1748 2011-05-05 Eli Zaretskii <eliz@gnu.org>
1750 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
1751 New version that can reserve upto 2GB of heap space.
1753 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
1755 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
1757 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
1759 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
1760 `gnutls_certificate_set_x509_key_file'.
1762 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
1764 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
1765 Update dependencies.
1767 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
1769 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
1770 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
1771 Remove unused parameter `fildes'.
1772 * process.c (read_process_output, send_process): Don't pass it.
1774 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
1776 Fix previous change: the library cache is defined in w32.c.
1777 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
1778 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
1780 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
1782 Implement dynamic loading of GnuTLS on Windows.
1784 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
1785 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
1786 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
1789 * gnutls.c (Qgnutls_dll): Define.
1790 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
1791 (gnutls_*): Declare function pointers.
1792 (init_gnutls_functions): New function to initialize function pointers.
1793 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
1794 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
1795 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
1796 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
1797 (emacs_gnutls_write, emacs_gnutls_read)
1798 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
1799 (Fgnutls_available_p): New function.
1800 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
1801 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
1802 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
1804 * image.c: Include w32.h.
1805 (Vimage_type_cache): Delete.
1806 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
1807 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
1808 (w32_delayed_load): Move to w32.c.
1810 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
1812 * w32.c (QCloaded_from, Vlibrary_cache): Define.
1813 (w32_delayed_load): Move from image.c. When loading a library, record
1814 its filename in the :loaded-from property of the library id.
1815 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
1816 Initialize and staticpro them.
1817 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
1819 * process.c: Include lisp.h before w32.h, not after.
1820 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
1821 instead of gnutls_record_check_pending.
1823 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
1825 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
1827 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
1828 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
1831 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
1833 * xterm.c (x_set_frame_alpha): Do not set property on anything
1834 else than FRAME_X_OUTER_WINDOW (Bug#8608).
1836 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
1838 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
1840 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
1842 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
1843 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
1844 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
1845 (gnutls_global_initialized, Qgnutls_bootprop_priority)
1846 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
1847 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
1848 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
1849 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
1850 (Qgnutls_bootprop_callbacks_verify): Make static.
1852 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
1854 * callproc.c: Indentation fixup.
1856 * sysdep.c (wait_for_termination_1): Make static.
1857 (wait_for_termination, interruptible_wait_for_termination):
1858 Move after wait_for_termination_1.
1860 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
1862 * sysdep.c (interruptible_wait_for_termination): New function
1863 which is like wait_for_termination, but allows keyboard
1866 * callproc.c (Fcall_process): Add (:file "file") as an option for
1868 (Fcall_process_region): Ditto.
1870 2011-04-30 Eli Zaretskii <eliz@gnu.org>
1872 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
1873 rather than `XVECTOR (FOO)->size'.
1875 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
1876 inttypes.h, as a gnulib replacement is used if it not available in
1879 2011-04-21 Eli Zaretskii <eliz@gnu.org>
1881 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
1882 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
1883 of MOST_POSITIVE_FIXNUM. (Bug#8528)
1885 * coding.c (coding_alloc_by_realloc): Error out if destination
1886 will grow beyond MOST_POSITIVE_FIXNUM.
1887 (decode_coding_emacs_mule): Abort if there isn't enough place in
1888 charbuf for the composition carryover bytes. Reserve an extra
1889 space for up to 2 characters produced in a loop.
1890 (decode_coding_iso_2022): Abort if there isn't enough place in
1891 charbuf for the composition carryover bytes.
1893 2011-04-21 Eli Zaretskii <eliz@gnu.org>
1895 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
1896 aborting when %lld or %lll format is passed.
1897 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
1898 %llo or %llx format is passed. (Bug#8545)
1900 * window.c (window_scroll_line_based): Use a marker instead of
1901 simple variables to record original value of point. (Bug#7952)
1903 * doprnt.c (doprnt): Fix the case where a multibyte sequence
1904 produced by %s or %c overflows available buffer space. (Bug#8545)
1906 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
1908 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
1909 (SIZE_MAX): Move defn after all includes, as they might #define it.
1911 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
1913 * w32.c (init_environment): Warn about defaulting HOME to C:\.
1915 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
1917 * keyboard.c (Qdelayed_warnings_hook): Define.
1918 (command_loop_1): Run `delayed-warnings-hook'
1919 if Vdelayed_warnings_list is non-nil.
1920 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
1921 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
1923 2011-04-28 Eli Zaretskii <eliz@gnu.org>
1925 * doprnt.c (doprnt): Don't return value smaller than the buffer
1926 size if the message was truncated. (Bug#8545).
1928 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
1930 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
1931 (Fx_window_property): #if-0 the whole functions, not just the bodies.
1933 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
1935 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
1937 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
1939 * makefile.w32-in: Update dependencies.
1941 2011-04-27 Eli Zaretskii <eliz@gnu.org>
1943 Improve `doprnt' and its usage. (Bug#8545)
1944 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
1945 `format_end'. Remove support for %l as a conversion specifier.
1946 Don't use xrealloc. Improve diagnostics when the %l size modifier
1947 is used. Update the commentary.
1949 * eval.c (verror): Simplify calculation of size_t.
1951 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
1954 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
1956 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
1959 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
1961 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
1962 This makes this file independent of the recent pseudovector change.
1964 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
1966 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
1968 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
1969 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
1970 Remove unused local.
1971 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
1973 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
1974 GCC 4.6.0 optimizes based on type-based alias analysis.
1975 For example, if b is of type struct buffer * and v of type struct
1976 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
1977 != &v->size, and therefore "v->size = 1; b->size = 2; return
1978 v->size;" must therefore return 1. This assumption is incorrect
1979 for Emacs, since it type-puns struct Lisp_Vector * with many other
1980 types. To fix this problem, this patch adds a new type struct
1981 vectorlike_header that documents the constraints on layout of vectors
1982 and pseudovectors, and helps optimizing compilers not get fooled
1983 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
1984 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
1985 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
1987 (XSETPVECTYPE): Rewrite in terms of new macro.
1988 (XSETPVECTYPESIZE): New macro, specifying both type and size.
1989 This is a bit clearer, and further avoids the possibility of
1990 undesirable aliasing.
1991 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
1992 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
1993 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
1994 since Lisp_Subr is a special case (no "next" field).
1995 (ASIZE): Now uses header.size rather than size.
1996 All previous uses of XVECTOR (foo)->size replaced to use this macro,
1997 to avoid the hassle of writing XVECTOR (foo)->header.size.
1998 (struct vectorlike_header): New type.
1999 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
2000 object, to help avoid aliasing.
2001 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
2002 (SUBRP): Likewise, since Lisp_Subr is a special case.
2003 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
2004 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
2005 (struct Lisp_Hash_Table): Combine first two members into a single
2006 struct vectorlike_header member. All uses of "size" and "next" members
2007 changed to be "header.size" and "header.next".
2008 * buffer.h (struct buffer): Likewise.
2009 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
2010 * frame.h (struct frame): Likewise.
2011 * process.h (struct Lisp_Process): Likewise.
2012 * termhooks.h (struct terminal): Likewise.
2013 * window.c (struct save_window_data, struct saved_window): Likewise.
2014 * window.h (struct window): Likewise.
2015 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
2016 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
2017 * buffer.c (init_buffer_once): Likewise.
2018 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
2020 * process.c (Fformat_network_address): Use local var for size,
2023 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
2025 Make the Lisp reader and string-to-float more consistent (Bug#8525)
2026 * data.c (atof): Remove decl; no longer used or needed.
2027 (digit_to_number): Move to lread.c.
2028 (Fstring_to_number): Use new string_to_number function, to be
2029 consistent with how the Lisp reader treats infinities and NaNs.
2030 Do not assume that floating-point numbers represent EMACS_INT
2031 without losing information; this is not true on most 64-bit hosts.
2032 Avoid double-rounding errors, by insisting on integers when
2033 parsing non-base-10 numbers, as the documentation specifies.
2034 * lisp.h (string_to_number): New decl, replacing ...
2035 (isfloat_string): Remove.
2036 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
2037 (read1): Do not accept +. and -. as integers; this
2038 appears to have been a coding error. Similarly, do not accept
2039 strings like +-1e0 as floating point numbers. Do not report
2040 overflow for integer overflows unless the base is not 10 which
2041 means we have no simple and reliable way to continue.
2042 Break out the floating-point parsing into a new
2043 function string_to_number, so that Fstring_to_number parses
2044 floating point numbers consistently with the Lisp reader.
2045 (digit_to_number): Move here from data.c. Make it static inline.
2046 (E_CHAR, EXP_INT): Remove, replacing with ...
2047 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
2048 (string_to_number): New function, replacing isfloat_string.
2049 This function checks for valid syntax and produces the resulting
2050 Lisp float number too. Rework it so that string-to-number
2051 no longer mishandles examples like "1.0e+". Use strtoumax,
2052 so that overflow for non-base-10 numbers is reported only when
2053 there's no portable and simple way to convert to floating point.
2055 * textprop.c (set_text_properties_1): Rewrite for clarity,
2056 and to avoid GCC warning about integer overflow.
2058 * intervals.h (struct interval): Use EMACS_INT for members
2059 where EMACS_UINT might cause problems. See
2060 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
2061 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
2062 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
2064 (offset_intervals): Tell GCC not to worry about length overflow
2065 when negating a negative length.
2067 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
2068 (overrun_check_free): Likewise.
2070 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
2071 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
2074 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
2075 (gnutls_make_error): Rename local to avoid shadowing.
2076 (gnutls_emacs_global_deinit): ifdef out; not used.
2077 (Fgnutls_boot): Use const for pointer to readonly storage.
2078 Comment out unused local. Fix pointer signedness problems.
2080 * lread.c (openp): Don't stuff size_t into an 'int'.
2081 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
2082 about possible signed overflow.
2084 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
2085 (GDK_KEY_g): Don't define if already defined.
2086 (xg_prepare_tooltip): Avoid pointer signedness problem.
2087 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
2089 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
2090 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
2092 * xfns.c (Fx_window_property): Simplify a bit,
2093 to make a bit faster and to avoid GCC 4.6.0 warning.
2094 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
2096 * fns.c (internal_equal): Don't assume size_t fits in int.
2098 * alloc.c (compact_small_strings): Tighten assertion a little.
2100 Replace pEd with more-general pI, and fix some printf arg casts.
2101 * lisp.h (pI): New macro, generalizing old pEd macro to other
2102 conversion specifiers. For example, use "...%"pI"d..." rather
2103 than "...%"pEd"...".
2104 (pEd): Remove. All uses replaced with similar uses of pI.
2105 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
2106 * alloc.c (check_pure_size): Don't overflow by converting size to int.
2107 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
2108 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
2109 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
2110 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
2111 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
2113 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
2114 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
2115 * print.c (safe_debug_print, print_object): Likewise.
2116 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
2118 Use pI instead of if-then-else-abort. Use %p to avoid casts,
2119 avoiding the 0 flag, which is not portable.
2120 * process.c (Fmake_network_process): Use pI to avoid cast.
2121 * region-cache.c (pp_cache): Likewise.
2122 * xdisp.c (decode_mode_spec): Likewise.
2123 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
2124 behavior on 64-bit hosts with printf arg.
2125 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
2126 (x_stop_queuing_selection_requests): Likewise.
2127 (x_get_window_property): Don't truncate byte count to an 'int'
2130 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
2131 here, since it parses constructs like leading '-' and spaces,
2132 which are not wanted; and it overflows with large numbers.
2133 Instead, simply match F[0-9]+, which is what is wanted anyway.
2135 * alloc.c: Remove unportable assumptions about struct layout.
2136 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
2137 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
2138 (allocate_vectorlike, make_pure_vector): Use the new macros,
2139 plus offsetof, to remove unportable assumptions about struct layout.
2140 These assumptions hold on all porting targets that I know of, but
2141 they are not guaranteed, they're easy to remove, and removing them
2142 makes further changes easier.
2144 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
2145 This doesn't fix a bug but makes the code clearer.
2146 (string_overrun_cookie): Now const. Use initializers that
2147 don't formally overflow signed char, to avoid warnings.
2148 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
2149 can cause Emacs to crash when string overrun checking is enabled.
2150 (allocate_buffer): Don't assume sizeof (struct buffer) is a
2151 multiple of sizeof (EMACS_INT); it need not be, if
2152 alignof(EMACS_INT) < sizeof (EMACS_INT).
2153 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
2155 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
2157 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
2159 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
2161 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
2162 supposed to be handshaking. (Bug#8556)
2163 Reported by Paul Eggert <eggert@cs.ucla.edu>.
2165 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
2167 * lisp.h (Qdebug): List symbol.
2168 * eval.c (Qdebug): Restore global linkage.
2169 * keyboard.c (debug-on-event): New variable.
2170 (handle_user_signal): Break into debugger when debug-on-event
2171 matches the current signal symbol.
2173 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
2175 * alloc.c (check_sblock, check_string_bytes)
2176 (check_string_free_list): Convert to standard C.
2178 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
2180 * w32.c (emacs_gnutls_push): Fix typo.
2182 2011-04-25 Eli Zaretskii <eliz@gnu.org>
2184 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
2185 "cast to pointer from integer of different size".
2187 Improve doprnt and its use in verror. (Bug#8545)
2188 * doprnt.c (doprnt): Document the set of format control sequences
2189 supported by the function. Use SAFE_ALLOCA instead of always
2192 * eval.c (verror): Don't limit the buffer size at size_max-1, that
2193 is one byte too soon. Don't use xrealloc; instead xfree and
2196 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
2198 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
2201 * gnutls.c: Renamed global_initialized to
2202 gnutls_global_initialized. Added internals for the
2203 :verify-hostname-error, :verify-error, and :verify-flags
2204 parameters of `gnutls-boot' and documented those parameters in the
2205 docstring. Start callback support.
2206 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
2207 unless a fatal error occured. Call gnutls_alert_send_appropriate
2208 on error. Return error code.
2209 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
2210 (emacs_gnutls_read): Likewise.
2211 (Fgnutls_boot): Return handshake error code.
2212 (emacs_gnutls_handle_error): New function.
2213 (wsaerror_to_errno): Likewise.
2215 * w32.h (emacs_gnutls_pull): Add prototype.
2216 (emacs_gnutls_push): Likewise.
2218 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
2219 (emacs_gnutls_push): Likewise.
2221 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
2223 * process.c (wait_reading_process_output): Check if GnuTLS
2224 buffered some data internally if no FDs are set for TLS
2227 * makefile.w32-in (OBJ2): Add gnutls.$(O).
2228 (LIBS): Link to USER_LIBS.
2229 ($(BLD)/gnutls.$(0)): New target.
2231 2011-04-24 Eli Zaretskii <eliz@gnu.org>
2233 * xdisp.c (handle_single_display_spec): Rename the
2234 display_replaced_before_p argument into display_replaced_p, to
2235 make it consistent with the commentary. Fix typos in the
2238 * textprop.c (syms_of_textprop): Remove dead code.
2239 (copy_text_properties): Delete obsolete commentary about an
2240 interface that was deleted long ago. Fix typos in the description
2243 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
2244 to changes in oldXMenu/XMenu.h from 2011-04-16.
2245 <menu_help_message, prev_menu_help_message>: Constify.
2246 (IT_menu_make_room): menu->help_text is now `const char **';
2249 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
2250 to changes in oldXMenu/XMenu.h from 2011-04-16.
2251 (struct XMenu): Declare `help_text' `const char **'.
2253 * xfaces.c <Qunspecified>: Make extern again.
2255 * syntax.c: Include sys/types.h before including regex.h, as
2258 * doc.c (get_doc_string): Improve the format passed to `error'.
2260 * doprnt.c (doprnt): Improve commentary.
2262 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
2264 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
2267 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
2268 changes in globals.h immediately force recompilation.
2269 (TAGS): Depend on $(CURDIR)/m/intel386.h and
2270 $(CURDIR)/s/ms-w32.h.
2271 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
2273 * character.c (Fchar_direction): Function deleted.
2274 (syms_of_character): Don't defsubr it.
2275 <char-direction-table>: Deleted.
2277 2011-04-23 Eli Zaretskii <eliz@gnu.org>
2279 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
2280 * doprnt.c: Include limits.h.
2281 (SIZE_MAX): New macro.
2282 (doprnt): Return a size_t value. 2nd arg is now size_t.
2283 Many local variables are now size_t instead of int or unsigned.
2284 Improve overflow protection. Support `l' modifier for integer
2285 conversions. Support %l conversion. Don't assume an EMACS_INT
2286 argument for integer conversions and for %c.
2288 * lisp.h (doprnt): Restore prototype.
2290 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
2293 * Makefile.in (base_obj): Add back doprnt.o.
2295 * deps.mk (doprnt.o): Add back prerequisites.
2296 (callint.o): Depend on character.h.
2298 * eval.c (internal_lisp_condition_case): Include the handler
2299 representation in the error message.
2300 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
2301 when breaking from the loop.
2303 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
2305 * callint.c (Fcall_interactively): When displaying error message
2306 about invalid control letter, pass the character's codepoint, not
2307 a pointer to its multibyte form. Improve display of the character
2308 in octal and display also its hex code.
2310 * character.c (char_string): Use %x to display the (unsigned)
2311 codepoint of an invalid character, to avoid displaying a bogus
2314 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
2315 `error', not SYMBOL_NAME itself.
2317 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
2318 character arguments to `error'.
2320 * charset.c (check_iso_charset_parameter): Fix incorrect argument
2321 to `error' in error message about FINAL_CHAR argument. Make sure
2322 FINAL_CHAR is a character, and use %c when it is passed as
2323 argument to `error'.
2325 2011-04-23 Eli Zaretskii <eliz@gnu.org>
2327 * s/ms-w32.h (localtime): Redirect to sys_localtime.
2329 * w32.c: Include <time.h>.
2330 (sys_localtime): New function.
2332 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
2334 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
2336 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
2338 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
2340 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
2343 2011-04-19 Eli Zaretskii <eliz@gnu.org>
2345 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
2346 gl_state.e_property when gl_state.object is Qt.
2348 * insdel.c (make_gap_larger): Remove limitation of buffer size
2351 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
2353 * xdisp.c (lookup_glyphless_char_display)
2354 (produce_glyphless_glyph): Handle cons cell entry in
2355 glyphless-char-display.
2356 (Vglyphless_char_display): Document it.
2358 * term.c (produce_glyphless_glyph): Handle cons cell entry in
2359 glyphless-char-display.
2361 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
2363 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
2365 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
2367 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
2368 definition for no-X builds.
2370 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
2372 Static checks with GCC 4.6.0 and non-default toolkits.
2374 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
2376 * process.c (keyboard_bit_set): Define only if SIGIO.
2377 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
2378 (send_process): Repair possible setjmp clobbering.
2380 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
2382 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
2384 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
2386 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
2387 Define only if needed.
2389 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
2390 by pacifying GCC about it. Maybe it's time to retire it?
2391 * xfaces.c (USG, __TIMEVAL__): Likewise.
2393 * dispextern.h (struct redisplay_interface): Rename param
2395 * termhooks.h (struct terminal): Likewise.
2396 * xterm.c (xembed_send_message): Likewise.
2398 * insdel.c (make_gap_smaller): Define only if
2399 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
2401 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
2404 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
2405 so that we aren't warned about unused symbols.
2407 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
2409 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
2411 * xfns.c (x_real_positions): Mark locals as initialized.
2413 * xmenu.c (xmenu_show): Don't use uninitialized vars.
2415 * xterm.c: Fix problems found by static analysis with other toolkits.
2416 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
2417 (x_dispatch_event): Declare static if USE_GTK, and
2418 define if USE_GTK || USE_X_TOOLKIT.
2419 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
2420 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
2421 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
2422 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
2424 * xmenu.c (menu_help_callback): Pointer type fixes.
2425 Use const pointers when pointing at readonly data. Avoid pointer
2427 (FALSE): Remove unused macro.
2428 (update_frame_menubar): Remove unused decl.
2430 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
2432 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
2433 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
2434 (single_menu_item): Rename local to avoid shadowing.
2436 * keyboard.c (make_lispy_event): Remove unused local var.
2438 * frame.c, frame.h (x_get_resource_string): Bring this back, but
2439 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
2441 * bitmaps: Change bitmaps from unsigned char back to the X11
2442 compatible char. Avoid the old compiler warnings about
2443 out-of-range initializers by using, for example, '\xab' rather
2446 * xgselect.c (xgselect_initialize): Check vs interface
2447 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
2449 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
2451 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
2452 to read-only memory.
2454 * fns.c (vector): Remove; this old hack is no longer needed.
2456 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
2458 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2460 * xrdb.c (x_load_resources): Omit unused local.
2462 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
2463 (x_window): Rename locals to avoid shadowing.
2464 (USG): Use the kludged USG macro, to pacify gcc.
2466 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
2467 (x_term_init): Remove local to avoid shadowing.
2469 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
2471 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
2472 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
2474 2011-04-16 Eli Zaretskii <eliz@gnu.org>
2476 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
2478 Fix regex.c, syntax.c and friends for buffers > 2GB.
2479 * syntax.h (struct gl_state_s): Declare character position members
2482 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
2484 * textprop.c (verify_interval_modification, interval_of):
2485 Declare arguments EMACS_INT.
2487 * intervals.c (adjust_intervals_for_insertion): Declare arguments
2490 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
2492 * indent.c (Fvertical_motion): Local variable it_start is now
2495 * regex.c (re_match, re_match_2, re_match_2_internal)
2496 (bcmp_translate, regcomp, regexec, print_double_string)
2497 (group_in_compile_stack, re_search, re_search_2, regex_compile)
2498 (re_compile_pattern, re_exec): Declare arguments and local
2499 variables `size_t' and `ssize_t' and return values `regoff_t', as
2501 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
2502 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
2503 <compile_stack_type>: `size' and `avail' are now `size_t'.
2505 * regex.h <regoff_t>: Use ssize_t, not int.
2506 (re_search, re_search_2, re_match, re_match_2): Arguments that
2507 specify buffer/string position and length are now ssize_t and
2508 size_t. Return type is regoff_t.
2510 2011-04-16 Ben Key <bkey76@gmail.com>
2512 * nsfont.m: Fixed bugs in ns_get_family and
2513 ns_descriptor_to_entity that were caused by using free to
2514 deallocate memory blocks that were allocated by xmalloc (via
2515 xstrdup). This caused Emacs to crash when compiled with
2516 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
2517 --enable-checking=xmallocoverrun). xfree is now used to
2518 deallocate these memory blocks.
2520 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
2522 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
2524 emacs_write: Accept and return EMACS_INT for sizes.
2525 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
2527 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
2528 Accept and return EMACS_INT.
2529 (emacs_gnutls_write): Return the number of bytes written on
2531 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
2532 (emacs_read, emacs_write): Remove check for negative size, as the
2533 Emacs source code has been audited now.
2534 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
2535 (emacs_read, emacs_write): Use it.
2536 * process.c (send_process): Adjust to the new signatures of
2537 emacs_write and emacs_gnutls_write. Do not attempt to store
2538 a byte offset into an 'int'; it might overflow.
2539 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
2541 * sound.c: Don't assume sizes fit in 'int'.
2542 (struct sound_device.period_size, alsa_period_size):
2543 Return EMACS_INT, not int.
2544 (struct sound_device.write, vox_write, alsa_write):
2545 Accept EMACS_INT, not int.
2546 (wav_play, au_play): Use EMACS_INT to store sizes and to
2547 record read return values.
2549 2011-04-15 Ben Key <bkey76@gmail.com>
2551 * keyboard.c (Qundefined): Don't declare static since it is used
2553 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
2554 static since they are used in nsfont.m.
2556 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
2558 * process.c (Qprocessp): Don't declare static.
2559 * lisp.h (Qprocessp): Declare again.
2561 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
2563 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
2565 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
2567 Improve C-level modularity by making more things 'static'.
2569 Don't publish debugger-only interfaces to other modules.
2570 * lisp.h (safe_debug_print, debug_output_compilation_hack):
2571 (verify_bytepos, count_markers): Move decls to the only modules
2573 * region-cache.h (pp_cache): Likewise.
2574 * window.h (check_all_windows): Likewise.
2575 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
2577 * sysdep.c (croak): Now static, if
2578 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
2579 * syssignal.h (croak): Declare only if not static.
2581 * alloc.c (refill_memory_reserve): Now static if
2582 !defined REL_ALLOC || defined SYSTEM_MALLOC.
2583 * lisp.h (refill_memory_reserve): Declare only if not static.
2585 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
2586 Define only if USE_LUCID.
2588 * xrdb.c (x_customization_string, x_rm_string): Now static.
2590 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
2591 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
2593 * xdisp.c (draw_row_with_mouse_face): Now static.
2594 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
2596 * window.h (check_all_windows): Mark externally visible.
2598 * window.c (window_deletion_count): Now static.
2600 * undo.c: Make symbols static if they're not exported.
2601 (last_undo_buffer, last_boundary_position, pending_boundary):
2604 * textprop.c (interval_insert_behind_hooks): Now static.
2605 (interval_insert_in_front_hooks): Likewise.
2607 * term.c: Make symbols static if they're not exported.
2608 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
2609 (max_frame_lines, tty_set_terminal_modes):
2610 (tty_reset_terminal_modes, tty_turn_off_highlight):
2611 (get_tty_terminal): Now static.
2612 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
2613 * termhooks.h (term_mouse_moveto): Do not declare if
2615 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
2616 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
2618 * sysdep.c: Make symbols static if they're not exported.
2619 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
2621 (sigprocmask_set, full_mask): Remove; unused.
2622 (wait_debugging): Mark as visible.
2623 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
2624 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
2626 * syntax.c (syntax_temp): Define only if !__GNUC__.
2628 * sound.c (current_sound_device, current_sound): Now static.
2630 * search.c (searchbufs, searchbuf_head): Now static.
2632 * scroll.c (scroll_cost): Remove; unused.
2633 * dispextern.h (scroll_cost): Remove decl.
2635 * region-cache.h (pp_cache): Mark as externally visible.
2637 * process.c: Make symbols static if they're not exported.
2638 (process_tick, update_tick, create_process, chan_process):
2639 (Vprocess_alist, proc_buffered_char, datagram_access):
2640 (fd_callback_data, send_process_frame, process_sent_to): Now static.
2641 (deactivate_process): Mark defn as static, as well as decl.
2642 * lisp.h (create_process): Remove decl.
2643 * process.h (chan_process, Vprocess_alist): Remove decls.
2645 * print.c: Make symbols static if they're not exported.
2646 (print_depth, new_backquote_output, being_printed, print_buffer):
2647 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
2648 (print_interval, print_number_index, initial_stderr_stream):
2650 * lisp.h (Fprinc): Remove decl.
2651 (debug_output_compilation_hack): Mark as externally visible.
2653 * sysdep.c (croak): Move decl from here to syssignal.h.
2654 * syssignal.h (croak): Put it here, so the API can be checked when
2655 'croak' is called from dissociate_if_controlling_tty.
2657 * minibuf.c: Make symbols static if they're not exported.
2658 (minibuf_save_list, choose_minibuf_frame): Now static.
2659 * lisp.h (choose_minibuf_frame): Remove decl.
2661 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
2663 * lread.c: Make symbols static if they're not exported.
2664 (read_objects, initial_obarray, oblookup_last_bucket_number):
2666 (make_symbol): Remove; unused.
2667 * lisp.h (initial_obarray, make_symbol): Remove decls.
2669 * keyboard.c: Make symbols static if they're not exported.
2670 (single_kboard, recent_keys_index, total_keys, recent_keys):
2671 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
2672 (this_single_command_key_start, echoing, last_auto_save):
2673 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
2674 (command_loop, echo_now, keyboard_init_hook, help_char_p):
2675 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
2676 (Vlispy_mouse_stem, double_click_count):
2678 (force_auto_save_soon): Define only if SIGDANGER.
2679 (ignore_mouse_drag_p): Now static if
2680 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
2681 (print_help): Remove; unused.
2682 (stop_character, last_timer_event): Mark as externally visible.
2683 * keyboard.h (ignore_mouse_drag_p): Declare only if
2684 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
2685 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
2686 * lisp.h (echoing): Remove decl.
2687 (force_auto_save_soon): Declare only if SIGDANGER.
2688 * xdisp.c (redisplay_window): Simplify code, to make it more
2689 obvious that ignore_mouse_drag_p is not accessed if !defined
2690 USE_GTK && !defined HAVE_NS.
2692 * intervals.c: Make symbols static if they're not exported.
2693 (merge_properties_sticky, merge_interval_right, delete_interval):
2695 * intervals.h (merge_interval_right, delete_interval): Remove decls.
2697 * insdel.c: Make symbols static if they're not exported.
2698 However, leave prepare_to_modify_buffer alone. It's never
2699 called from outside this function, but that appears to be a bug.
2700 (combine_after_change_list, combine_after_change_buffer):
2701 (adjust_after_replace, signal_before_change): Now static.
2702 (adjust_after_replace_noundo): Remove; unused.
2703 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
2704 (signal_before_change): Remove decls.
2706 * indent.c (val_compute_motion, val_vmotion): Now static.
2708 * image.c: Make symbols static if they're not exported.
2709 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
2711 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
2712 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
2714 * fringe.c (standard_bitmaps): Now static.
2715 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
2717 * frame.c: Make symbols static if they're not exported.
2718 (x_report_frame_params, make_terminal_frame): Now static.
2719 (get_frame_param): Now static, unless HAVE_NS.
2720 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
2721 (x_get_resource_string): Remove; not used.
2722 * frame.h (make_terminal_frame, x_report_frame_params):
2723 (x_get_resource_string); Remove decls.
2724 (x_fullscreen_adjust): Declare only if WINDOWSNT.
2725 * lisp.h (get_frame_param): Declare only if HAVE_NS.
2727 * font.c, fontset.c: Make symbols static if they're not exported.
2728 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
2729 (FACE_SUITABLE_FOR_CHAR_P): Use it.
2730 * font.c (font_close_object): Now static.
2731 * font.h (font_close_object): Remove.
2732 * fontset.c (FONTSET_OBJLIST): Remove.
2733 (free_realized_fontset) #if-0 the body, which does nothing.
2734 (face_suitable_for_char_p): #if-0, as it's never called.
2735 * fontset.h (face_suitable_for_char_p): Remove decl.
2736 * xfaces.c (face_at_string_position):
2737 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
2738 since 0 is always ASCII.
2740 * fns.c (weak_hash_tables): Now static.
2742 * fileio.c: Make symbols static if they're not exported.
2743 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
2744 (Vwrite_region_annotation_buffers): Now static.
2746 * eval.c: Make symbols static if they're not exported.
2747 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
2748 * lisp.h (backtrace_list): Remove decl.
2750 * emacs.c: Make symbols static if they're not exported.
2751 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
2752 (fatal_error_code, fatal_error_signal_hook, standard_args):
2754 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
2755 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
2756 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
2757 * lisp.h (fatal_error_signal_hook): Remove decl.
2758 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
2760 * editfns.c: Move a (normally-unused) function to its only use.
2761 * editfns.c, lisp.h (get_operating_system_release): Remove.
2762 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
2763 worth the hassle of breaking this out.
2765 * xterm.c: Make symbols static if they're not exported.
2766 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
2767 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
2768 (x_destroy_window, x_delete_display):
2770 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
2771 (x_mouse_leave): Remove; unused.
2772 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
2773 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
2774 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
2776 (x_mouse_leave): Declare only if WINDOWSNT.
2777 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
2778 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
2781 * ftxfont.c: Make symbols static if they're not exported.
2782 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
2784 * font.h (ftxfont_driver): Likewise.
2786 * xfns.c: Make symbols static if they're not exported.
2787 (x_last_font_name, x_display_info_for_name):
2788 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
2789 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
2790 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
2791 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
2792 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
2793 (last_show_tip_args): Now static.
2794 (xic_defaut_fontset, xic_create_fontsetname): Define only if
2795 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
2796 (x_screen_planes): Remove; unused.
2797 * dispextern.h (x_screen_planes): Remove decl.
2799 * dispnew.c: Make symbols static if they're not exported.
2800 * dispextern.h (redraw_garbaged_frames, scrolling):
2801 (increment_row_positions): Remove.
2802 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
2803 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
2805 (redraw_garbaged_frames): Remove; unused.
2807 * xfaces.c: Make symbols static if they're not exported.
2808 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
2810 * xterm.h (defined_color): Remove decls.
2811 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
2812 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
2813 (menu_face_changed_default, defined_color, free_realized_face):
2814 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
2815 (ascii_face_of_lisp_face): Remove; unused.
2817 * xdisp.c: Make symbols static if they're not exported.
2818 * dispextern.h (scratch_glyph_row, window_box_edges):
2819 (glyph_to_pixel_coords, set_cursor_from_row):
2820 (get_next_display_element, set_iterator_to_next):
2821 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
2822 (show_mouse_face): Remove decls
2823 * frame.h (message_buf_print): Likewise.
2824 * lisp.h (pop_message, set_message, check_point_in_composition):
2826 * xterm.h (set_vertical_scroll_bar): Likewise.
2827 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
2828 (message_buf_print, scratch_glyph_row, displayed_buffer):
2829 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
2830 (get_next_display_element, show_mouse_face, window_box_edges):
2831 (frame_to_window_pixel_xy, check_point_in_composition):
2832 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
2833 (glyph_to_pixel_coords): Remove; unused.
2835 * dired.c (file_name_completion): Now static.
2837 * dbusbind.c (xd_in_read_queued_messages): Now static.
2839 * lisp.h (circular_list_error, FOREACH): Remove; unused.
2840 * data.c (circular_list_error): Remove.
2842 * commands.h (last_point_position, last_point_position_buffer):
2843 (last_point_position_window): Remove decls.
2844 * keyboard.c: Make these variables static.
2846 * coding.h (coding, code_convert_region, encode_coding_gap):
2848 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
2849 (iso_code_class, detect_coding, code_convert_region): Now static.
2850 (encode_coding_gap): Remove; unused.
2852 * chartab.c (chartab_chars, chartab_bits): Now static.
2854 * charset.h (charset_iso_8859_1): Remove decl.
2855 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
2858 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
2859 * ccl.c (Vccl_program_table): Now static.
2860 (check_ccl_update): Remove; unused.
2862 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
2863 * category.h: ... from here.
2864 * category.c (check_category_table, set_category_set): Now static.
2866 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
2867 * lisp.h: Remove these decls.
2869 * buffer.c (buffer_count): Remove unused var.
2871 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
2872 so that it's not optimized away.
2873 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
2874 * dispextern.h (bidi_dump_cached_states): Remove, since it's
2875 exported only to the debugger.
2877 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
2878 * atimer.h (run_all_atimers): Remove; not exported.
2880 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
2881 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
2882 was inaccessible from Lisp.
2883 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
2884 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
2886 alloc.c: Import and export fewer symbols, and remove unused items.
2887 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
2889 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
2890 it's not optimized away by whole-program optimization.
2891 (message_enable_multibyte, free_misc): Remove.
2892 (catchlist, handlerlist, mark_backtrace):
2893 Declare only if BYTE_MARK_STACK.
2894 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
2895 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
2896 (message_enable_multibyte): Remove decl.
2897 (free_misc, interval_free_list, float_block, float_block_index):
2898 (n_float_blocks, float_free_list, cons_block, cons_block_index):
2899 (cons_free_list, last_marked_index):
2901 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
2902 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
2903 (mark_backtrace): Define only if BYTE_MARK_STACK.
2904 * xdisp.c (message_enable_multibyte): Now static.
2906 Declare Lisp_Object Q* variables to be 'static' if not exported.
2907 This makes it easier for human readers (and static analyzers)
2908 to see whether these variables are used from other modules.
2909 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
2910 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
2911 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
2912 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
2913 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
2914 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
2915 * xmenu.c, xselect.c:
2916 Declare Q* vars static if they are not used in other modules.
2917 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
2918 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
2919 Remove decls of unexported vars.
2920 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
2922 * lisp.h (DEFINE_FUNC): Make sname 'static'.
2924 Make Emacs functions such as Fatom 'static' by default.
2925 This makes it easier for human readers (and static analyzers)
2926 to see whether these functions can be called from other modules.
2927 DEFUN now defines a static function. To make the function external
2928 so that it can be used in other C modules, use the new macro DEFUE.
2929 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
2930 (Finit_image_library):
2931 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
2932 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
2933 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
2934 Remove decls, since these functions are now static.
2935 (Funintern, Fget_internal_run_time): New decls, since these functions
2936 were already external.
2938 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
2939 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
2940 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
2941 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
2942 * keyboard.c, keymap.c, lread.c:
2943 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
2944 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
2945 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
2946 Mark functions with DEFUE instead of DEFUN,
2947 if they are used in other modules.
2948 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
2949 decls for now-static functions.
2950 * buffer.h (Fdelete_overlay): Remove decl.
2951 * callproc.c (Fgetenv_internal): Mark as internal.
2952 * composite.c (Fremove_list_of_text_properties): Remove decl.
2953 (Fcomposition_get_gstring): New forward static decl.
2954 * composite.h (Fcomposite_get_gstring): Remove decl.
2955 * dired.c (Ffile_attributes): New forward static decl.
2956 * doc.c (Fdocumntation_property): New forward static decl.
2957 * eval.c (Ffetch_bytecode): New forward static decl.
2958 (Funintern): Remove extern decl; now in .h file where it belongs.
2959 * fileio.c (Fmake_symbolic_link): New forward static decl.
2960 * image.c (Finit_image_library): New forward static decl.
2961 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
2962 * intervals.h (Fprevious_property_change):
2963 (Fremove_list_of_text_properties): Remove decls.
2964 * keyboard.c (Fthis_command_keys): Remove decl.
2965 (Fcommand_execute): New forward static decl.
2966 * keymap.c (Flookup_key): New forward static decl.
2967 (Fcopy_keymap): Now static.
2968 * keymap.h (Flookup_key): Remove decl.
2969 * process.c (Fget_process): New forward static decl.
2970 (Fprocess_datagram_address): Mark as internal.
2971 * syntax.c (Fsyntax_table_p): New forward static decl.
2972 (skip_chars): Remove duplicate decl.
2973 * textprop.c (Fprevious_property_change): New forward static decl.
2974 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
2976 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
2977 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
2979 * editfns.c (Fformat): Remove unreachable code.
2981 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
2983 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
2986 2011-04-13 Eli Zaretskii <eliz@gnu.org>
2988 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
2989 when at ZV. (Bug#8487)
2991 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
2993 * charset.c (Fclear_charset_maps): Use xfree instead of free.
2995 * keyboard.c (parse_tool_bar_item): Likewise.
2996 * sound.c (sound_cleanup, alsa_close): Likewise.
2997 * termcap.c (tgetent): Likewise.
2998 * xfns.c (x_default_font_parameter): Likewise.
2999 * xsettings.c (read_and_apply_settings): Likewise.
3001 * alloc.c (overrun_check_malloc, overrun_check_realloc)
3002 (overrun_check_free): Protoize.
3004 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
3006 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
3007 since callers should never pass a negative size.
3008 Change the signature to match that of plain 'read' and 'write'; see
3009 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
3010 * lisp.h: Update prototypes of emacs_write and emacs_read.
3012 2011-04-11 Eli Zaretskii <eliz@gnu.org>
3014 * xdisp.c (redisplay_window): Don't try to determine the character
3015 position of the scroll margin if the window start point w->startp
3016 is outside the buffer's accessible region. (Bug#8468)
3018 2011-04-10 Eli Zaretskii <eliz@gnu.org>
3020 Fix write-region and its subroutines for buffers > 2GB.
3021 * fileio.c (a_write, e_write): Modify declaration of arguments and
3022 local variables to support buffers larger than 2GB.
3023 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
3025 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
3026 argument, local variables, and return value.
3028 * lisp.h: Update prototypes of emacs_write and emacs_read.
3030 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
3032 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
3034 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
3036 Fix more problems found by GCC 4.6.0's static checks.
3038 * xdisp.c (vmessage): Use a better test for character truncation.
3040 * charset.c (load_charset_map): <, not <=, for optimization,
3041 and to avoid potential problems with integer overflow.
3042 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
3043 * casetab.c (set_identity, shuffle): Likewise.
3044 * editfns.c (Fformat): Likewise.
3045 * syntax.c (skip_chars): Likewise.
3047 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
3048 This also lets GCC 4.6.0 generate slightly better loop code.
3050 * callint.c (Fcall_interactively): <, not <=, for optimization.
3051 (Fcall_interactively): Count the number of arguments produced,
3052 not the number of arguments given. This is simpler and lets GCC
3053 4.6.0 generate slightly better code.
3055 * ftfont.c: Distingish more carefully between FcChar8 and char.
3056 The previous code passed unsigned char * to a functions like
3057 strlen and xstrcasecmp that expect char *, which does not
3058 conform to the C standard.
3059 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
3060 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
3061 char * when the C standard requires it.
3063 * keyboard.c (read_char): Remove unused var.
3065 * eval.c: Port to Windows vsnprintf (Bug#8435).
3067 (SIZE_MAX): Define if the headers do not.
3068 (verror): Do not give up if vsnprintf returns a negative count.
3069 Instead, grow the buffer. This ports to Windows vsnprintf, which
3070 does not conform to C99. Problem reported by Eli Zaretskii.
3071 Also, simplify the allocation scheme, by avoiding the need for
3072 calling realloc, and removing the ALLOCATED variable.
3074 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
3076 Remove invocations of doprnt, as Emacs now uses vsnprintf.
3077 But keep the doprint source code for now, as we might revamp it
3078 and use it again (Bug#8435).
3079 * lisp.h (doprnt): Remove.
3080 * Makefile.in (base_obj): Remove doprnt.o.
3081 * deps.mk (doprnt.o): Remove.
3083 error: Print 32- and 64-bit integers portably (Bug#8435).
3084 Without this change, on typical 64-bit hosts error ("...%d...", N)
3085 was used to print both 32- and 64-bit integers N, which relied on
3087 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
3089 * lisp.h (error, verror): Mark as printf-like functions.
3090 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
3091 Report overflow in size calculations when allocating printf buffer.
3092 Do not truncate output string at its first null byte.
3093 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
3094 Truncate the output at a character boundary, since vsnprintf does not
3096 * charset.c (check_iso_charset_parameter): Convert internal
3097 character to string before calling 'error', since %c now has the
3099 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
3100 overflow when computing char to be passed to 'error'. Do not
3101 pass Lisp_Object to 'error'; pass the integer instead.
3102 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
3103 formatted with plain %d.
3105 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
3107 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
3109 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
3111 * xterm.c (x_catch_errors): Remove duplicate declaration.
3113 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
3115 * xdisp.c, lisp.h (message_nolog): Remove; unused.
3117 2011-04-10 Jim Meyering <meyering@redhat.com>
3119 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
3120 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
3121 return ssize_t not "int", and use size_t as the buffer length.
3122 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
3123 * gnutls.h: Update declarations.
3124 * process.c (read_process_output): Use ssize_t, to match.
3125 (send_process): Likewise.
3127 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
3129 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
3131 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
3133 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
3134 Use unsigned char, to match FcChar8 type definition.
3136 * xterm.c (handle_one_xevent):
3137 * xmenu.c (create_and_show_popup_menu):
3138 * xselect.c (x_decline_selection_request)
3139 (x_reply_selection_request): Avoid type-punned deref of X events.
3141 2011-04-09 Eli Zaretskii <eliz@gnu.org>
3143 Fix some uses of `int' instead of EMACS_INT.
3144 * search.c (string_match_1, fast_string_match)
3145 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
3146 (scan_buffer, find_next_newline_no_quit)
3147 (find_before_next_newline, search_command, Freplace_match)
3148 (Fmatch_data): Make some `int' variables be EMACS_INT.
3150 * xdisp.c (display_count_lines): 3rd argument and return value now
3151 EMACS_INT. All callers changed.
3152 (pint2hrstr): Last argument is now EMACS_INT.
3154 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
3155 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
3156 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
3157 (decode_coding_utf_16, decode_coding_emacs_mule)
3158 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
3159 (decode_coding_ccl, decode_coding_charset)
3160 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
3161 (decode_coding_iso_2022, decode_coding_emacs_mule)
3162 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
3163 <char_offset, last_offset>: Declare EMACS_INT.
3164 (encode_coding_utf_8, encode_coding_utf_16)
3165 (encode_coding_emacs_mule, encode_invocation_designation)
3166 (encode_designation_at_bol, encode_coding_iso_2022)
3167 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
3168 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
3170 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
3171 (encode_invocation_designation): Last argument P_NCHARS is now
3173 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
3174 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
3176 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
3179 * ccl.c (Fccl_execute_on_string): Declare some variables
3182 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
3184 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
3186 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
3188 * process.c (Fformat_network_address): Doc fix.
3190 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
3192 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
3194 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
3196 * keyboard.c (read_char): Call Lisp function help-form-show,
3197 instead of using internal_with_output_to_temp_buffer.
3198 (Qhelp_form_show): New var.
3199 (syms_of_keyboard): Use DEFSYM macro.
3201 * print.c (internal_with_output_to_temp_buffer): Function deleted.
3203 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
3205 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
3207 * process.c (Flist_processes): Remove to Lisp.
3208 (list_processes_1): Delete.
3210 2011-04-06 Eli Zaretskii <eliz@gnu.org>
3212 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
3214 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
3216 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
3218 Fix more problems found by GCC 4.6.0's static checks.
3220 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
3222 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
3224 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
3226 * xdisp.c (vmessage): Mark as a printf-like function.
3228 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
3230 * sound.c (sound_warning): Don't crash if arg contains a printf format.
3232 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
3233 printf-like functions.
3234 (tiff_load): Add casts to remove these marks before passing them
3235 to system-supplied API.
3237 * eval.c (Fsignal): Remove excess argument to 'fatal'.
3239 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
3240 This avoids several warnings with gcc -Wstrict-overflow.
3241 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
3242 directly, rather than having caller test rule sign. This avoids
3243 some unnecessary tests.
3244 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
3245 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
3246 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
3248 * xfont.c (xfont_text_extents): Remove var that was set but not used.
3249 (xfont_open): Avoid unnecessary tests.
3251 * composite.c (composition_gstring_put_cache): Use unsigned integer.
3253 * composite.h, composite.c (composition_gstring_put_cache):
3254 Use EMACS_INT, not int, for length.
3256 * composite.h (COMPOSITION_DECODE_REFS): New macro,
3257 breaking out part of COMPOSITION_DECODE_RULE.
3258 (COMPOSITION_DECODE_RULE): Use it.
3259 * composite.c (get_composition_id): Remove unused local vars,
3260 by using the new macro.
3262 * textprop.c (set_text_properties_1): Change while to do-while,
3263 since the condition is always true at first.
3265 * intervals.c (graft_intervals_into_buffer): Mark var as used.
3266 (interval_deletion_adjustment): Return unsigned value.
3269 * process.c (list_processes_1, create_pty, read_process_output):
3270 (exec_sentinel): Remove vars that were set but not used.
3271 (create_pty): Remove unnecessary "volatile"s.
3272 (Fnetwork_interface_info): Avoid possibility of int overflow.
3273 (read_process_output): Do adaptive read buffering even if carryover.
3274 (read_process_output): Simplify nbytes computation if buffered.
3276 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
3278 * syntax.c (scan_words): Remove var that was set but not used.
3279 (update_syntax_table): Use unsigned instead of int.
3281 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3282 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
3283 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
3285 * print.c (print_error_message): Avoid int overflow.
3287 * font.c (font_list_entities): Redo for clarity,
3288 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
3290 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
3291 (font_score): Avoid potential overflow in diff calculation.
3293 * fns.c (substring_both): Remove var that is set but not used.
3294 (sxhash): Redo loop for clarity and to avoid wraparound warning.
3296 * eval.c (funcall_lambda): Rename local to avoid shadowing.
3298 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
3299 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
3300 can always succeed if overflow has undefined behavior.
3302 * search.c (boyer_moore, wordify): Remove vars set but not used.
3303 (wordify): Omit three unnecessary tests.
3305 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
3306 All callers changed. This avoids the need for an unused var.
3308 * casefiddle.c (casify_region): Remove var that is set but not used.
3310 * dired.c (file_name_completion): Remove var that is set but not used.
3312 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
3314 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
3315 (Finsert_file_contents): Remove unnecessary code checking fd.
3317 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
3318 Check for integer overflow on size calculations.
3320 * buffer.c (Fprevious_overlay_change): Remove var that is set
3323 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
3324 Remove vars that are set but not used.
3325 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
3326 (timer_check_2): Mark vars as initialized.
3328 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
3330 * image.c (lookup_image): Remove var that is set but not used.
3331 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
3333 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
3334 that are set but not used.
3336 * xfns.c (make_invisible_cursor): Don't return garbage
3337 if XCreateBitmapFromData fails (Bug#8410).
3339 * xselect.c (x_get_local_selection, x_handle_property_notify):
3340 Remove vars that are set but not used.
3342 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
3343 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
3345 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
3346 Remove var that is set but not used.
3347 (scroll_bar_windows_size): Now size_t, not int.
3348 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
3351 * xfaces.c (realize_named_face): Remove vars that are set but not used.
3352 (map_tty_color) [!defined MSDOS]: Likewise.
3354 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
3356 * coding.c: Remove vars that are set but not used.
3357 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
3358 All callers changed.
3359 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
3360 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
3361 (decode_coding_charset): Remove vars that are set but not used.
3363 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
3364 that is set but not used.
3366 * print.c (print_object): Remove var that is set but not used.
3368 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
3369 The gnulib version avoids calling malloc in the usual case,
3370 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
3371 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
3372 * filelock.c (current_lock_owner): Likewise.
3373 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
3374 * sysdep.c: Include allocator.h, careadlinkat.h.
3375 (emacs_no_realloc_allocator): New static constant.
3376 (emacs_readlink): New function.
3377 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
3378 ../lib/careadlinkat.h.
3380 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
3382 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
3383 first non-nil return value).
3385 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
3387 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
3388 if not defined (Bug#8403).
3390 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
3392 * xdisp.c (display_count_lines): Remove parameter `start',
3393 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
3394 (get_char_face_and_encoding): Remove parameter `multibyte_p',
3395 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
3396 (fill_stretch_glyph_string): Remove parameters `row' and `area',
3397 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
3398 and thereabouts. All callers changed.
3399 (get_per_char_metric): Remove parameter `f', unused since
3400 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
3402 2011-04-02 Jim Meyering <meyering@redhat.com>
3404 do not dereference NULL upon failed strdup
3405 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
3406 (ns_get_family): Likewise.
3408 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
3410 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
3412 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
3414 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
3417 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
3419 Add lexical binding.
3421 * window.c (Ftemp_output_buffer_show): New fun.
3422 (Fsave_window_excursion):
3423 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
3425 * lread.c (lisp_file_lexically_bound_p): New function.
3426 (Fload): Bind Qlexical_binding.
3427 (readevalloop): Remove `evalfun' arg.
3428 Bind Qinternal_interpreter_environment.
3429 (Feval_buffer): Bind Qlexical_binding.
3430 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
3432 (syms_of_lread): Declare `lexical-binding'.
3434 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
3436 * keyboard.c (eval_dyn): New fun.
3437 (menu_item_eval_property): Use it.
3439 * image.c (parse_image_spec): Use Ffunctionp.
3441 * fns.c (concat, mapcar1): Accept byte-code-functions.
3443 * eval.c (Fsetq): Handle lexical vars.
3444 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
3445 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
3446 (FletX, Flet): Obey lexical binding.
3447 (Fcommandp): Handle closures.
3448 (Feval): New `lexical' arg.
3449 (eval_sub): New function extracted from Feval. Use it almost
3450 everywhere where Feval was used. Look up vars in lexical env.
3452 (Ffunctionp): Move from subr.el.
3453 (Ffuncall): Handle closures.
3454 (apply_lambda): Remove `eval_flags'.
3455 (funcall_lambda): Handle closures and new byte-code-functions.
3456 (Fspecial_variable_p): New function.
3457 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
3458 but without exporting it to Lisp.
3460 * doc.c (Fdocumentation, store_function_docstring):
3461 * data.c (Finteractive_form): Handle closures.
3463 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
3466 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
3468 (exec_byte_code): New function extracted from Fbyte_code to handle new
3469 calling convention for byte-code-functions. Add new byte-codes.
3471 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
3473 * alloc.c (Fmake_symbol): Init new `declared_special' field.
3475 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
3477 * xdisp.c (redisplay_internal): Fix prototype.
3479 2011-03-31 Eli Zaretskii <eliz@gnu.org>
3481 * xdisp.c (SCROLL_LIMIT): New macro.
3482 (try_scrolling): Use it when setting scroll_limit.
3483 Limit scrolling to 100 screen lines.
3484 (redisplay_window): Even when falling back on "recentering",
3485 position point in the window according to scroll-conservatively,
3486 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
3488 (try_scrolling): When point is above the window, allow searching
3489 as far as scroll_max, or one screenful, to compute vertical
3490 distance from PT to the scroll margin position. This prevents
3491 try_scrolling from unnecessarily failing when
3492 scroll-conservatively is set to a value slightly larger than the
3493 window height. Clean up the case of PT below the margin at bottom
3494 of window: scroll_max can no longer be INT_MAX. When aggressive
3495 scrolling is in use, don't let point enter the opposite scroll
3496 margin as result of the scroll.
3497 (syms_of_xdisp) <scroll-conservatively>: Document the
3498 threshold of 100 lines for never-recentering scrolling.
3500 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
3502 * dispextern.h (move_it_by_lines):
3503 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
3504 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
3505 (message_log_check_duplicate): Remove parameters `prev_bol' and
3506 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
3507 (redisplay_internal): Remove parameter `preserve_echo_area',
3508 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
3510 * indent.c (Fvertical_motion):
3511 * window.c (window_scroll_pixel_based, Frecenter):
3512 Don't pass `need_y_p' to `move_it_by_lines'.
3514 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
3516 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
3517 steal a few bits to be more compact.
3518 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
3519 Remove unneeded casts.
3521 * bytecode.c (Fbyte_code): CAR and CDR can GC.
3523 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
3525 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
3526 binding" message (bug#7967).
3528 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
3530 Fix more problems found by GCC 4.6.0's static checks.
3532 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
3533 Remove unused local var.
3535 * editfns.c (Fmessage_box): Remove unused local var.
3537 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
3538 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3539 Omit unused local vars.
3540 * window.c (shrink_windows): Omit unused local var.
3541 * menu.c (digest_single_submenu): Omit unused local var.
3542 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
3543 Omit unused local var.
3545 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
3546 Don't assume string length fits in int.
3547 (keyremap_step, read_key_sequence): Use size_t for sizes.
3548 (read_key_sequence): Don't check last_real_key_start redundantly.
3550 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
3551 instead of alloca (Bug#8344).
3553 * eval.c (Fbacktrace): Don't assume nargs fits in int.
3554 (Fbacktrace_frame): Don't assume nframes fits in int.
3556 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
3558 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
3561 * term.c (produce_glyphless_glyph): Remove unnecessary test.
3563 * cm.c (calccost): Turn while-do into do-while, for clarity.
3565 * keyboard.c (syms_of_keyboard): Use the same style as later
3566 in this function when indexing through an array. This also
3567 works around GCC bug 48267.
3569 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
3571 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
3573 * chartab.c (sub_char_table_ref_and_range): Redo for slight
3574 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
3576 * keyboard.c, keyboard.h (num_input_events): Now size_t.
3577 This avoids undefined behavior on integer overflow, and is a bit
3578 more convenient anyway since it is compared to a size_t variable.
3580 Variadic C functions now count arguments with size_t, not int.
3581 This avoids an unnecessary limitation on 64-bit machines, which
3582 caused (substring ...) to crash on large vectors (Bug#8344).
3583 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
3584 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
3585 All variadic functions and their callers changed accordingly.
3586 (struct gcpro.nvars): Now size_t, not int. All uses changed.
3587 * data.c (arith_driver, float_arith_driver): Likewise.
3588 * editfns.c (general_insert_function): Likewise.
3589 * eval.c (struct backtrace.nargs, interactive_p)
3590 (internal_condition_case_n, run_hook_with_args, apply_lambda)
3591 (funcall_lambda, mark_backtrace): Likewise.
3592 * fns.c (concat): Likewise.
3593 * frame.c (x_set_frame_parameters): Likewise.
3594 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
3595 0 if not found, not -1. All callers changed.
3597 * alloc.c (garbage_collect): Don't assume stack size fits in int.
3598 (stack_copy_size): Now size_t, not int.
3599 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
3601 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
3603 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
3604 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
3605 All callers changed.
3607 * lisp.h (multibyte_char_to_unibyte):
3608 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
3609 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
3610 * character.h (CHAR_TO_BYTE8):
3611 * cmds.c (internal_self_insert):
3612 * editfns.c (general_insert_function):
3613 * keymap.c (push_key_description):
3614 * search.c (Freplace_match):
3615 * xdisp.c (message_dolog, set_message_1): All callers changed.
3617 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
3619 * keyboard.c (safe_run_hook_funcall): New function.
3620 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
3621 don't set the hook to nil, but remove the offending function instead.
3622 (Qcommand_hook_internal): Remove, unused.
3623 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
3624 Vcommand_hook_internal.
3626 * eval.c (enum run_hooks_condition): Remove.
3627 (funcall_nil, funcall_not): New functions.
3628 (run_hook_with_args): Call each function through a `funcall' argument.
3629 Remove `cond' argument, now redundant.
3630 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
3631 (Frun_hook_with_args_until_failure): Adjust accordingly.
3632 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
3634 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
3636 * dispextern.h (string_buffer_position): Remove declaration.
3638 * print.c (strout): Remove parameter `multibyte', unused since
3639 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
3641 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
3642 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
3643 All callers changed.
3645 * w32.c (_wsa_errlist): Use braces for struct initializers.
3647 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
3648 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
3649 All callers changed.
3650 (string_buffer_position): Likewise. Also, make static (it's never
3651 used outside xdisp.c).
3652 (cursor_row_p): Remove parameter `w', unused since
3653 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
3654 (decode_mode_spec): Remove parameter `precision', introduced during
3655 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
3656 All callers changed.
3658 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
3660 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
3662 2011-03-27 Anders Lindgren <andlind@gmail.com>
3664 * nsterm.m (ns_menu_bar_is_hidden): New variable.
3665 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
3666 (ns_update_auto_hide_menu_bar): New functions.
3667 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
3668 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
3669 ns_constrain_all_frames.
3670 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
3671 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
3673 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
3675 * nsmenu.m (runDialogAt): Remove argument to timer_check.
3677 2011-03-27 Glenn Morris <rgm@gnu.org>
3679 * syssignal.h: Replace RETSIGTYPE with void.
3680 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
3681 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
3682 Replace SIGTYPE with void everywhere.
3683 * s/usg5-4-common.h (SIGTYPE): Remove definition.
3684 * s/template.h (SIGTYPE): Remove commented out definition.
3686 2011-03-26 Eli Zaretskii <eliz@gnu.org>
3688 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
3689 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
3691 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
3693 * w32.c (read_unc_volume): Use parameter `henum', instead of
3694 global variable `wget_enum_handle'.
3696 * keymap.c (describe_vector): Remove parameters `indices' and
3697 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
3698 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
3700 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
3702 * keyboard.c (timer_check): Remove parameter `do_it_now',
3703 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
3704 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
3705 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
3707 * keyboard.c (read_char):
3708 * w32menu.c (w32_menu_display_help):
3709 * xmenu.c (show_help_event, menu_help_callback):
3710 Adjust calls to `show_help_echo'.
3712 * gtkutil.c (xg_maybe_add_timer):
3713 * keyboard.c (readable_events):
3714 * process.c (wait_reading_process_output):
3715 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
3717 * insdel.c (adjust_markers_gap_motion):
3718 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
3719 (gap_left, gap_right): Don't call it.
3721 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
3723 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
3724 incurred during fontification.
3726 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
3728 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
3729 (DEFVAR_PER_BUFFER): Don't pass it.
3731 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
3732 (scrolling_window): Don't pass it.
3734 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
3736 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
3738 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
3740 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
3741 of variables specific to SELinux and computation of `encoded_absname'.
3743 * image.c (XPutPixel): Remove unused variable `height'.
3745 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
3747 * unexw32.c (get_section_info): Remove unused variable `section'.
3749 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
3750 (system_process_attributes): Remove unused variable `sess'.
3751 (sys_read): Remove unused variable `err'.
3753 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
3754 (w32_wnd_proc): Remove unused variable `isdead'.
3755 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
3756 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
3757 (x_create_tip_frame): Remove unused variable `tem'.
3759 * w32inevt.c (w32_console_read_socket):
3760 Remove unused variable `no_events'.
3762 * w32term.c (x_draw_composite_glyph_string_foreground):
3763 Remove unused variable `width'.
3765 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
3767 * w32term.c (x_set_glyph_string_clipping):
3768 Don't pass uninitialized region to CombineRgn.
3770 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
3772 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
3773 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
3774 (Fx_close_connection): Remove unused variable `i'.
3776 * w32font.c (w32font_draw): Return number of glyphs.
3777 (w32font_open_internal): Remove unused variable `i'.
3778 (w32font_driver): Add missing initializer.
3780 * w32menu.c (utf8to16): Remove unused variable `utf16'.
3781 (fill_in_menu): Remove unused variable `items_added'.
3783 * w32term.c (last_mouse_press_frame): Remove static global variable.
3784 (w32_clip_to_row): Remove unused variable `f'.
3785 (x_delete_terminal): Remove unused variable `i'.
3787 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
3788 (NOTHING): Remove unused static global variable.
3789 (uniscribe_check_otf): Remove unused variable `table'.
3790 (uniscribe_font_driver): Add missing initializers.
3792 2011-03-23 Julien Danjou <julien@danjou.info>
3794 * term.c (Fsuspend_tty, Fresume_tty):
3795 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
3796 * window.c (temp_output_buffer_show):
3797 * insdel.c (signal_before_change):
3798 * frame.c (Fhandle_switch_frame):
3799 * fileio.c (Fdo_auto_save):
3800 * emacs.c (Fkill_emacs):
3801 * editfns.c (save_excursion_restore):
3802 * cmds.c (internal_self_insert):
3803 * callint.c (Fcall_interactively):
3804 * buffer.c (Fkill_all_local_variables):
3805 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
3807 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
3808 unconditionnaly since it does the check itself.
3810 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
3812 Fix more problems found by GCC 4.5.2's static checks.
3814 * coding.c (encode_coding_raw_text): Avoid unnecessary test
3815 the first time through the loop, since we know p0 < p1 then.
3816 This also avoids a gcc -Wstrict-overflow warning.
3818 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
3819 leading to a memory leak, possible in functions like
3820 load_charset_map_from_file that can allocate an unbounded number
3821 of objects (Bug#8318).
3823 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
3824 that could (at least in theory) be that large.
3826 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
3827 This is less likely to overflow, and avoids undefined behavior if
3828 overflow does occur. All callers changed. Use strtoul to scan
3829 for the unsigned long integer.
3830 (pint2hrstr): Simplify and tune code slightly.
3831 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
3833 * scroll.c (do_scrolling): Work around GCC bug 48228.
3834 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
3836 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
3837 This also avoids a warning with gcc -Wstrict-overflow.
3838 (validate_x_resource_name): Simplify count usage.
3839 This also avoids a warning with gcc -Wstrict-overflow.
3841 * fileio.c (Fcopy_file): Report error if fchown or fchmod
3844 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
3846 * process.c (Fmake_network_process): Use socklen_t, not int,
3847 where POSIX says socklen_t is required in portable programs.
3848 This fixes a porting bug on hosts like 64-bit HP-UX, where
3849 socklen_t is wider than int (Bug#8277).
3850 (Fmake_network_process, server_accept_connection):
3851 (wait_reading_process_output, read_process_output):
3854 * process.c: Rename or move locals to avoid shadowing.
3855 (list_processes_1, Fmake_network_process):
3856 (read_process_output_error_handler, exec_sentinel_error_handler):
3857 Rename or move locals.
3858 (Fmake_network_process): Define label "retry_connect" only if needed.
3859 (Fnetwork_interface_info): Fix pointer signedness.
3860 (process_send_signal): Add cast to avoid pointer signedness problem.
3861 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
3862 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
3864 Make tparam.h and terminfo.c consistent.
3865 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
3866 Include tparam.h instead, since it declares them.
3867 * cm.h (PC): Remove extern decl; tparam.h now does this.
3868 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
3869 * terminfo.c: Include tparam.h, to check interfaces.
3870 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
3871 (tparam): Adjust signature to match interface in tparam.h;
3872 this removes some undefined behavior. Check that outstring and len
3873 are zero, which they always are with Emacs.
3874 * tparam.h (PC, BC, UP): New extern decls.
3876 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
3877 (xftfont_open): Rename locals to avoid shadowing.
3879 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
3880 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
3881 (OTF_TAG_SYM): Omit macro if not needed.
3882 (ftfont_list): Remove unused local.
3883 (get_adstyle_property, ftfont_pattern_entity):
3884 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
3885 Rename locals to avoid shadowing.
3887 * xfont.c (xfont_list_family): Mark var as initialized.
3889 * xml.c (make_dom): Now static.
3891 * composite.c (composition_compute_stop_pos): Rename local to
3893 (composition_reseat_it): Remove unused locals.
3894 (find_automatic_composition, composition_adjust_point): Likewise.
3895 (composition_update_it): Mark var as initialized.
3896 (find_automatic_composition): Mark vars as initialized,
3897 with a FIXME (Bug#8290).
3899 character.h: Rename locals to avoid shadowing.
3900 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
3901 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
3902 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
3903 (BUF_DEC_POS): Be more systematic about renaming local temporaries
3906 * textprop.c (property_change_between_p): Remove; unused.
3908 * intervals.c (interval_start_pos): Now static.
3910 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
3912 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
3913 Rename locals to avoid shadowing.
3915 * sound.c (wav_play, au_play, Fplay_sound_internal):
3916 Fix pointer signedness.
3917 (alsa_choose_format): Remove unused local var.
3918 (wav_play): Initialize a variable to 0, to prevent undefined
3919 behavior (Bug#8278).
3921 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
3923 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
3925 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
3926 clobbering (Bug#8298).
3927 * sysdep.c (sys_subshell): Likewise.
3928 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
3930 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
3931 This should get cleaned up, so that child_setup has the
3932 same signature on all platforms.
3934 * callproc.c (call_process_cleanup): Now static.
3935 (relocate_fd): Rename locals to avoid shadowing.
3937 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
3939 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
3940 not to be necessary, and produces flickering.
3942 2011-03-20 Glenn Morris <rgm@gnu.org>
3944 * config.in: Remove file.
3946 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
3948 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
3949 are now in src/globals.h.
3950 (syms_of_minibuf): Remove spurious & from previous change.
3952 2011-03-20 Leo <sdl.web@gmail.com>
3954 * minibuf.c (completing-read-function): New variable.
3955 (completing-read-default): Rename from completing-read.
3956 (completing-read): Call completing-read-function.
3958 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
3960 * xfaces.c (Fx_load_color_file):
3961 Read color file from absolute filename (bug#8250).
3963 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
3965 * makefile.w32-in: Update dependencies.
3967 2011-03-17 Eli Zaretskii <eliz@gnu.org>
3969 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
3971 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
3973 Fix more problems found by GCC 4.5.2's static checks.
3975 * process.c (make_serial_process_unwind, send_process_trap):
3976 (sigchld_handler): Now static.
3978 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
3979 That way, the code declares only the vars that it needs.
3980 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
3981 * s/cygwin.h (PTY_ITERATION): Likewise.
3982 * s/darwin.h (PTY_ITERATION): Likewise.
3983 * s/gnu-linux.h (PTY_ITERATION): Likewise.
3985 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
3986 * process.c (allocate_pty): Don't declare stb unless it's needed.
3988 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
3989 (CONSTANTLIM): Remove; unused.
3990 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
3991 Define only if needed.
3993 * unexelf.c (unexec): Name an expression,
3994 to avoid gcc -Wbad-function-cast warning.
3995 Use a different way to cause a compilation error if anyone uses
3996 n rather than nn, a way that does not involve shadowing.
3997 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
3999 * deps.mk (unexalpha.o): Remove; unused.
4001 New file unexec.h, the (simple) interface for unexec (Bug#8267).
4002 * unexec.h: New file.
4003 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
4004 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
4006 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
4007 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
4008 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
4009 Change as necessary to match prototype in unexec.h.
4011 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
4013 (back_comment, skip_chars): Mark vars as initialized.
4015 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
4016 Rename locals to avoid shadowing.
4018 * lread.c (read1): Rewrite so as not to use empty "else".
4019 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
4021 * print.c (Fredirect_debugging_output): Fix pointer signedess.
4023 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
4024 warning when compiling print.c.
4026 * font.c (font_unparse_fcname): Abort in an "impossible" situation
4027 instead of using an uninitialized var.
4028 (font_sort_entities): Mark var as initialized.
4030 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
4032 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
4033 pointers to constants.
4034 (font_parse_fcname): Remove unused vars.
4035 (font_delete_unmatched): Now static.
4036 (font_get_spec): Remove; unused.
4037 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
4038 (font_update_drivers, Ffont_get_glyphs, font_add_log):
4039 Rename or move locals to avoid shadowing.
4041 * fns.c (require_nesting_list, require_unwind): Now static.
4042 (Ffillarray): Rename locals to avoid shadowing.
4044 * floatfns.c (domain_error2): Define only if needed.
4045 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
4047 * alloc.c (mark_backtrace): Move decl from here ...
4048 * lisp.h: ... to here, so that it can be checked.
4050 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
4051 (Fdefvar): Rewrite so as not to use empty "else".
4052 (lisp_indirect_variable): Name an expression,
4053 to avoid gcc -Wbad-function-cast warning.
4054 (Fdefvar): Rename locals to avoid shadowing.
4056 * callint.c (quotify_arg, quotify_args): Now static.
4057 (Fcall_interactively): Rename locals to avoid shadowing.
4058 Use const pointer when appropriate.
4060 * lisp.h (get_system_name, get_operating_system_release):
4061 Move decls here, to check interfaces.
4062 * process.c (get_operating_system_release): Move decl to lisp.h.
4063 * xrdb.c (get_system_name): Likewise.
4064 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
4065 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
4066 some of which prompt warnings from gcc -Wbad-function-cast.
4067 (Fformat_time_string, Fencode_time, Finsert_char):
4068 (Ftranslate_region_internal, Fformat):
4069 Rename or remove local vars to avoid shadowing.
4070 (Ftranslate_region_internal): Mark var as initialized.
4072 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
4075 * lisp.h (eassert): Check that the argument compiles, even if
4076 ENABLE_CHECKING is not defined.
4078 * data.c (Findirect_variable): Name an expression, to avoid
4079 gcc -Wbad-function-cast warning.
4080 (default_value, arithcompare, arith_driver, arith_error): Now static.
4081 (store_symval_forwarding): Rename local to avoid shadowing.
4082 (Fmake_variable_buffer_local, Fmake_local_variable):
4083 Mark variables as initialized.
4084 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
4086 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
4087 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
4088 Rename locals to avoid shadowing.
4089 (mark_stack): Move local variables into the #ifdef region where
4091 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
4092 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
4094 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
4095 (GC_STRING_CHARS): Remove; not used.
4096 (Fmemory_limit): Cast sbrk's returned value to char *.
4098 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
4099 avoids undefined behavior in theory.
4101 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
4103 Use functions, not macros, for up- and down-casing (Bug#8254).
4104 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
4105 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
4106 to use the following functions instead of these macros.
4107 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
4108 EMACS_INT, since callers assume the returned value fits in int.
4109 (upcase1): Likewise, for UPCASE_TABLE.
4110 (uppercasep, lowercasep, upcase): New static inline functions.
4111 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
4112 the race-condition problem in the old DOWNCASE.
4114 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
4115 Rename locals to avoid shadowing.
4116 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
4117 (regex_compile, re_search_2, re_match_2_internal):
4118 Remove unused local vars.
4119 (FREE_VAR): Rewrite so as not to use empty "else",
4120 which gcc can warn about.
4121 (regex_compile, re_match_2_internal): Mark locals as initialized.
4122 (RETALLOC_IF): Define only if needed.
4123 (WORDCHAR_P): Likewise. This one is never needed, but is used
4124 only in a comment talking about a compiler bug, so put inside
4125 the #if 0 of that comment.
4126 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
4127 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
4130 * search.c (boyer_moore): Rename locals to avoid shadowing.
4131 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
4132 (PREV_CHAR_BOUNDARY): Likewise.
4134 * search.c (simple_search): Remove unused var.
4136 * dired.c (compile_pattern): Move decl from here ...
4137 * lisp.h: ... to here, so that it can be checked.
4138 (struct re_registers): New forward decl.
4140 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
4142 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
4144 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
4145 Rename locals to avoid shadowing.
4146 (Fvertical_motion): Mark locals as initialized.
4148 * casefiddle.c (casify_object, casify_region): Now static.
4149 (casify_region): Mark local as initialized.
4151 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
4153 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
4154 New macros, so that the caller can use some names other than
4155 gcpro1, gcpro2, etc.
4156 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
4158 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
4159 argument, for consistency with GCPRO2_VAR, etc: it is now the
4160 prefix of the variable, not the variable itself. All uses
4162 * dired.c (directory_files_internal, file_name_completion):
4163 Rename locals to avoid shadowing.
4165 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
4166 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
4167 dired.c's scmp function, had undefined behavior.
4168 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
4169 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
4170 * buffer.h: ... to here, because these macros use current_buffer,
4171 and the new implementation with inline functions needs to have
4172 current_buffer in scope now, rather than later when the macros
4174 (downcase, upcase1): New static inline functions.
4175 (DOWNCASE, UPCASE1): Reimplement using these functions.
4176 This avoids undefined behavior in expressions like
4177 DOWNCASE (x) == DOWNCASE (y), which previously suffered
4178 from race conditions in accessing the global variables
4179 case_temp1 and case_temp2.
4180 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
4181 * lisp.h (case_temp1, case_temp2): Remove their decls.
4182 * character.h (ASCII_CHAR_P): Move from here ...
4183 * lisp.h: ... to here, so that the inline functions mentioned
4186 * dired.c (directory_files_internal_unwind): Now static.
4188 * fileio.c (file_name_as_directory, directory_file_name):
4189 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
4191 (file_name_as_directory): Use const pointers when appropriate.
4192 (Fexpand_file_name): Likewise. In particular, newdir might
4193 point at constant storage, so make it a const pointer.
4194 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
4195 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
4197 (Fset_file_times, Finsert_file_contents, auto_save_error):
4198 Rename locals to avoid shadowing.
4200 * minibuf.c (choose_minibuf_frame_1): Now static.
4201 (Ftry_completion, Fall_completions): Rename or remove locals
4204 * marker.c (bytepos_to_charpos): Remove; unused.
4206 * lisp.h (verify_bytepos, count_markers): New decls,
4207 so that gcc does not warn that these functions aren't declared.
4209 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
4210 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
4211 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
4212 (copy_text): Remove unused local var.
4214 * filelock.c (within_one_second): Now static.
4215 (lock_file_1): Rename local to avoid shadowing.
4217 * buffer.c (fix_overlays_before): Mark locals as initialized.
4218 (fix_start_end_in_overlays): Likewise. This function should be
4219 simplified by using pointers-to-pointers, but that's a different
4221 (switch_to_buffer_1): Now static.
4222 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
4223 (report_overlay_modification): Rename locals to avoid shadowing.
4225 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
4226 Fix pointer signedness issue.
4227 (sys_subshell): Mark local as volatile if checking for lint,
4228 to suppress a gcc -Wclobbered warning that does not seem to be right.
4229 (MAXPATHLEN): Define only if needed.
4231 * process.c (serial_open, serial_configure): Move decls from here ...
4232 * systty.h: ... to here, so that they can be checked.
4234 * fns.c (get_random, seed_random): Move extern decls from here ...
4235 * lisp.h: ... to here, so that they can be checked.
4237 * sysdep.c (reset_io): Now static.
4238 (wait_for_termination_signal): Remove; unused.
4240 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
4241 (copy_keymap_item, append_key, push_text_char_description):
4243 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
4244 (DENSE_TABLE_SIZE): Remove; unused.
4245 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
4246 (describe_map_tree):
4247 Rename locals to avoid shadowing.
4249 * keyboard.c: Declare functions static if they are not used elsewhere.
4250 (echo_char, echo_dash, cmd_error, top_level_2):
4251 (poll_for_input, handle_async_input): Now static.
4252 (read_char, kbd_buffer_get_event, make_lispy_position):
4253 (make_lispy_event, make_lispy_movement, apply_modifiers):
4254 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
4255 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
4256 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
4257 (read_key_sequence, read_char): Mark locals as initialized.
4258 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
4260 * keyboard.h (make_ctrl_char): New decl.
4261 (mark_kboards): Move decl here ...
4262 * alloc.c (mark_kboards): ... from here.
4264 * lisp.h (force_auto_save_soon): New decl.
4266 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
4267 (DEFINE_DUMMY_FUNCTION): New macro.
4268 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
4270 (main): Add casts to avoid warnings
4271 if GCC considers string literals to be constants.
4273 * lisp.h (fatal_error_signal): Add decl, since it's exported.
4275 * dbusbind.c: Pointer signedness fixes.
4276 (xd_signature, xd_append_arg, xd_initialize):
4277 (Fdbus_call_method, Fdbus_call_method_asynchronously):
4278 (Fdbus_method_return_internal, Fdbus_method_error_internal):
4279 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
4280 (Fdbus_register_signal): Use SSDATA when the context wants char *.
4282 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
4283 if GCC considers string literals to be constants.
4284 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
4286 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
4288 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
4289 (print_preprocess, print_object): New macro to fix last change.
4291 * print.c (print_preprocess): Don't forget font objects.
4293 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
4295 * emacs.c (USAGE3): Doc fixes.
4297 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
4299 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
4302 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
4304 * lisp.h (VWindow_system, Qfile_name_history):
4305 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
4306 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
4307 (w32_system_caret_x, w32_system_caret_y): Declare extern.
4309 * w32select.c: Don't #include "keyboard.h".
4310 (run_protected): Add extern declaration for waiting_for_input.
4312 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
4313 * w32console.c (detect_input_pending, read_input_pending)
4314 (encode_terminal_code):
4315 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
4316 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
4317 (w32_system_caret_y, Qfile_name_history):
4318 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
4319 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
4320 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
4321 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
4322 * w32proc.c (Qlocal, report_file_error):
4323 * w32term.c (Vwindow_system, updating_frame):
4324 * w32uniscribe.c (initialized, uniscribe_font_driver):
4325 Remove unneeded extern declarations.
4327 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
4329 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
4331 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
4333 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
4334 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
4335 These macros can no longer be used for assignment.
4337 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4338 Assign struct members directly, instead of using BUF_BEGV etc.
4339 (record_buffer_markers, fetch_buffer_markers): New functions for
4340 recording and fetching special buffer markers.
4341 (set_buffer_internal_1, set_buffer_temp): Use them.
4343 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
4345 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
4347 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
4348 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
4350 * xdisp.c (hscroll_window_tree):
4351 (reconsider_clip_changes): Use PT instead of BUF_PT.
4353 2011-03-13 Eli Zaretskii <eliz@gnu.org>
4355 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
4356 $(EMACS_ROOT)/lib/intprops.h.
4358 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
4360 Fix more problems found by GCC 4.5.2's static checks.
4362 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
4363 to unsigned char * to avoid compiler diagnostic.
4364 (xg_free_frame_widgets): Make it clear that a local variable is
4365 needed only if USE_GTK_TOOLTIP.
4366 (gdk_window_get_screen): Make it clear that this macro is needed
4367 only if USE_GTK_TOOLTIP.
4368 (int_gtk_range_get_value): New function, which avoids a diagnostic
4369 from gcc -Wbad-function-cast.
4370 (xg_set_toolkit_scroll_bar_thumb): Use it.
4371 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
4372 diagnostic from gcc -Wbad-function-cast.
4373 (get_utf8_string, xg_get_file_with_chooser):
4374 Rename locals to avoid shadowing.
4375 (create_dialog): Move locals to avoid shadowing.
4377 * xgselect.c (xg_select): Remove unused var.
4379 * image.c (four_corners_best): Mark locals as initialized.
4380 (gif_load): Initialize transparent_p to zero (Bug#8238).
4381 Mark another local as initialized.
4382 (my_png_error, my_error_exit): Mark with NO_RETURN.
4384 * image.c (clear_image_cache): Now static.
4385 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
4386 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
4387 (x_edge_detection): Remove unnecessary cast that
4388 gcc -Wbad-function-cast diagnoses.
4389 (gif_load): Fix pointer signedness.
4390 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
4391 (jpeg_load, gif_load): Rename locals to avoid shadowing.
4393 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
4395 Improve quality of tests for time stamp overflow.
4396 For example, without this patch (encode-time 0 0 0 1 1
4397 1152921504606846976) returns the obviously-bogus value (-948597
4398 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
4399 reports time overflow. See
4400 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
4401 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
4402 * editfns.c: Include limits.h and intprops.h.
4403 (TIME_T_MIN, TIME_T_MAX): New macros.
4404 (time_overflow): Move earlier, to before first use.
4405 (hi_time, lo_time): New functions, for an accurate test for
4407 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
4408 (Fget_internal_run_time): Don't assume time_t fits in int.
4409 (make_time): Use list2 instead of Fcons twice.
4410 (Fdecode_time): More accurate test for out-of-range times.
4411 (check_tm_member): New function.
4412 (Fencode_time): Use it, to test for out-of-range times.
4413 (lisp_time_argument): Don't rely on undefined left-shift and
4414 right-shift behavior when checking for time stamp overflow.
4416 * editfns.c (time_overflow): New function, refactoring common code.
4417 (Fformat_time_string, Fdecode_time, Fencode_time):
4418 (Fcurrent_time_string): Use it.
4420 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
4421 * dired.c (make_time): Move to ...
4422 * editfns.c (make_time): ... here.
4423 * systime.h: Note the move.
4425 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4427 * fringe.c (update_window_fringes): Remove unused variables.
4429 * unexmacosx.c (copy_data_segment): Also copy __got section.
4432 2011-03-12 Eli Zaretskii <eliz@gnu.org>
4434 * termcap.c [MSDOS]: Include "msdos.h".
4435 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
4436 Constify `char *' arguments and their references according to
4437 prototypes in tparam.h.
4439 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
4441 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
4442 Adapt all references accordingly.
4444 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
4446 2011-03-11 Tom Tromey <tromey@redhat.com>
4448 * buffer.c (syms_of_buffer): Remove obsolete comment.
4450 2011-03-11 Eli Zaretskii <eliz@gnu.org>
4452 * termhooks.h (encode_terminal_code): Declare prototype.
4454 * msdos.c (encode_terminal_code): Don't declare prototype.
4456 * term.c (encode_terminal_code): Now external again, used by
4457 w32console.c and msdos.c.
4459 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
4460 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
4462 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
4464 Fix some minor problems found by GCC 4.5.2's static checks.
4466 * fringe.c (update_window_fringes): Mark locals as initialized
4468 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
4470 * alloc.c (mark_fringe_data): Move decl from here ...
4471 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
4472 to check its interface.
4473 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
4475 * fontset.c (free_realized_fontset): Now static.
4476 (Fset_fontset_font): Rename local to avoid shadowing.
4477 (fontset_font): Mark local as initialized.
4478 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
4480 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
4482 * xselect.c (x_disown_buffer_selections): Remove; not used.
4483 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
4484 (x_own_selection, Fx_disown_selection_internal): Rename locals
4486 (x_handle_dnd_message): Remove local to avoid shadowing.
4488 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
4489 so that the caller can use some name other than gcpro1.
4490 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
4491 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
4492 (Fx_backspace_delete_keys_p):
4493 Use them to avoid shadowing, and rename vars to avoid shadowing.
4494 (x_decode_color, x_set_name, x_window): Now static.
4495 (Fx_create_frame): Add braces to silence GCC warning.
4496 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
4497 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
4498 Remove unused locals.
4499 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
4500 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
4501 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
4504 * xterm.h (x_mouse_leave): New decl.
4506 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
4507 Remove unused functions.
4508 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
4509 (x_calc_absolute_position): Now static.
4510 (XTread_socket): Don't define label "out" unless it's used.
4511 Don't declare local "event" unless it's used.
4512 (x_iconify_frame, x_free_frame_resources): Don't declare locals
4513 unless they are used.
4514 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
4515 (x_fatal_error_signal): Remove; not used.
4516 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
4517 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
4518 (x_error_catcher, x_connection_closed, x_error_handler):
4519 (x_error_quitter, xembed_send_message, x_iconify_frame):
4520 (my_log_handler): Rename locals to avoid shadowing.
4521 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
4522 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
4524 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
4525 Rename or move locals to avoid shadowing.
4526 (tty_defined_color, merge_face_heights): Now static.
4527 (free_realized_faces_for_fontset): Remove; not used.
4528 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
4529 does not deduce is never used uninitialized.
4530 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
4531 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
4533 * terminal.c (store_terminal_param): Now static.
4535 * xmenu.c (menu_highlight_callback): Now static.
4536 (set_frame_menubar): Remove unused local.
4537 (xmenu_show): Rename parameter to avoid shadowing.
4538 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
4539 since they might point to immutable storage.
4540 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
4541 since it's unused otherwise.
4543 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
4544 Add a FIXME, since the code still doesn't look right. (Bug#8215)
4545 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
4546 avoids a gcc -Wuninitialized diagnostic.
4547 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
4548 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
4549 does not deduce are never used uninitialized.
4551 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
4553 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554 * window.c (window_loop, size_window):
4555 (run_window_configuration_change_hook, enlarge_window): Likewise.
4557 * window.c (display_buffer): Now static.
4558 (size_window): Mark variables that gcc -Wuninitialized
4559 does not deduce are never used uninitialized.
4560 * window.h (check_all_windows): New decl, to forestall
4561 gcc -Wmissing-prototypes diagnostic.
4562 * dispextern.h (bidi_dump_cached_states): Likewise.
4564 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
4566 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
4568 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
4569 and to avoid gcc -Wuninitialized warning.
4570 (load_charset_map): Mark variables that gcc -Wuninitialized
4571 does not deduce are never used uninitialized.
4572 (load_charset): Abort instead of using uninitialized var (Bug#8229).
4574 * coding.c (coding_set_source, coding_set_destination):
4575 Use "else { /* comment */ }" rather than "else /* comment */;"
4576 for clarity, and to avoid gcc -Wempty-body warning.
4577 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
4578 a block, when the outer 'i' will do.
4579 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
4580 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
4581 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
4582 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
4583 (Fdecode_sjis_char, Fdefine_coding_system_internal):
4584 Rename locals to avoid shadowing.
4585 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
4586 * coding.c (emacs_mule_char, encode_invocation_designation):
4587 Now static, since they're not used elsewhere.
4588 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
4589 (decode_coding_object, encode_coding_object, detect_coding_system):
4590 (decode_coding_emacs_mule): Mark variables that gcc
4591 -Wuninitialized does not deduce are never used uninitialized.
4592 (detect_coding_iso_2022): Initialize a local variable that might
4593 be used uninitialized. Leave a FIXME because it's not clear that
4594 this initialization is needed. (Bug#8211)
4595 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
4596 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
4597 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
4598 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
4599 Remove unused macros.
4601 * category.c (hash_get_category_set): Remove unused local var.
4602 (copy_category_table): Now static, since it's not used elsewhere.
4603 * character.c (string_count_byte8): Likewise.
4605 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
4606 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
4608 * chartab.c (copy_sub_char_table): Now static, since it's not used
4610 (sub_char_table_ref_and_range, char_table_ref_and_range):
4611 Rename locals to avoid shadowing.
4612 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
4614 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
4615 (BIDI_BOB): Remove unused macro.
4617 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
4618 deduce are never used uninitialized.
4619 * term.c (encode_terminal_code): Likewise.
4621 * term.c (encode_terminal_code): Now static. Remove unused local.
4623 * tparam.h: New file.
4624 * term.c, tparam.h: Include it.
4625 * deps.mk (term.o, tparam.o): Depend on tparam.h.
4626 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
4627 Move these decls to tparam.h, and make them agree with what
4628 is actually in tparam.c. The previous trick of using incompatible
4629 decls in different modules does not conform to the C standard.
4630 All callers of tparam changed to use tparam's actual API.
4631 * tparam.c (tparam1, tparam, tgoto):
4632 Use const pointers where appropriate.
4634 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
4635 * cm.h (struct cm): Likewise.
4636 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
4637 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
4638 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
4639 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
4640 (turn_on_face, init_tty): Likewise.
4641 * termchar.h (struct tty_display_info): Likewise.
4643 * term.c (term_mouse_position): Rename local to avoid shadowing.
4645 * alloc.c (mark_ttys): Move decl from here ...
4646 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
4648 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
4650 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
4652 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
4654 * search.c (compile_pattern_1): Remove argument regp, unused since
4655 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
4656 (compile_pattern): Don't pass it.
4658 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
4660 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
4661 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
4663 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
4665 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
4667 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
4668 gdk_window_get_screen, gdk_window_get_geometry,
4669 gdk_x11_window_lookup_for_display and GDK_KEY_g.
4670 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
4671 (xg_get_pixbuf_from_pixmap): New function.
4672 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
4673 to Pixmap, take frame as parameter, remove GdkColormap parameter.
4674 Call xg_get_pixbuf_from_pixmap instead of
4675 gdk_pixbuf_get_from_drawable.
4676 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
4677 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
4678 (xg_check_special_colors): Use GtkStyleContext and its functions
4680 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
4681 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
4682 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
4683 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
4684 Call gtk_widget_get_preferred_size.
4685 (xg_frame_resized): gdk_window_get_geometry only takes 5
4687 (xg_win_to_widget, xg_event_is_for_menubar):
4688 Call gdk_x11_window_lookup_for_display.
4689 (xg_set_widget_bg): New function.
4690 (delete_cb): New function.
4691 (xg_create_frame_widgets): Connect delete-event to delete_cb.
4692 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
4693 (xg_set_background_color): Call xg_set_widget_bg.
4694 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
4695 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
4696 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
4697 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
4699 (update_frame_tool_bar): Call gtk_widget_hide.
4700 (xg_initialize): Use GDK_KEY_g.
4702 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
4704 (x_session_initialize): Call gdk_x11_set_sm_client_id.
4706 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
4707 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
4708 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
4710 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
4712 * w32xfns.c (select_palette): Check success of RealizePalette against
4713 GDI_ERROR, not zero.
4715 See ChangeLog.11 for earlier changes.
4721 Copyright (C) 2011 Free Software Foundation, Inc.
4723 This file is part of GNU Emacs.
4725 GNU Emacs is free software: you can redistribute it and/or modify
4726 it under the terms of the GNU General Public License as published by
4727 the Free Software Foundation, either version 3 of the License, or
4728 (at your option) any later version.
4730 GNU Emacs is distributed in the hope that it will be useful,
4731 but WITHOUT ANY WARRANTY; without even the implied warranty of
4732 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4733 GNU General Public License for more details.
4735 You should have received a copy of the GNU General Public License
4736 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.