Fix bug #9015 with a bogus crash with glyphless characters on a TTY.
[bpt/emacs.git] / src / ChangeLog
1 2011-07-07 Eli Zaretskii <eliz@gnu.org>
2
3 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
4 (Bug#9015)
5
6 2011-07-07 Kenichi Handa <handa@m17n.org>
7
8 * character.h (unicode_category_t): New enum type.
9
10 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11 (Qchar_code_property_table): New variable.
12 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13 (UNIPROP_COMPRESSED_FORM_P): New macros.
14 (char_table_ascii): Uncompress the compressed values.
15 (sub_char_table_ref): New arg is_uniprop. Callers changed.
16 Uncompress the compressed values.
17 (sub_char_table_ref_and_range): Likewise.
18 (char_table_ref_and_range): Uncompress the compressed values.
19 (sub_char_table_set): New arg is_uniprop. Callers changed.
20 Uncompress the compressed values.
21 (sub_char_table_set_range): Args changed. Callers changed.
22 (char_table_set_range): Adjuted for the above change.
23 (map_sub_char_table): Delete args default_val and parent. Add arg
24 top. Give decoded values to a Lisp function.
25 (map_char_table): Adjusted for the above change. Give decoded
26 values to a Lisp function. Gcpro more variables.
27 (uniprop_table_uncompress)
28 (uniprop_decode_value_run_length): New functions.
29 (uniprop_decoder, uniprop_decoder_count): New variables.
30 (uniprop_get_decoder, uniprop_encode_value_character)
31 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
32 New functions.
33 (uniprop_encoder, uniprop_encoder_count): New variables.
34 (uniprop_get_encoder, uniprop_table)
35 (Funicode_property_table_internal, Fget_unicode_property_internal)
36 (Fput_unicode_property_internal): New functions.
37 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
38 Sunicode_property_table_internal, Sget_unicode_property_internal,
39 and Sput_unicode_property_internal. Defvar_lisp
40 char-code-property-alist.
41
42 * composite.c (CHAR_COMPOSABLE_P): Adjusted for the change of
43 Vunicode_category_table.
44
45 * font.c (font_range): Adjusted for the change of
46 Vunicode_category_table.
47
48 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
49
50 * m/iris4d.h: Remove file, move contents ...
51 * s/irix6-5.h: ... here.
52
53 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
54
55 Remove unportable assumption about struct layout (Bug#8884).
56 * alloc.c (mark_buffer):
57 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
58 (clone_per_buffer_values): Don't assume that
59 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
60 This isn't true in general, and it's particularly not true
61 if Emacs is configured with --with-wide-int.
62 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
63 New macros, used in the buffer.c change.
64
65 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
66
67 * xsettings.c: Use both GConf and GSettings if both are available.
68 (store_config_changed_event): Add comment.
69 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
70 (store_tool_bar_style_changed): New functions.
71 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
72 (struct xsettings): Move font inside HAVE_XFT.
73 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
74 (GSETTINGS_MONO_FONT): Renamed from SYSTEM_MONO_FONT.
75 Move inside HAVE_XFT.
76 (something_changed_gsettingsCB): Renamed from something_changedCB.
77 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
78 also.
79 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
80 (GCONF_MONO_FONT): Renamed from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
81 (something_changed_gconfCB): Renamed from something_changedCB.
82 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
83 (parse_settings): Move check for font inside HAVE_XFT.
84 (read_settings, apply_xft_settings): Add comment.
85 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
86 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
87 call store_font_name_changed.
88 (xft_settings_event): Add comment.
89 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
90 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
91 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
92 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
93 (xsettings_initialize): Call init_gsettings last.
94 (xsettings_get_system_font, xsettings_get_system_normal_font): Add
95 comment.
96
97 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
98
99 Random fixes. E.g., (random) never returned negative values.
100 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
101 subseconds part to the entropy, as that's a bit more random.
102 Prefer signed to unsigned, since the signedness doesn't matter and
103 in general we prefer signed. When given a limit, use a
104 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
105 latter isn't right if USE_2_TAGS_FOR_INTS.
106 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
107 not 0..VALMASK. Don't discard "excess" bits that random () returns.
108
109 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
110
111 * textprop.c (text_property_stickiness):
112 Obey Vtext_property_default_nonsticky.
113 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
114 * w32fns.c (syms_of_w32fns):
115 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
116
117 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
118
119 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
120 This is more efficient than Ffile_directory_p and avoids a minor race.
121
122 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
123
124 * buffer.c (Foverlay_put): Say what the return value is
125 (bug#7835).
126
127 * fileio.c (barf_or_query_if_file_exists): Check first if the file
128 is a directory before asking whether to use the file name
129 (bug#7564).
130 (barf_or_query_if_file_exists): Make the "File is a directory"
131 error be more correct.
132
133 * fns.c (Frequire): Remove the mention of the .gz files, since
134 that's installation-specific, but keep the mention of
135 `get-load-suffixes'.
136
137 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
138
139 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
140 Report string overflow if the output is too long.
141
142 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
143
144 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
145 (syms_of_gnutls): Remove duplicate DEFSYM for
146 Qgnutls_bootprop_verify_hostname_error, an error for
147 Qgnutls_bootprop_verify_error (which is no longer used).
148
149 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
150 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
151 Also (re)move comments that are misplaced or no longer relevant.
152
153 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
154
155 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
156
157 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
158
159 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
160 and background color parameters if they have been changed.
161
162 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
163
164 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
165
166 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
167
168 * xsettings.c (SYSTEM_FONT): Define only when used.
169 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
170
171 * keymap.c (access_keymap_1): Now static.
172
173 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
174
175 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
176 leave any prefix arg for the up event (Bug#1586).
177
178 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
179
180 * lread.c (syms_of_lread): Mention single symbols defined by
181 `defvar' or `defconst' (bug#7154).
182
183 * fns.c (Frequire): Mention .el.gz files (bug#7314).
184 (Frequire): Mention get-load-suffixes.
185
186 2011-07-02 Martin Rudalics <rudalics@gmx.at>
187
188 * window.h (window): Remove clone_number slot.
189 * window.c (Fwindow_clone_number, Fset_window_clone_number):
190 Remove.
191 (make_parent_window, make_window, saved_window)
192 (Fset_window_configuration, save_window_save): Don't deal with
193 clone numbers.
194 * buffer.c (Qclone_number): Remove declaration.
195 (sort_overlays, overlay_strings): Don't deal with clone numbers.
196
197 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
198
199 Add multiple inheritance to keymaps.
200 * keymap.c (Fmake_composed_keymap): New function.
201 (Fset_keymap_parent): Simplify.
202 (fix_submap_inheritance): Remove.
203 (access_keymap_1): New function extracted from access_keymap to handle
204 embedded parents and handle lists of maps.
205 (access_keymap): Use it.
206 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
207 (Fcopy_keymap): Handle embedded parents.
208 (Fcommand_remapping, define_as_prefix): Simplify.
209 (Fkey_binding): Simplify.
210 (syms_of_keymap): Move minibuffer-local-completion-map,
211 minibuffer-local-filename-completion-map,
212 minibuffer-local-must-match-map, and
213 minibuffer-local-filename-must-match-map to Elisp.
214 (syms_of_keymap): Defsubr make-composed-keymap.
215 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
216 (parse_menu_item): Trivial simplification.
217
218 2011-07-01 Glenn Morris <rgm@gnu.org>
219
220 * Makefile.in (SETTINGS_LIBS): Fix typo.
221
222 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
223
224 * coding.c (Fencode_coding_string): Record the last coding system
225 used, as the function doc string says (bug#8738).
226
227 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
228
229 * xsettings.c (store_monospaced_changed): Take new font as arg and
230 check for change against current_mono_font.
231 (EMACS_TYPE_SETTINGS): Remove this and related defines.
232 (emacs_settings_constructor, emacs_settings_get_property)
233 (emacs_settings_set_property, emacs_settings_class_init)
234 (emacs_settings_init, gsettings_obj): Remove.
235 (something_changedCB): New function for HAVE_GSETTINGS.
236 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
237 with value as argument.
238 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
239 g_settings_new (Bug#8967). Do not create gsettings_obj.
240 Remove calls to g_settings_bind. Connect something_changedCB to
241 "changed".
242
243 * xgselect.c: Add defined (HAVE_GSETTINGS).
244 (xgselect_initialize): Ditto.
245
246 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
247 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
248 xg_select.
249
250 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
251
252 * eval.c (struct backtrace): Simplify and port the data structure.
253 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
254 signed bit field, as this assumption is not portable and it makes
255 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
256 "char debug_on_exit : 1" as this is not portable either; instead,
257 use the portable "unsigned int debug_on_exit : 1". Remove unused
258 member evalargs. Remove obsolete comments about cc bombing out.
259
260 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
261
262 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
263 Let HAVE_GSETTINGS override HAVE_GCONF.
264 (store_monospaced_changed): New function.
265 (EMACS_SETTINGS): A new type derived from GObject to handle
266 GSettings notifications.
267 (emacs_settings_constructor, emacs_settings_get_property)
268 (emacs_settings_set_property, emacs_settings_class_init):
269 New functions.
270 (gsettings_client, gsettings_obj): New variables.
271 (GSETTINGS_SCHEMA): New define.
272 (something_changedCB): Call store_monospaced_changed.
273 (init_gsettings): New function.
274 (xsettings_initialize): Call init_gsettings.
275 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
276 to NULL.
277
278 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Renamed from
279 GCONF_CFLAGS/LIBS.
280
281 2011-06-29 Martin Rudalics <rudalics@gmx.at>
282
283 * window.c (resize_root_window, grow_mini_window)
284 (shrink_mini_window): Rename Qresize_root_window to
285 Qwindow_resize_root_window and Qresize_root_window_vertically to
286 Qwindow_resize_root_window_vertically.
287
288 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
289
290 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
291
292 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
293
294 * makefile.w32-in: Redesign dependencies so they reflect more
295 clearly which files are directly included by each source file,
296 and not through other includes.
297
298 2011-06-27 Martin Rudalics <rudalics@gmx.at>
299
300 * buffer.c (Qclone_number): Declare static and DEFSYM it.
301 (sort_overlays, overlay_strings): When an overlay's clone number
302 matches the window's clone number process the overlay even if
303 the overlay's window property doesn't match the current window.
304
305 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
306 (Fwindow_hchild): Rename to Fwindow_left_child.
307 (Fwindow_next): Rename to Fwindow_next_sibling.
308 (Fwindow_prev): Rename to Fwindow_prev_sibling.
309 (resize_window_check): Rename to window_resize_check.
310 (resize_window_apply): Rename to window_resize_apply.
311 (Fresize_window_apply): Rename to Fwindow_resize_apply.
312 (Fdelete_other_windows_internal, resize_frame_windows)
313 (Fsplit_window_internal, Fdelete_window_internal)
314 (grow_mini_window, shrink_mini_window)
315 (Fresize_mini_window_internal): Fix callers accordingly.
316
317 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
318
319 * emacsgtkfixed.h: State that this is only used with Gtk+3.
320 (emacs_fixed_set_min_size): Remove.
321 (emacs_fixed_new): Take frame as argument.
322
323 * emacsgtkfixed.c: State that this is only used with Gtk+3.
324 (_EmacsFixedPrivate): Remove minwidth/height.
325 Add struct frame *f.
326 (emacs_fixed_init): Initialize priv->f.
327 (get_parent_class, emacs_fixed_set_min_size): Remove.
328 (emacs_fixed_new): Set priv->f to argument.
329 (emacs_fixed_get_preferred_width)
330 (emacs_fixed_get_preferred_height): Use min_width/height from
331 frames size_hint to set minimum and natural (Bug#8919).
332 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
333 and use min_width/height from frames size_hint to set
334 min_width/height (Bug#8919).
335
336 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
337 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
338 Fix indentation.
339
340 2011-06-26 Eli Zaretskii <eliz@gnu.org>
341
342 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
343 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
344 called at ZV.
345
346 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
347
348 * process.c (wait_reading_process_output): Bypass select if
349 waiting for a cell while ignoring keyboard input, and input is
350 pending. Suggested by Jan Djärv (Bug#8869).
351
352 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
353
354 Use gnulib's dup2 module instead of rolling our own.
355 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
356
357 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
358
359 * dispnew.c (scrolling_window): Before scrolling, turn off a
360 mouse-highlight in the window being scrolled.
361
362 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
363
364 Move DEFSYM to lisp.h and use everywhere.
365
366 * character.h (DEFSYM): Move declaration...
367 * lisp.h (DEFSYM): ...here.
368
369 * gnutls.c:
370 * minibuf.c:
371 * w32menu.c:
372 * w32proc.c:
373 * w32select.c: Don't include character.h.
374
375 * alloc.c (syms_of_alloc):
376 * buffer.c (syms_of_buffer):
377 * bytecode.c (syms_of_bytecode):
378 * callint.c (syms_of_callint):
379 * casefiddle.c (syms_of_casefiddle):
380 * casetab.c (init_casetab_once):
381 * category.c (init_category_once, syms_of_category):
382 * ccl.c (syms_of_ccl):
383 * cmds.c (syms_of_cmds):
384 * composite.c (syms_of_composite):
385 * dbusbind.c (syms_of_dbusbind):
386 * dired.c (syms_of_dired):
387 * dispnew.c (syms_of_display):
388 * doc.c (syms_of_doc):
389 * editfns.c (syms_of_editfns):
390 * emacs.c (syms_of_emacs):
391 * eval.c (syms_of_eval):
392 * fileio.c (syms_of_fileio):
393 * fns.c (syms_of_fns):
394 * frame.c (syms_of_frame):
395 * fringe.c (syms_of_fringe):
396 * insdel.c (syms_of_insdel):
397 * keymap.c (syms_of_keymap):
398 * lread.c (init_obarray, syms_of_lread):
399 * macros.c (syms_of_macros):
400 * msdos.c (syms_of_msdos):
401 * print.c (syms_of_print):
402 * process.c (syms_of_process):
403 * search.c (syms_of_search):
404 * sound.c (syms_of_sound):
405 * syntax.c (init_syntax_once, syms_of_syntax):
406 * terminal.c (syms_of_terminal):
407 * textprop.c (syms_of_textprop):
408 * undo.c (syms_of_undo):
409 * w32.c (globals_of_w32):
410 * window.c (syms_of_window):
411 * xdisp.c (syms_of_xdisp):
412 * xfaces.c (syms_of_xfaces):
413 * xfns.c (syms_of_xfns):
414 * xmenu.c (syms_of_xmenu):
415 * xsettings.c (syms_of_xsettings):
416 * xterm.c (syms_of_xterm): Use DEFSYM.
417
418 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
419
420 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
421
422 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
423
424 Integer and buffer overflow fixes (Bug#8873).
425
426 * print.c (printchar, strout): Check for string overflow.
427 (PRINTPREPARE, printchar, strout):
428 Don't set size unless allocation succeeds.
429
430 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
431 for sizes. Check for string overflow more accurately.
432 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
433
434 * macros.c: Integer and buffer overflow fixes.
435 * keyboard.h (struct keyboard.kbd_macro_bufsize):
436 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
437 Use ptrdiff_t, not int, for sizes.
438 Don't increment bufsize until after realloc succeeds.
439 Check for size-calculation overflow.
440 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
441
442 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
443
444 * lread.c: Integer overflow fixes.
445 (read_integer): Radix is now EMACS_INT, not int,
446 to improve quality of diagnostics for out-of-range radices.
447 Calculate buffer size correctly for out-of-range radices.
448 (read1): Check for integer overflow in radices, and in
449 read-circle numbers.
450 (read_escape): Avoid int overflow.
451 (Fload, openp, read_buffer_size, read1)
452 (substitute_object_recurse, read_vector, read_list, map_obarray):
453 Use ptrdiff_t, not int, for sizes.
454 (read1): Use EMACS_INT, not int, for sizes.
455 Check for size overflow.
456
457 * image.c (cache_image): Check for size arithmetic overflow.
458
459 * lread.c: Integer overflow issues.
460 (saved_doc_string_size, saved_doc_string_length)
461 (prev_saved_doc_string_size, prev_saved_doc_string_length):
462 Now ptrdiff_t, not int.
463 (read1): Don't assume doc string length fits in int. Check for
464 out-of-range doc string lengths.
465 (read_list): Don't assume file position fits in int.
466 (read_escape): Check for hex character overflow.
467
468 2011-06-22 Leo Liu <sdl.web@gmail.com>
469
470 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
471 Move to minibuffer.el.
472
473 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
474
475 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
476 The following patches are for when GLYPH_DEBUG && !XASSERT.
477 * dispextern.h (trace_redisplay_p, dump_glyph_string):
478 * dispnew.c (flush_stdout):
479 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
480 Mark as externally visible.
481 * dispnew.c (check_window_matrix_pointers): Now static.
482 * dispnew.c (window_to_frame_vpos):
483 * xfns.c (unwind_create_frame):
484 * xterm.c (x_check_font): Remove unused local.
485 * scroll.c (CHECK_BOUNDS):
486 * xfaces.c (cache_fache): Rename local to avoid shadowing.
487 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
488 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
489 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
490 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
491 Now static.
492 (debug_method_add): Use va_list and vsprintf rather than relying
493 on undefined behavior with wrong number of arguments.
494 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
495 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
496 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
497 since we're not interested in debugging glyphs with old libraries.
498 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
499 GCC 4.6.0's static checking.
500
501 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
502
503 Integer overflow and signedness fixes (Bug#8873).
504 A few related buffer overrun fixes, too.
505
506 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
507
508 * dispextern.h (struct face.stipple):
509 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
510 (x_bitmap_mask, x_allocate_bitmap_record)
511 (x_create_bitmap_from_data, x_create_bitmap_from_file)
512 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
513 (x_create_bitmap_from_xpm_data):
514 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
515 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
516 (.bitmaps_last):
517 * xfaces.c (load_pixmap):
518 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
519 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
520 (.bitmaps_last, struct x_output.icon_bitmap):
521 Use ptrdiff_t, not int, for bitmap indexes.
522 (x_allocate_bitmap_record): Check for size overflow.
523 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
524
525 Use ptrdiff_t, not int, for overlay counts.
526 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
527 * editfns.c (overlays_around, get_pos_property):
528 * textprop.c (get_char_property_and_overlay):
529 * xdisp.c (next_overlay_change, note_mouse_highlight):
530 * xfaces.c (face_at_buffer_position):
531 * buffer.c (OVERLAY_COUNT_MAX): New macro.
532 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
533 (Fnext_overlay_change, Fprevious_overlay_change)
534 (mouse_face_overlay_overlaps, Foverlays_in):
535 Use ptrdiff_t, not int, for sizes.
536 (overlays_at, overlays_in): Check for size-calculation overflow.
537
538 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
539
540 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
541 (x_session_initialize): Do not assume string length fits in int.
542
543 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
544 This is unlikely, but can occur if DPI is outlandish.
545
546 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
547 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
548
549 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
550 * xrdb.c (magic_file_p, search_magic_path):
551 Omit last arg SUFFIX; it was always 0. All callers changed.
552 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
553
554 * xfont.c (xfont_match): Avoid need for strlen.
555
556 * xfns.c: Don't assume strlen fits in int.
557 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
558
559 * xdisp.c (message_log_check_duplicate): Return intmax_t,
560 not unsigned long, as we prefer signed integers. All callers changed.
561 Detect integer overflow in repeat count.
562 (message_dolog): Don't assume print length fits in 39 bytes.
563 (display_mode_element): Don't assume strlen fits in int.
564
565 * termcap.c: Don't assume sizes fit in int and never overflow.
566 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
567 (gobble_line): Check for size-calculation overflow.
568
569 * minibuf.c (Fread_buffer):
570 * lread.c (intern, intern_c_string):
571 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
572 Don't assume string length fits in int.
573
574 * keyboard.c (parse_tool_bar_item):
575 * gtkutil.c (style_changed_cb): Avoid need for strlen.
576
577 * font.c: Don't assume string length fits in int.
578 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
579 Use ptrdiff_t, not int.
580 (font_intern_prop): Don't assume string length fits in int.
581 Don't assume integer property fits in fixnum.
582 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
583
584 * filelock.c: Fix some buffer overrun and integer overflow issues.
585 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
586 Reformulate so as not to need the command string.
587 Invoke gzip -cd rather than gunzip, as it's more portable.
588 (lock_info_type, lock_file_1, lock_file):
589 Don't assume pid_t and time_t fit in unsigned long.
590 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
591 (current_lock_owner): Prefer signed type for sizes.
592 Use memcpy, not strncpy, where memcpy is what is really wanted.
593 Don't assume (via atoi) that time_t and pid_t fit in int.
594 Check for time_t and/or pid_t out of range, e.g., via a network share.
595 Don't alloca where an auto var works fine.
596
597 * fileio.c: Fix some integer overflow issues.
598 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
599 Don't assume string length fits in int.
600 (directory_file_name): Don't assume string length fits in long.
601 (make_temp_name): Don't assume pid fits in int, or that its print
602 length is less than 20.
603
604 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
605
606 * coding.c (make_subsidiaries): Don't assume string length fits in int.
607
608 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
609
610 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
611 We prefer signed integers, even for size calculations.
612
613 * emacs.c: Don't assume string length fits in 'int'.
614 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
615 (main): Don't invoke strlen when not needed.
616
617 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
618 (XD_DEBUG_MESSAGE): Don't waste a byte.
619
620 * callproc.c (getenv_internal_1, getenv_internal)
621 (Fgetenv_internal):
622 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
623
624 * lread.c (invalid_syntax): Omit length argument.
625 All uses changed. This doesn't fix a bug, but it simplifies the
626 code away from its former Hollerith-constant appearance, and it's
627 one less 'int' to worry about when looking at integer-overflow issues.
628 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
629
630 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
631 This didn't break anything, but it didn't help either.
632 It's confusing to put a bogus integer in a place where the actual
633 value does not matter.
634 (LIST_END_P): Remove unused macro and its bogus comment.
635 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
636
637 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
638 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
639 implementation.
640 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
641 We prefer signed types, and the value cannot exceed the EMACS_INT
642 range anyway (because otherwise the length would not be representable).
643 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
644 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
645 This avoids a GCC warning when WIDE_EMACS_INT.
646
647 * indent.c (sane_tab_width): New function.
648 (current_column, scan_for_column, Findent_to, position_indentation)
649 (compute_motion): Use it. This is just for clarity.
650 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
651
652 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
653
654 * lisp.h (lint_assume): New macro.
655 * composite.c (composition_gstring_put_cache):
656 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
657
658 * editfns.c, insdel.c:
659 Omit unnecessary forward decls, to simplify future changes.
660
661 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
662
663 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
664
665 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
666 Use much-faster test for byte-length change.
667 Don't assume string byte-length fits in 'int'.
668 Check that character arg fits in 'int'.
669 (mapcar1): Declare byte as byte, for clarity.
670
671 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
672
673 * fns.c (concat): Catch string overflow earlier.
674 Do not rely on integer wraparound.
675
676 * dispextern.h (struct it.overlay_strings_charpos)
677 (struct it.selective): Now EMACS_INT, not int.
678 * xdisp.c (forward_to_next_line_start)
679 (back_to_previous_visible_line_start)
680 (reseat_at_next_visible_line_start, next_element_from_buffer):
681 Don't arbitrarily truncate the value of 'selective' to int.
682
683 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
684
685 * composite.c: Don't truncate sizes to 'int'.
686 (composition_gstring_p, composition_reseat_it)
687 (composition_adjust_point): Use EMACS_INT, not int.
688 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
689 not EMACS_UINT, for indexes.
690
691 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
692
693 * buffer.c: Include <verify.h>.
694 (struct sortvec.priority, struct sortstr.priority):
695 Now EMACS_INT, not int.
696 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
697 (struct sortstr.size, record_overlay_string)
698 (struct sortstrlist.size, struct sortlist.used):
699 Don't truncate size to int.
700 (record_overlay_string): Check for size-calculation overflow.
701 (init_buffer_once): Check at compile-time, not run-time.
702
703 2011-06-22 Jim Meyering <meyering@redhat.com>
704
705 Don't leak an XBM-image-sized buffer
706 * image.c (xbm_load): Free the image buffer after using it.
707
708 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
709
710 Port to Sun C.
711 * composite.c (find_automatic_composition): Omit needless 'return 0;'
712 that Sun C diagnosed.
713 * fns.c (secure_hash): Fix pointer signedness issue.
714 * intervals.c (static_offset_intervals): New function.
715 (offset_intervals): Use it.
716
717 2011-06-21 Leo Liu <sdl.web@gmail.com>
718
719 * deps.mk (fns.o):
720 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
721 sha512.h.
722
723 * fns.c (secure_hash): Rename from crypto_hash_function and change
724 the first arg to accept symbols.
725 (Fsecure_hash): New primitive.
726 (syms_of_fns): New symbols.
727
728 2011-06-20 Deniz Dogan <deniz@dogan.se>
729
730 * process.c (Fset_process_buffer): Clarify return value in
731 docstring.
732
733 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
734
735 * dispnew.c (add_window_display_history): Use BVAR.
736
737 * xdisp.c (debug_method_add): Use BVAR.
738 (check_window_end, dump_glyph_matrix, dump_glyph)
739 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
740
741 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
742 Likewise.
743
744 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
745 check till after the cache is created in init_frame_faces.
746
747 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
748
749 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
750
751 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
752
753 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
754 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
755 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
756
757 Improve buffer-overflow checking (Bug#8873).
758 * fileio.c (Finsert_file_contents):
759 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
760 Remove the old (too-loose) buffer overflow checks.
761 They weren't needed, since make_gap checks for buffer overflow.
762 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
763 The old code merely checked for Emacs fixnum overflow, and relied
764 on undefined (wraparound) behavior. The new code avoids undefined
765 behavior, and also checks for ptrdiff_t and/or size_t overflow.
766
767 * editfns.c (Finsert_char): Don't dump core with very negative counts.
768 Tune. Don't use wider integers than needed. Don't use alloca.
769 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
770
771 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
772
773 * insdel.c, lisp.h (buffer_overflow): New function.
774 (insert_from_buffer_1, replace_range, replace_range_2):
775 * insdel.c (make_gap_larger):
776 * editfns.c (Finsert_char):
777 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
778
779 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
780
781 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
782
783 Integer overflow and signedness fixes (Bug#8873).
784
785 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
786 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
787
788 * fileio.c: Don't assume EMACS_INT fits in off_t.
789 (emacs_lseek): New static function.
790 (Finsert_file_contents, Fwrite_region): Use it.
791 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
792
793 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
794
795 * fns.c: Don't overflow int when computing a list length.
796 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
797 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
798 truncation on 64-bit hosts. Check for QUIT every
799 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
800 faster and is responsive enough.
801 (Flength): Report an error instead of overflowing an integer.
802 (Fsafe_length): Return a float if the value is not representable
803 as a fixnum. This shouldn't happen except in contrived situations.
804 (Fnthcdr, Fsort): Don't assume list length fits in int.
805 (Fcopy_sequence): Don't assume vector length fits in int.
806
807 * alloc.c: Check that resized vectors' lengths fit in fixnums.
808 (header_size, word_size): New constants.
809 (allocate_vectorlike): Don't check size overflow here.
810 (allocate_vector): Check it here instead, since this is the only
811 caller of allocate_vectorlike that could cause overflow.
812 Check that the new vector's length is representable as a fixnum.
813
814 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
815 The previous code was bogus. For example, next_almost_prime (32)
816 returned 39, which is undesirable as it is a multiple of 3; and
817 next_almost_prime (24) returned 25, which is a multiple of 5 so
818 why was the code bothering to check for multiples of 7?
819
820 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
821
822 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
823
824 Variadic C functions now count arguments with ptrdiff_t.
825 This partly undoes my 2011-03-30 change, which replaced int with size_t.
826 Back then I didn't know that the Emacs coding style prefers signed int.
827 Also, in the meantime I found a few more instances where arguments
828 were being counted with int, which may truncate counts on 64-bit
829 machines, or EMACS_INT, which may be unnecessarily wide.
830 * lisp.h (struct Lisp_Subr.function.aMANY)
831 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
832 Arg counts are now ptrdiff_t, not size_t.
833 All variadic functions and their callers changed accordingly.
834 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
835 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
836 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
837 * callint.c (Fcall_interactively): Check arg count for overflow,
838 to avoid potential buffer overrun. Use signed char, not 'int',
839 for 'varies' array, so that we needn't bother to check its size
840 calculation for overflow.
841 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
842 * eval.c (apply_lambda):
843 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
844 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
845 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
846
847 * callint.c (Fcall_interactively): Don't use index var as event count.
848
849 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
850 * mem-limits.h (SIZE): Remove; no longer used.
851
852 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
853
854 Remove unnecessary casts.
855 * xterm.c (x_term_init):
856 * xfns.c (x_set_border_pixel):
857 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
858 These aren't needed now that we assume ANSI C.
859
860 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
861 It's more likely to cause problems (due to unsigned overflow)
862 than to cure them.
863
864 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
865
866 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
867
868 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
869
870 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
871
872 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
873
874 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
875
876 GLYPH_CODE_FACE returns EMACS_INT, not int.
877 * dispextern.h (merge_faces):
878 * xfaces.c (merge_faces):
879 * xdisp.c (get_next_display_element, next_element_from_display_vector):
880 Don't assume EMACS_INT fits in int.
881
882 * character.h (CHAR_VALID_P): Remove unused parameter.
883 * fontset.c, lisp.h, xdisp.c: All uses changed.
884
885 * editfns.c (Ftranslate_region_internal): Omit redundant test.
886
887 * fns.c (concat): Minor tuning based on overflow analysis.
888 This doesn't fix any bugs. Use int to hold character, instead
889 of constantly refetching from Emacs object. Use XFASTINT, not
890 XINT, for value known to be a character. Don't bother comparing
891 a single byte to 0400, as it's always less.
892
893 * floatfns.c (Fexpt):
894 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
895
896 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
897 for characters.
898
899 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
900
901 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
902 Without this fix, on a 64-bit host (aset S 0 4294967386) would
903 incorrectly succeed when S was a string, because 4294967386 was
904 truncated before it was used.
905
906 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
907 Otherwise, an out-of-range integer could cause undefined behavior
908 on a 64-bit host.
909
910 * composite.c: Use int, not EMACS_INT, for characters.
911 (fill_gstring_body, composition_compute_stop_pos): Use int, not
912 EMACS_INT, for values that are known to be in character range.
913 This doesn't fix any bugs but is the usual style inside Emacs and
914 may generate better code on 32-bit machines.
915
916 Make sure a 64-bit char is never passed to ENCODE_CHAR.
917 This is for reasons similar to the recent CHAR_STRING fix.
918 * charset.c (Fencode_char): Check that character arg is actually
919 a character. Pass an int to ENCODE_CHAR.
920 * charset.h (ENCODE_CHAR): Verify that the character argument is no
921 wider than 'int', as a compile-time check to prevent future regressions
922 in this area.
923
924 * character.c (char_string): Remove unnecessary casts.
925
926 Make sure a 64-bit char is never passed to CHAR_STRING.
927 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
928 by silently ignoring the top 32 bits, allowing some values
929 that were far too large to be valid characters.
930 * character.h: Include <verify.h>.
931 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
932 arguments are no wider than unsigned, as a compile-time check
933 to prevent future regressions in this area.
934 * data.c (Faset):
935 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
936 (Fsubst_char_in_region):
937 * fns.c (concat):
938 * xdisp.c (decode_mode_spec_coding):
939 Adjust to CHAR_STRING's new requirement.
940 * editfns.c (Finsert_char, Fsubst_char_in_region):
941 * fns.c (concat): Check that character args are actually
942 characters. Without this test, these functions did the wrong
943 thing with wildly out-of-range values on 64-bit hosts.
944
945 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
946 These casts should not be needed on 32-bit hosts, either.
947 * keyboard.c (read_char):
948 * lread.c (Fload): Remove casts to unsigned.
949
950 * lisp.h (UNSIGNED_CMP): New macro.
951 This fixes comparison bugs on 64-bit hosts.
952 (ASCII_CHAR_P): Use it.
953 * casefiddle.c (casify_object):
954 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
955 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
956 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
957 * dispextern.h (FACE_FROM_ID):
958 * keyboard.c (read_char): Use UNSIGNED_CMP.
959
960 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
961 not to EMACS_INT, to avoid GCC warning.
962
963 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
964
965 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
966 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
967 isn't needed on 32-bit machines.
968
969 * buffer.c (Fgenerate_new_buffer_name):
970 Use EMACS_INT for count, not int.
971 (advance_to_char_boundary): Return EMACS_INT, not int.
972
973 * data.c (Qcompiled_function): Now static.
974
975 * window.c (window_body_lines): Now static.
976
977 * image.c (gif_load): Rename local to avoid shadowing.
978
979 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
980 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
981 * alloc.c (make_save_value): Integer argument is now of type
982 ptrdiff_t, not int.
983 (mark_object): Use ptrdiff_t, not int.
984 * lisp.h (pD): New macro.
985 * print.c (print_object): Use it.
986
987 * alloc.c: Use EMACS_INT, not int, to count objects.
988 (total_conses, total_markers, total_symbols, total_vector_size)
989 (total_free_conses, total_free_markers, total_free_symbols)
990 (total_free_floats, total_floats, total_free_intervals)
991 (total_intervals, total_strings, total_free_strings):
992 Now EMACS_INT, not int. All uses changed.
993 (Fgarbage_collect): Compute overall total using a double, so that
994 integer overflow is less likely to be a problem. Check for overflow
995 when converting back to an integer.
996 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
997 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
998 These were 'int' variables that could overflow on 64-bit hosts;
999 they were never used, so remove them instead of repairing them.
1000 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
1001 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
1002 Previously, this ceilinged at INT_MAX, but that doesn't work on
1003 64-bit machines.
1004 (allocate_pseudovector): Don't use EMACS_INT when int would do.
1005
1006 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
1007 (allocate_vectorlike): Check for ptrdiff_t overflow.
1008 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
1009 when a (possibly-narrower) signed value would do just as well.
1010 We prefer using signed arithmetic, to avoid comparison confusion.
1011
1012 * alloc.c: Catch some string size overflows that we were missing.
1013 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
1014 for convenience in STRING_BYTES_MAX.
1015 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
1016 The definition here is exact; the one in lisp.h was approximate.
1017 (allocate_string_data): Check for string overflow. This catches
1018 some instances we weren't catching before. Also, it catches
1019 size_t overflow on (unusual) hosts where SIZE_MAX <= min
1020 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
1021 and ptrdiff_t and EMACS_INT are both 64 bits.
1022
1023 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
1024 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
1025 * lisp.h (STRING_BYTES_BOUND): Renamed from STRING_BYTES_MAX.
1026
1027 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
1028
1029 * alloc.c (Fmake_string): Check for out-of-range init.
1030
1031 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
1032
1033 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
1034
1035 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
1036
1037 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
1038 xg_get_default_scrollbar_width.
1039
1040 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
1041 (int_gtk_range_get_value): Move to the scroll bar part of the file.
1042 (style_changed_cb): Call update_theme_scrollbar_width and call
1043 x_set_scroll_bar_default_width and xg_frame_set_char_size for
1044 all frames (Bug#8505).
1045 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
1046 Call gtk_window_set_resizable if HAVE_GTK3.
1047 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
1048 and height if HAVE_GTK3 (Bug#8505).
1049 (scroll_bar_width_for_theme): New variable.
1050 (update_theme_scrollbar_width): New function.
1051 (xg_get_default_scrollbar_width): Move code to
1052 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
1053 (xg_initialize): Call update_theme_scrollbar_width.
1054
1055 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
1056
1057 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
1058
1059 2011-06-12 Martin Rudalics <rudalics@gmx.at>
1060
1061 * frame.c (make_frame): Call other_buffer_safely instead of
1062 other_buffer.
1063
1064 * window.c (temp_output_buffer_show): Call display_buffer with
1065 second argument Vtemp_buffer_show_specifiers and reset latter
1066 immediately after the call.
1067 (Vtemp_buffer_show_specifiers): New variable.
1068 (auto_window_vscroll_p, next_screen_context_lines)
1069 (Vscroll_preserve_screen_position): Remove leading asterisks from
1070 doc-strings.
1071
1072 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
1073
1074 Fix minor problems found by GCC 4.6.0 static checking.
1075 * buffer.c (Qclone_number): Remove for now, as it's unused.
1076 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
1077 (record_buffer): Remove unused local.
1078 * frame.c (other_visible_frames, frame_buffer_list): Now static.
1079 (set_frame_buffer_list): Remove; unused.
1080 * frame.h (other_visible_frames): Remove decl.
1081 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
1082 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
1083 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
1084 if HAVE_GPM.
1085 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
1086 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
1087 Define only if HAVE_GPM.
1088 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
1089 (update_hints_inhibit): Remove; never set. All uses removed.
1090 * widgetprv.h (emacsFrameClassRec): Remove decl.
1091 * window.c (delete_deletable_window): Now returns void, since it
1092 wasn't returning anything.
1093 (compare_window_configurations): Remove unused locals.
1094 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
1095 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
1096 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
1097 the same widths as pointers. This follows up on the 2011-05-06 patch.
1098 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
1099 * xterm.h: Likewise.
1100 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
1101
1102 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
1103
1104 * makefile.w32-in: Update dependencies.
1105 (LISP_H): Add lib/intprops.h.
1106
1107 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
1108
1109 * image.c (gif_load): Add animation frame delay to the metadata.
1110 (syms_of_image): Use DEFSYM. New symbol `delay'.
1111
1112 2011-06-11 Martin Rudalics <rudalics@gmx.at>
1113
1114 * window.c (delete_deletable_window): Re-add.
1115 (Fset_window_configuration): Rewrite to handle dead buffers and
1116 consequently deletable windows.
1117 (window_tree, Fwindow_tree): Remove. Supply functionality in
1118 window.el.
1119 (compare_window_configurations): Simplify code.
1120
1121 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
1122
1123 * image.c (imagemagick_load_image): Fix type mismatch.
1124 (Fimagemagick_types): Likewise.
1125
1126 * window.h (replace_buffer_in_windows): Declare.
1127
1128 2011-06-11 Martin Rudalics <rudalics@gmx.at>
1129
1130 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
1131 Qclone_number. Remove external declaration of Qdelete_window.
1132 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
1133 code.
1134 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run
1135 Qbuffer_list_update_hook if allowed.
1136 (Fother_buffer): Rewrite doc-string. Major rewrite for new
1137 buffer list implementation.
1138 (other_buffer_safely): New function.
1139 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
1140 calls to replace_buffer_in_windows and
1141 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
1142 if allowed.
1143 (record_buffer): Inhibit quitting and rewrite using quittable
1144 functions. Run Qbuffer_list_update_hook if allowed.
1145 (Frecord_buffer, Funrecord_buffer): New functions.
1146 (switch_to_buffer_1, Fswitch_to_buffer): Remove. Move
1147 switch-to-buffer to window.el.
1148 (bury-buffer): Move to window.el.
1149 (Vbuffer_list_update_hook): New variable.
1150
1151 * lisp.h (other_buffer_safely): Add prototype in buffer.c
1152 section.
1153
1154 * window.h (resize_frame_windows): Move up in code.
1155 (Fwindow_frame): Remove EXFUN.
1156 (replace_buffer_in_all_windows): Remove prototype.
1157 (replace_buffer_in_windows_safely): Add prototype.
1158
1159 * window.c: Declare Qdelete_window static again. Move down
1160 declaration of select_count.
1161 (Fnext_window, Fprevious_window): Rewrite doc-strings.
1162 (Fother_window): Move to window.el.
1163 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
1164 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
1165 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
1166 window.el.
1167 (replace_buffer_in_windows): Implement by calling
1168 Qreplace_buffer_in_windows.
1169 (replace_buffer_in_all_windows): Remove with some functionality
1170 moved into replace_buffer_in_windows_safely.
1171 (replace_buffer_in_windows_safely): New function.
1172 (select_window_norecord, select_frame_norecord): Move in front
1173 of run_window_configuration_change_hook. Remove now obsolete
1174 declarations.
1175 (Fset_window_buffer): Rewrite doc-string. Call
1176 Qrecord_window_buffer.
1177 (keys_of_window): Move binding for other-window to window.el.
1178
1179 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
1180
1181 * dispextern.h (struct image): Replace data member, whose int_val
1182 and ptr_val fields were not used by anything, with a single
1183 lisp_val object.
1184
1185 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
1186 (gif_clear_image, gif_load, imagemagick_load_image)
1187 (gs_clear_image, gs_load): Callers changed.
1188
1189 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
1190
1191 * buffer.h: Include <time.h>, for time_t.
1192 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
1193
1194 Fix minor problems found by static checking.
1195
1196 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
1197
1198 Make identifiers static if they are not used in other modules.
1199 * data.c (Qcompiled_function, Qframe, Qvector):
1200 * image.c (QimageMagick, Qsvg):
1201 * minibuf.c (Qmetadata):
1202 * window.c (resize_window_check, resize_root_window): Now static.
1203 * window.h (resize_window_check, resize_root_window): Remove decls.
1204
1205 * window.c (window_deletion_count, delete_deletable_window):
1206 Remove; unused.
1207 (window_body_lines): Now static.
1208 (Fdelete_other_windows_internal): Mark vars as initialized.
1209 Make sure 'resize_failed' is initialized.
1210 (run_window_configuration_change_hook): Rename local to avoid shadowing.
1211 (resize_window_apply): Remove unused local.
1212 * window.h (delete_deletable_window): Remove decl.
1213
1214 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
1215 (imagemagick_load_image): Fix pointer signedness problem by changing
1216 last arg from unsigned char * to char *. All uses changed.
1217 Also, fix a local for similar reasons.
1218 Remove unused locals. Remove locals to avoid shadowing.
1219 (fn_rsvg_handle_free): Remove; unused.
1220 (svg_load, svg_load_image): Fix pointer signedness problem.
1221 (imagemagick_load_image): Don't use garbage pointer image_wand.
1222
1223 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
1224
1225 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
1226
1227 * image.c (gif_load): Fix omitted cast error introduced by
1228 2011-06-06 change.
1229
1230 2011-06-10 Martin Rudalics <rudalics@gmx.at>
1231
1232 * window.h (resize_proportionally, orig_total_lines)
1233 (orig_top_line): Remove from window structure.
1234 (set_window_height, set_window_width, change_window_heights)
1235 (Fdelete_window): Remove prototypes.
1236 (resize_frame_windows): Remove duplicate declaration.
1237
1238 2011-06-10 Eli Zaretskii <eliz@gnu.org>
1239
1240 * window.h (resize_frame_windows, resize_window_check)
1241 (delete_deletable_window, resize_root_window)
1242 (resize_frame_windows): Declare prototypes.
1243
1244 * window.c (resize_window_apply): Make definition be "static" to
1245 match the prototype.
1246
1247 2011-06-10 Martin Rudalics <rudalics@gmx.at>
1248
1249 * window.c: Remove declarations of Qwindow_size_fixed,
1250 window_min_size_1, window_min_size_2, window_min_size,
1251 size_window, window_fixed_size_p, enlarge_window, delete_window.
1252 Remove static from declaration of Qdelete_window, it's
1253 temporarily needed by Fbury_buffer.
1254 (replace_window): Don't assign orig_top_line and
1255 orig_total_lines.
1256 (Fdelete_window, delete_window): Remove. Window deletion is
1257 handled by window.el.
1258 (window_loop): Remove DELETE_OTHER_WINDOWS case. Replace
1259 Fdelete_window calls with calls to Qdelete_window.
1260 (Fdelete_other_windows): Remove. Deleting other windows is
1261 handled by window.el.
1262 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
1263 handled in window.el.
1264 (window_min_size_2, window_min_size_1, window_min_size): Remove.
1265 Window minimum sizes are handled in window.el.
1266 (shrink_windows, size_window, set_window_height)
1267 (set_window_width, change_window_heights, window_height)
1268 (window_width, CURBEG, CURSIZE, enlarge_window)
1269 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
1270 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
1271 handled in window.el.
1272 (make_dummy_parent): Rename to make_parent_window and give it a
1273 second argument horflag.
1274 (make_window): Don't set resize_proportionally any more.
1275 (Fsplit_window): Remove. Windows are split in window.el.
1276 (save_restore_action, save_restore_orig_size)
1277 (shrink_window_lowest_first, save_restore_orig_size): Remove.
1278 Resize mini windows in window.el.
1279 (grow_mini_window, shrink_mini_window): Implement by calling
1280 Qresize_root_window_vertically, resize_window_check and
1281 resize_window_apply.
1282 (saved_window, Fset_window_configuration, save_window_save): Do
1283 not handle orig_top_line, orig_total_lines, and
1284 resize_proportionally.
1285 (window_min_height, window_min_width): Move to window.el.
1286 (keys_of_window): Move bindings for delete-other-windows,
1287 split-window, delete-window and enlarge-window to window.el.
1288
1289 * buffer.c: Temporarily extern Qdelete_window.
1290 (Fbury_buffer): Temporarily call Qdelete_window instead of
1291 Fdelete_window (Fbury_buffer will move to window.el soon).
1292
1293 * frame.c (set_menu_bar_lines_1): Remove code handling
1294 orig_top_line and orig_total_lines.
1295
1296 * dispnew.c (adjust_frame_glyphs_initially): Don't use
1297 set_window_height but set heights directly.
1298 (change_frame_size_1): Use resize_frame_windows.
1299
1300 * xdisp.c (init_xdisp): Don't use set_window_height but set
1301 heights directly.
1302
1303 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Use
1304 resize_frame_windows instead of change_window_heights and run
1305 run_window_configuration_change_hook.
1306
1307 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
1308 instead of change_window_heights and run
1309 run_window_configuration_change_hook.
1310
1311 2011-06-09 Martin Rudalics <rudalics@gmx.at>
1312
1313 * window.c (replace_window): Rename second argument REPLACEMENT to
1314 NEW. New third argument SETFLAG. Rewrite.
1315 (delete_window, make_dummy_parent): Call replace_window with
1316 third argument 1.
1317 (window_list_1): Move down in code.
1318 (run_window_configuration_change_hook): Move set_buffer part
1319 before select_frame_norecord part in order to unwind correctly.
1320 Rename count1 to count.
1321 (recombine_windows, delete_deletable_window, resize_root_window)
1322 (Fdelete_other_windows_internal)
1323 (Frun_window_configuration_change_hook, make_parent_window)
1324 (resize_window_check, resize_window_apply, Fresize_window_apply)
1325 (resize_frame_windows, Fsplit_window_internal)
1326 (Fdelete_window_internal, Fresize_mini_window_internal): New
1327 functions.
1328 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
1329
1330 2011-06-08 Martin Rudalics <rudalics@gmx.at>
1331
1332 * window.h (window): Add some new members to window structure -
1333 normal_lines, normal_cols, new_total, new_normal, clone_number,
1334 splits, nest, prev_buffers, next_buffers.
1335 (WINDOW_TOTAL_SIZE): Move here from window.c.
1336 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
1337
1338 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
1339 Remove.
1340 (make_dummy_parent): Set new members of windows structure.
1341 (make_window): Move down in code. Handle new members of window
1342 structure.
1343 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
1344 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
1345 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
1346 (Fset_window_prev_buffers, Fwindow_next_buffers)
1347 (Fset_window_next_buffers, Fset_window_clone_number): New
1348 functions.
1349 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
1350 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
1351 Doc-string fixes.
1352 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
1353 Argument WINDOW can be now internal window too.
1354 (Fwindow_use_time): Move up in code.
1355 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
1356 Rewrite doc-string.
1357 (Fset_window_configuration, saved_window)
1358 (Fcurrent_window_configuration, save_window_save): Handle new
1359 members of window structure.
1360 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
1361 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
1362 (syms_of_window): New Lisp objects Qrecord_window_buffer,
1363 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
1364 Qget_mru_window, Qresize_root_window,
1365 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
1366 Qauto_buffer_name; staticpro them.
1367
1368 2011-06-07 Martin Rudalics <rudalics@gmx.at>
1369
1370 * window.c (Fwindow_total_size, Fwindow_left_column)
1371 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
1372 (Fwindow_list_1): New functions.
1373 (window_box_text_cols): Replace with window_body_cols.
1374 (Fwindow_width, Fscroll_left, Fscroll_right): Use
1375 window_body_cols instead of window_box_text_cols.
1376 (delete_window, Fset_window_configuration): Call
1377 delete_all_subwindows with window as argument.
1378 (delete_all_subwindows): Take a window as argument and not a
1379 structure. Rewrite.
1380 (window_loop): Remove handling of GET_LRU_WINDOW and
1381 GET_LARGEST_WINDOW.
1382 (Fget_lru_window, Fget_largest_window): Move to window.el.
1383
1384 * window.h: Extern window_body_cols instead of
1385 window_box_text_cols. delete_all_subwindows now takes a
1386 Lisp_Object as argument.
1387
1388 * indent.c (compute_motion, Fcompute_motion): Use
1389 window_body_cols instead of window_box_text_cols.
1390
1391 * frame.c (delete_frame): Call delete_all_subwindows with root
1392 window as argument.
1393
1394 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
1395
1396 * fns.c (Fputhash): Document return value.
1397
1398 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
1399
1400 * image.c (gif_load): Implement gif89a spec "no disposal" method.
1401
1402 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
1403
1404 Cons<->int and similar integer overflow fixes (Bug#8794).
1405
1406 Check for overflow when converting integer to cons and back.
1407 * charset.c (Fdefine_charset_internal, Fdecode_char):
1408 Use cons_to_unsigned to catch overflow.
1409 (Fencode_char): Use INTEGER_TO_CONS.
1410 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
1411 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
1412 * data.c (long_to_cons, cons_to_long): Remove.
1413 (cons_to_unsigned, cons_to_signed): New functions.
1414 These signal an error for invalid or out-of-range values.
1415 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
1416 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
1417 * font.c (Ffont_variation_glyphs):
1418 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
1419 * lisp.h: Include <intprops.h>.
1420 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
1421 (cons_to_signed, cons_to_unsigned): New decls.
1422 (long_to_cons, cons_to_long): Remove decls.
1423 * undo.c (record_first_change): Use INTEGER_TO_CONS.
1424 (Fprimitive_undo): Use CONS_TO_INTEGER.
1425 * xfns.c (Fx_window_property): Likewise.
1426 * xselect.c: Include <limits.h>.
1427 (x_own_selection, selection_data_to_lisp_data):
1428 Use INTEGER_TO_CONS.
1429 (x_handle_selection_request, x_handle_selection_clear)
1430 (x_get_foreign_selection, Fx_disown_selection_internal)
1431 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
1432 (lisp_data_to_selection_data): Use cons_to_unsigned.
1433 (x_fill_property_data): Use cons_to_signed.
1434 Report values out of range.
1435
1436 Check for buffer and string overflow more precisely.
1437 * buffer.h (BUF_BYTES_MAX): New macro.
1438 * lisp.h (STRING_BYTES_MAX): New macro.
1439 * alloc.c (Fmake_string):
1440 * character.c (string_escape_byte8):
1441 * coding.c (coding_alloc_by_realloc):
1442 * doprnt.c (doprnt):
1443 * editfns.c (Fformat):
1444 * eval.c (verror):
1445 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
1446 since they may not be the same number.
1447 * editfns.c (Finsert_char):
1448 * fileio.c (Finsert_file_contents):
1449 Likewise for BUF_BYTES_MAX.
1450
1451 * image.c: Use ptrdiff_t, not int, for sizes.
1452 (slurp_file): Switch from int to ptrdiff_t.
1453 All uses changed.
1454 (slurp_file): Check that file size fits in both size_t (for
1455 malloc) and ptrdiff_t (for sanity and safety).
1456
1457 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
1458 if b->modtime has its maximal value.
1459
1460 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
1461
1462 Don't assume time_t can fit into int.
1463 * buffer.h (struct buffer.modtime): Now time_t, not int.
1464 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
1465 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
1466
1467 Minor fixes for signed vs unsigned integers.
1468 * character.h (MAYBE_UNIFY_CHAR):
1469 * charset.c (maybe_unify_char):
1470 * keyboard.c (read_char, reorder_modifiers):
1471 XINT -> XFASTINT, since the integer must be nonnegative.
1472 * ftfont.c (ftfont_spec_pattern):
1473 * keymap.c (access_keymap, silly_event_symbol_error):
1474 XUINT -> XFASTINT, since the integer must be nonnegative.
1475 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
1476 since it makes no difference and we prefer signed.
1477 * keyboard.c (record_char): Use XUINT when all the neighbors do.
1478 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
1479 nonnegative.
1480
1481 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
1482
1483 * window.h (Fwindow_frame): Declare.
1484
1485 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
1486
1487 * alloc.c: Simplify handling of large-request failures (Bug#8800).
1488 (SPARE_MEMORY): Always define.
1489 (LARGE_REQUEST): Remove.
1490 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
1491
1492 2011-06-06 Martin Rudalics <rudalics@gmx.at>
1493
1494 * lisp.h: Move EXFUNS for Fframe_root_window,
1495 Fframe_first_window and Fset_frame_selected_window to window.h.
1496
1497 * window.h: Move EXFUNS for Fframe_root_window,
1498 Fframe_first_window and Fset_frame_selected_window here from
1499 lisp.h.
1500
1501 * frame.c (Fwindow_frame, Fframe_first_window)
1502 (Fframe_root_window, Fframe_selected_window)
1503 (Fset_frame_selected_window): Move to window.c.
1504 (Factive_minibuffer_window): Move to minibuf.c.
1505 (Fother_visible_frames_p): New function.
1506
1507 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
1508
1509 * window.c (decode_window, decode_any_window): Move up in code.
1510 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
1511 (inhibit_frame_unsplittable): Remove unused variable.
1512 (Fwindow_buffer): Move up and rewrite doc-string.
1513 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
1514 (Fwindow_prev): New functions.
1515 (Fwindow_frame): Move here from frame.c. Accept any window as
1516 argument.
1517 (Fframe_root_window, Fframe_first_window)
1518 (Fframe_selected_window): Move here from frame.c. Accept frame
1519 or arbitrary window as argument. Update doc-strings.
1520 (Fminibuffer_window): Move up in code.
1521 (Fwindow_minibuffer_p): Move up in code and simplify.
1522 (Fset_frame_selected_window): Move here from frame.c.
1523 Marginal rewrite.
1524 (Fselected_window, select_window, Fselect_window): Move up in
1525 code. Minor doc-string fixes.
1526
1527 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
1528
1529 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
1530 Do not assume that spare memory exists; that assumption is valid
1531 only if SYSTEM_MALLOC.
1532 (LARGE_REQUEST): New macro, so that the issue of large requests
1533 is separated from the issue of spare memory.
1534
1535 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
1536
1537 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
1538 format. (Bug#8806)
1539
1540 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
1541
1542 * xfns.c (x_set_scroll_bar_default_width): Move declarations
1543 before statements.
1544
1545 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
1546
1547 * gtkutil.c (xg_get_default_scrollbar_width): New function.
1548
1549 * gtkutil.h: Declare xg_get_default_scrollbar_width.
1550
1551 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
1552 min width by calling x_set_scroll_bar_default_width (Bug#8505).
1553
1554 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
1555
1556 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
1557
1558 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
1559
1560 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
1561 (x_clipboard_manager_save): Add return value.
1562 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
1563 New error handlers.
1564 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
1565 Obey Vx_select_enable_clipboard_manager. Catch errors in
1566 x_clipboard_manager_save (Bug#8779).
1567 (Vx_select_enable_clipboard_manager): New variable.
1568 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
1569
1570 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
1571
1572 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
1573
1574 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1575
1576 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
1577 in the current matrix if keep_current_p is non-zero.
1578
1579 2011-06-04 Eli Zaretskii <eliz@gnu.org>
1580
1581 * bidi.c (bidi_level_of_next_char): Fix last change.
1582
1583 2011-06-03 Eli Zaretskii <eliz@gnu.org>
1584
1585 Support bidi reordering of text covered by display properties.
1586
1587 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
1588 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
1589 (bidi_cache_search, bidi_cache_iterator_state)
1590 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
1591 (bidi_level_of_next_char, bidi_move_to_visually_next):
1592 Support character positions inside a run of characters covered by a
1593 display string.
1594 (bidi_paragraph_init, bidi_resolve_explicit_1)
1595 (bidi_level_of_next_char): Call bidi_fetch_char and
1596 bidi_fetch_char_advance instead of FETCH_CHAR and
1597 FETCH_CHAR_ADVANCE.
1598 (bidi_init_it): Initialize new members.
1599 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
1600 definitions.
1601 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
1602 instead of using explicit *_CHAR codes.
1603 (bidi_resolve_explicit, bidi_resolve_weak):
1604 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
1605 bidirectional text is supported only in multibyte buffers.
1606 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
1607 it to initialize the frame_window_p member of struct bidi_it.
1608 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
1609 (bidi_resolve_explicit, bidi_resolve_weak)
1610 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
1611 bidi_it->nchars is non-positive.
1612 (bidi_level_of_next_char): Don't try to lookup the cache for the
1613 next/previous character if nothing is cached there yet, or if we
1614 were just reseat()'ed to a new position.
1615
1616 * xdisp.c (set_cursor_from_row): Set start and stop points
1617 according to the row's direction when priming the loop that looks
1618 for the glyph on which to display cursor.
1619 (single_display_spec_intangible_p): Function deleted.
1620 (display_prop_intangible_p): Reimplement to call
1621 handle_display_spec instead of single_display_spec_intangible_p.
1622 Accept 3 additional arguments needed by handle_display_spec.
1623 This fixes incorrect cursor motion across display property with complex
1624 values: lists, `(when COND...)' forms, etc.
1625 (single_display_spec_string_p): Support property values that are
1626 lists with the argument STRING its top-level element.
1627 (display_prop_string_p): Fix the condition for processing a
1628 property that is a list to be consistent with handle_display_spec.
1629 (handle_display_spec): New function, refactored from the
1630 last portion of handle_display_prop.
1631 (compute_display_string_pos): Accept additional argument
1632 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
1633 value of a `display' property is a "replacing spec".
1634 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
1635 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
1636 the display property, but just return a value indicating whether
1637 the display property will replace the characters it covers.
1638 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
1639 frame_window_p members of struct bidi_it.
1640 (compute_display_string_pos, compute_display_string_end):
1641 New functions.
1642 (push_it): Accept second argument POSITION, where pop_it should
1643 jump to continue iteration.
1644 (reseat_1): Initialize bidi_it.disp_pos.
1645
1646 * keyboard.c (adjust_point_for_property): Adjust the call to
1647 display_prop_intangible_p to its new signature.
1648
1649 * dispextern.h (struct bidi_it): New member frame_window_p.
1650 (bidi_init_it): Update prototypes.
1651 (display_prop_intangible_p): Update prototype.
1652 (compute_display_string_pos, compute_display_string_end):
1653 Declare prototypes.
1654 (struct bidi_it): New members nchars and disp_pos. ch_len is now
1655 EMACS_INT.
1656
1657 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
1658
1659 Malloc failure behavior now depends on size of allocation.
1660 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
1661 * lisp.h: Change signatures accordingly.
1662 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
1663 All callers changed. (Bug#8762)
1664
1665 * gnutls.c: Use Emacs's memory allocators.
1666 Without this change, the gnutls library would invoke malloc etc.
1667 directly, which causes problems on non-SYNC_INPUT hosts, and which
1668 runs afoul of improving memory_full behavior. (Bug#8761)
1669 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
1670 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
1671 xfree instead of the default malloc, realloc, free.
1672 (Fgnutls_boot): No need to check for memory allocation failure,
1673 since xmalloc does that for us.
1674
1675 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
1676 * category.c (hash_get_category_set):
1677 * ccl.c (ccl_driver):
1678 * charset.c (Fdefine_charset_internal):
1679 * charset.h (struct charset.hash_index):
1680 * composite.c (get_composition_id, gstring_lookup_cache)
1681 (composition_gstring_put_cache):
1682 * composite.h (struct composition.hash_index):
1683 * dispextern.h (struct image.hash):
1684 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
1685 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1686 (hashfn_equal, hashfn_user_defined, make_hash_table)
1687 (maybe_resize_hash_table, hash_lookup, hash_put)
1688 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
1689 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
1690 (Fsxhash, Fgethash, Fputhash, Fmaphash):
1691 * image.c (make_image, search_image_cache, lookup_image)
1692 (xpm_put_color_table_h):
1693 * lisp.h (struct Lisp_Hash_Table):
1694 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
1695 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
1696 for hashes and hash indexes, instead of 'unsigned' and 'int'.
1697 * alloc.c (allocate_vectorlike):
1698 Check for overflow in vector size calculations.
1699 * ccl.c (ccl_driver):
1700 Check for overflow when converting EMACS_INT to int.
1701 * fns.c, image.c: Remove unnecessary static decls that would otherwise
1702 need to be updated by these changes.
1703 * fns.c (make_hash_table, maybe_resize_hash_table):
1704 Check for integer overflow with large hash tables.
1705 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
1706 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
1707 (SXHASH_REDUCE): New macro.
1708 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
1709 Use it instead of discarding useful hash info with large hash values.
1710 (sxhash_float): New function.
1711 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
1712 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
1713 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
1714 Rewrite to use FIXNUM_BITS, as this simplifies things.
1715 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
1716 Adjust signatures to match updated version of code.
1717 (consing_since_gc): Now EMACS_INT, since a single hash table can
1718 use more than INT_MAX bytes.
1719
1720 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
1721
1722 Make it possible to build with GCC-4.6+ -O2 -flto.
1723
1724 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
1725
1726 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
1727
1728 * minibuf.c (get_minibuffer, read_minibuf_unwind):
1729 Call minibuffer-inactive-mode.
1730
1731 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
1732
1733 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
1734 Update dependencies.
1735
1736 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
1737
1738 * data.c (init_data): Remove code for UTS, this system is not
1739 supported anymore.
1740
1741 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
1742
1743 Don't force ./temacs to start in terminal mode.
1744
1745 * frame.c (make_initial_frame): Initialize faces in all cases, not
1746 only when CANNOT_DUMP is defined.
1747 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
1748
1749 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
1750
1751 * dispnew.c (add_window_display_history): Use const for the string
1752 pointer. Remove declaration, not needed.
1753
1754 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
1755
1756 Use 'inline', not 'INLINE'.
1757 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
1758 * alloc.c, fontset.c (INLINE): Remove.
1759 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
1760 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
1761 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
1762 * gmalloc.c (register_heapinfo): Use inline unconditionally.
1763 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
1764
1765 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
1766
1767 Make it possible to run ./temacs.
1768
1769 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
1770 syms_of_callproc does the same thing. Remove test for
1771 "initialized", do it in the caller.
1772 * emacs.c (main): Avoid calling set_initial_environment when dumping.
1773
1774 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
1775
1776 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
1777 (read_minibuf): Use get_minibuffer.
1778 (syms_of_minibuf): Use DEFSYM.
1779 (Qmetadata): New var.
1780 * data.c (Qbuffer): Don't make it static.
1781 (syms_of_data): Use DEFSYM.
1782
1783 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
1784
1785 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
1786 (CCL_CODE_MIN): New macro.
1787
1788 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
1789
1790 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
1791
1792 * eval.c (Qdebug): Now static.
1793 * lisp.h (Qdebug): Remove decl. This reverts a part of the
1794 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
1795 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
1796
1797 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
1798
1799 * image.c: Various fixes to ImageMagick code comments.
1800 (Fimagemagick_types): Doc fix.
1801
1802 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
1803
1804 Minor fixes prompted by GCC 4.6.0 warnings.
1805
1806 * xselect.c (converted_selections, conversion_fail_tag): Now static.
1807
1808 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
1809 (x_clipboard_manager_save_all): Move extern decl to ...
1810 * xterm.h: ... here, so that it can be checked for consistency.
1811
1812 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
1813
1814 * xselect.c (x_clipboard_manager_save_frame)
1815 (x_clipboard_manager_save_all): New functions.
1816 (Fx_clipboard_manager_save): Lisp function deleted.
1817
1818 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
1819 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
1820
1821 * xterm.h: Update prototype.
1822
1823 2011-05-28 William Xu <william.xwl@gmail.com>
1824
1825 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
1826 exiting (Bug#8239).
1827
1828 2011-05-28 Jim Meyering <meyering@redhat.com>
1829
1830 Avoid a sign-extension bug in crypto_hash_function.
1831 * fns.c (to_uchar): Define.
1832 (crypto_hash_function): Use it to convert some newly-signed
1833 variables to unsigned, to avoid sign-extension bugs. For example,
1834 without this change, (md5 "truc") would evaluate to
1835 45723a2aff78ff4fff7fff1114760e62 rather than the expected
1836 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
1837 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
1838
1839 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
1840
1841 Integer overflow fixes.
1842
1843 * dbusbind.c: Serial number integer overflow fixes.
1844 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
1845 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
1846 to hold a serial number that is too large for a fixnum.
1847 (Fdbus_method_return_internal, Fdbus_method_error_internal):
1848 Check for serial numbers out of range. Decode any serial number
1849 that was so large that it became a float. (Bug#8722)
1850
1851 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
1852 (Fdbus_call_method, Fdbus_call_method_asynchronously):
1853 Use XFASTINT rather than XUINT when numbers are nonnegative.
1854 (xd_append_arg, Fdbus_method_return_internal):
1855 (Fdbus_method_error_internal): Likewise. Also, for unsigned
1856 arguments, check that Lisp number is nonnegative, rather than
1857 silently wrapping negative numbers around. (Bug#8722)
1858 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
1859 (Bug#8722)
1860
1861 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
1862
1863 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
1864
1865 ccl: add integer overflow checks
1866 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
1867 (IN_INT_RANGE): New macros.
1868 (ccl_driver): Use them to check for integer overflow when
1869 decoding a CCL program. Many of the new checks are whether XINT (x)
1870 fits in int; it doesn't always, on 64-bit hosts. The new version
1871 doesn't catch all possible integer overflows, but it's an
1872 improvement. (Bug#8719)
1873
1874 * alloc.c (make_event_array): Use XINT, not XUINT.
1875 There's no need for unsigned here.
1876
1877 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
1878 This follows up to the 2011-05-06 change that substituted uintptr_t
1879 for EMACS_INT. This case wasn't caught back then.
1880
1881 Rework Fformat to avoid integer overflow issues.
1882 * editfns.c: Include <float.h> unconditionally, as it's everywhere
1883 now (part of C89). Include <verify.h>.
1884 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
1885 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
1886 (Fformat): Avoid the prepass trying to compute sizes; it was only
1887 approximate and thus did not catch overflow reliably. Instead, walk
1888 through the format just once, formatting and computing sizes as we go,
1889 checking for integer overflow at every step, and allocating a larger
1890 buffer as needed. Keep track separately whether the format is
1891 multibyte. Keep only the most-recently calculated precision, rather
1892 than them all. Record whether each argument has been converted to
1893 string. Use EMACS_INT, not int, for byte and char and arg counts.
1894 Support field widths and precisions larger than INT_MAX. Avoid
1895 sprintf's undefined behavior with conversion specifications such as %#d
1896 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
1897 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
1898 formatting out-of-range floating point numbers with int
1899 formats. (Bug#8668)
1900
1901 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
1902
1903 * data.c: Avoid integer truncation in expressions involving floats.
1904 * data.c: Include <intprops.h>.
1905 (arith_driver): When there's an integer overflow in an expression
1906 involving floating point, convert the integers to floating point
1907 so that the resulting value does not suffer from catastrophic
1908 integer truncation. For example, on a 64-bit host (* 4
1909 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
1910 Do not rely on undefined behavior after integer overflow.
1911
1912 merge count_size_as_multibyte, parse_str_to_multibyte
1913 * character.c, character.h (count_size_as_multibyte):
1914 Rename from parse_str_to_multibyte; all uses changed.
1915 Check for integer overflow.
1916 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
1917 since it's now a duplicate of the other. This is more of
1918 a character than a buffer op, so better that it's in character.c.
1919 * fns.c, print.c: Adjust to above changes.
1920
1921 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
1922
1923 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
1924
1925 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
1926
1927 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
1928 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
1929 (x_clipboard_manager_save): Now static.
1930 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
1931
1932 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
1933 (crypto_hash_function): Now static.
1934 Fix pointer signedness problems. Avoid unnecessary initializations.
1935
1936 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
1937
1938 * termhooks.h (Vselection_alist): Make it terminal-local.
1939
1940 * terminal.c (create_terminal): Initialize it.
1941
1942 * xselect.c: Support for clipboard managers.
1943 (Vselection_alist): Move to termhooks.h as terminal-local var.
1944 (LOCAL_SELECTION): New macro.
1945 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
1946 (symbol_to_x_atom): Remove gratuitous arg.
1947 (x_handle_selection_request, lisp_data_to_selection_data)
1948 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
1949 (x_own_selection, x_get_local_selection, x_convert_selection):
1950 New arg, specifying work frame. Use terminal-local Vselection_alist.
1951 (some_frame_on_display): Delete unused function.
1952 (Fx_own_selection_internal, Fx_get_selection_internal)
1953 (Fx_disown_selection_internal, Fx_selection_owner_p)
1954 (Fx_selection_exists_p): New optional frame arg.
1955 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
1956 (x_handle_selection_clear): Don't treat other terminals with the
1957 same keyboard specially. Use the terminal-local Vselection_alist.
1958 (x_clear_frame_selections): Use Frun_hook_with_args.
1959
1960 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
1961
1962 * xterm.h: Add support for those atoms.
1963
1964 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
1965
1966 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
1967 (converted_selections, conversion_fail_tag): New global variables.
1968 (x_selection_request_lisp_error): Free the above.
1969 (x_get_local_selection): Remove unnecessary code.
1970 (x_reply_selection_request): Args changed; handle arbitrary array
1971 of converted selections stored in converted_selections.
1972 Separate the XChangeProperty and SelectionNotify steps.
1973 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
1974 (x_convert_selection): New function.
1975 (x_handle_selection_event): Simplify.
1976 (x_get_foreign_selection): Don't ignore incoming requests while
1977 waiting for an answer; this will fail when we implement
1978 SAVE_TARGETS, and seems unnecessary anyway.
1979 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
1980 (Vx_sent_selection_functions): Doc fix.
1981
1982 2011-05-26 Leo Liu <sdl.web@gmail.com>
1983
1984 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
1985
1986 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1987
1988 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
1989
1990 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
1991 for fringe update if it has periodic bitmap.
1992 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
1993 and fringe_bitmap_periodic_p.
1994
1995 * fringe.c (get_fringe_bitmap_data): New function.
1996 (draw_fringe_bitmap_1, update_window_fringes): Use it.
1997 (update_window_fringes): Record periodicity of fringe bitmap in glyph
1998 row. Mark glyph row for fringe update if periodicity changed.
1999
2000 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
2001 for fringe update unless it has periodic bitmap.
2002
2003 2011-05-25 Kenichi Handa <handa@m17n.org>
2004
2005 * xdisp.c (get_next_display_element): Set correct it->face_id for
2006 a static composition.
2007
2008 2011-05-24 Leo Liu <sdl.web@gmail.com>
2009
2010 * deps.mk (fns.o):
2011 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
2012
2013 * fns.c (crypto_hash_function, Fsha1): New function.
2014 (Fmd5): Use crypto_hash_function.
2015 (syms_of_fns): Add Ssha1.
2016
2017 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
2018
2019 * gnutls.c: Remove unused macros.
2020 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
2021 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
2022 Remove macros that are defined and never used.
2023 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
2024
2025 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
2026
2027 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
2028 (Fx_get_selection_internal): Minor cleanup.
2029 (Fx_own_selection_internal): Rename arguments for consistency with
2030 select.el.
2031
2032 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
2033
2034 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
2035
2036 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
2037
2038 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
2039
2040 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2041
2042 * dispnew.c (scrolling_window): Don't exclude the case that the
2043 last enabled row in the desired matrix touches the bottom boundary.
2044
2045 2011-05-21 Glenn Morris <rgm@gnu.org>
2046
2047 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
2048 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
2049 and add some more files.
2050
2051 2011-05-20 Eli Zaretskii <eliz@gnu.org>
2052
2053 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
2054 report_file_error introduced by the change from 2011-05-07.
2055
2056 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
2057
2058 * systime.h (Time): Define only if emacs is defined.
2059 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
2060 where the include path doesn't have X11/X.h by default. See
2061 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
2062
2063 2011-05-20 Kenichi Handa <handa@m17n.org>
2064
2065 * composite.c (find_automatic_composition): Fix previous change.
2066
2067 2011-05-20 Glenn Morris <rgm@gnu.org>
2068
2069 * lisp.mk: New file, split from Makefile.in.
2070 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
2071 (shortlisp): Remove.
2072 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
2073
2074 2011-05-19 Glenn Morris <rgm@gnu.org>
2075
2076 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
2077 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
2078 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
2079 (lisp): Set the order to that of loadup.el.
2080 (shortlisp): Make it a copy of $lisp.
2081 (SOME_MACHINE_LISP): Remove.
2082 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
2083 Use just $shortlisp, not $SOME_MACHINE_LISP too.
2084
2085 2011-05-18 Kenichi Handa <handa@m17n.org>
2086
2087 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
2088 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
2089 (find_automatic_composition): Mostly rewrite for efficiency.
2090
2091 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
2092
2093 * makefile.w32-in: Update dependencies.
2094
2095 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
2096
2097 * menu.c: Include limits.h (fixes the MS-Windows build broken by
2098 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
2099
2100 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
2101
2102 Fix some integer overflow issues, such as string length overflow.
2103
2104 * insdel.c (count_size_as_multibyte): Check for string overflow.
2105
2106 * character.c (lisp_string_width): Check for string overflow.
2107 Use EMACS_INT, not int, for string indexes and lengths; in
2108 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
2109 the resulting string length overflows an EMACS_INT; instead,
2110 report a string overflow if no precision given. When checking for
2111 precision exhaustion, use a check that cannot possibly have
2112 integer overflow. (Bug#8675)
2113 * character.h (lisp_string_width): Adjust to new signature.
2114
2115 * alloc.c (string_overflow): New function.
2116 (Fmake_string): Use it. This doesn't change behavior, but saves
2117 a few bytes and will simplify future changes.
2118 * character.c (string_escape_byte8): Likewise.
2119 * lisp.h (string_overflow): New decl.
2120
2121 Fixups, following up to the user-interface timestamp change.
2122 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
2123 for UI timestamps, instead of unsigned long.
2124 * msdos.c (mouse_get_pos): Likewise.
2125 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
2126 * w32gui.h (Time): Define by including "systime.h" rather than by
2127 declaring it ourselves. (Bug#8664)
2128
2129 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
2130 * image.c (clear_image_cache): Likewise.
2131
2132 * term.c (term_mouse_position): Don't assume time_t wraparound.
2133
2134 Be more systematic about user-interface timestamps.
2135 Before, the code sometimes used 'Time', sometimes 'unsigned long',
2136 and sometimes 'EMACS_UINT', to represent these timestamps.
2137 This change causes it to use 'Time' uniformly, as that's what X uses.
2138 This makes the code easier to follow, and makes it easier to catch
2139 integer overflow bugs such as Bug#8664.
2140 * frame.c (Fmouse_position, Fmouse_pixel_position):
2141 Use Time, not unsigned long, for user-interface timestamps.
2142 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
2143 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
2144 * keyboard.h (last_event_timestamp): Likewise.
2145 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
2146 * menu.h (xmenu_show): Likewise.
2147 * term.c (term_mouse_position): Likewise.
2148 * termhooks.h (struct input_event.timestamp): Likewise.
2149 (struct terminal.mouse_position_hook): Likewise.
2150 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
2151 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
2152 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
2153 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
2154 what it was before.
2155 * menu.h, termhooks.h: Include "systime.h", for Time.
2156
2157 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
2158 Don't assume that the difference between two unsigned long values
2159 can fit into an integer. At this point, we know button_down_time
2160 <= event->timestamp, so the difference must be nonnegative, so
2161 there's no need to cast the result if double-click-time is
2162 nonnegative, as it should be; check that it's nonnegative, just in
2163 case. This bug is triggered when events are more than 2**31 ms
2164 apart (about 25 days). (Bug#8664)
2165
2166 * xselect.c (last_event_timestamp): Remove duplicate decl.
2167 (x_own_selection): Remove needless cast to unsigned long.
2168
2169 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
2170 that always fit in int. Use a sentinel instead of a counter, to
2171 avoid a temp and to allay GCC's concerns about possible int overflow.
2172 * frame.h (struct frame): Use int for menu_bar_items_used
2173 instead of EMACS_INT, since it always fits in int.
2174
2175 * menu.c (grow_menu_items): Check for int overflow.
2176
2177 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
2178
2179 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
2180 Before, the code was not consistent. These values cannot exceed
2181 2**31 - 1 so there's no need to make them unsigned.
2182 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
2183 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
2184 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
2185 as modifiers.
2186 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
2187
2188 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
2189 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
2190 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
2191 presumably because the widths might not match.
2192
2193 * window.c (size_window): Avoid needless test at loop start.
2194
2195 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
2196
2197 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
2198
2199 2011-05-12 Drew Adams <drew.adams@oracle.com>
2200
2201 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
2202
2203 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2204
2205 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
2206 `width' to `bar_area_x' and `bar_area_width', respectively.
2207 (x_scroll_run): Take account of fringe background extension.
2208
2209 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
2210 Rename local vars `left' and `width' to `bar_area_x' and
2211 `bar_area_width', respectively.
2212 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
2213 background extension.
2214
2215 2011-05-10 Jim Meyering <meyering@redhat.com>
2216
2217 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
2218
2219 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
2220
2221 * image.c (Finit_image_library): Return t for built-in image types,
2222 like pbm and xbm. (Bug#8640)
2223
2224 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
2225
2226 * w32menu.c (set_frame_menubar): Fix submenu allocation.
2227
2228 2011-05-07 Eli Zaretskii <eliz@gnu.org>
2229
2230 * w32console.c (Fset_screen_color): Doc fix.
2231 (Fget_screen_color): New function.
2232 (syms_of_ntterm): Defsubr it.
2233
2234 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
2235 unlink the temporary file if Fcall_process didn't create it in the
2236 first place.
2237 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
2238 child process will be redirected to a file specified with `:file'.
2239 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
2240 cue to call_process_cleanup not to close that handle.
2241
2242 2011-05-07 Ben Key <bkey76@gmail.com>
2243
2244 * makefile.w32-in: The bootstrap-temacs rule now makes use of
2245 one of two shell specific rules, either bootstrap-temacs-CMD or
2246 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
2247 to the previous implementation of the bootstrap-temacs rule.
2248 The bootstrap-temacs-CMD rule is similar to the previous
2249 implementation of the bootstrap-temacs rule except that it
2250 makes use of the ESC_CFLAGS variable instead of the CFLAGS
2251 variable.
2252
2253 These changes, along with some changes to nt/configure.bat,
2254 nt/gmake.defs, and nt/nmake.defs, are required to extend my
2255 earlier fix to add support for --cflags and --ldflags options
2256 that include quotes so that it works whether make uses cmd or
2257 sh as the shell.
2258
2259 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
2260
2261 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
2262 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
2263 is a constant.
2264 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
2265 a string. Handle both cases.
2266 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
2267 (Fdbus_register_method): Use Qinvalid_function.
2268
2269 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
2270
2271 * makefile.w32-in: Update dependencies.
2272 (LISP_H): Add inttypes.h and stdin.h.
2273 (PROCESS_H): Add unistd.h.
2274
2275 2011-05-06 Eli Zaretskii <eliz@gnu.org>
2276
2277 * lread.c: Include limits.h (fixes the MS-Windows build broken by
2278 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
2279
2280 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
2281
2282 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
2283
2284 * term.c (vfatal): Remove stray call to va_end.
2285 It's not needed and the C Standard doesn't allow it here anyway.
2286
2287 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
2288 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
2289
2290 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
2291 bytes.
2292
2293 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
2294
2295 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
2296
2297 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
2298
2299 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
2300
2301 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
2302
2303 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
2304 * charset.c (Fdefine_charset_internal): Don't initialize
2305 charset.code_space[15]. The value was garbage, on hosts with
2306 32-bit int (Bug#8600).
2307
2308 * lread.c (read_integer): Be more consistent with string-to-number.
2309 Use string_to_number to do the actual conversion; this avoids
2310 rounding errors and fixes some other screwups. Without this fix,
2311 for example, #x1fffffffffffffff was misread as -2305843009213693952.
2312 (digit_to_number): Move earlier, for benefit of read_integer.
2313 Return -1 if the digit is out of range for the base, -2 if it is
2314 not a digit in any supported base. (Bug#8602)
2315
2316 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
2317
2318 * dispnew.c (scrolling_window): Return 1 if we scrolled,
2319 to match comment at start of function. This also removes a
2320 GCC warning about overflow in a 32+64-bit port.
2321
2322 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
2323
2324 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
2325 Reported by Stefan Monnier in
2326 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
2327 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
2328 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
2329
2330 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
2331 (EMACS_UINTPTR): Likewise, with uintptr_t.
2332
2333 * lisp.h: Prefer 64-bit EMACS_INT if available.
2334 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
2335 on 32-bit hosts that have 64-bit int, so that they can access
2336 large files.
2337 However, temporarily disable this change unless the temporary
2338 symbol WIDE_EMACS_INT is defined.
2339
2340 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
2341
2342 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
2343 This removes an assumption that EMACS_INT and long are the same
2344 width as pointers. The assumption is true for Emacs porting targets
2345 now, but we want to make other targets possible.
2346 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
2347 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
2348 In the rest of the code, change types of integers that hold casted
2349 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
2350 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
2351 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
2352 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
2353 No need to cast type when ORing.
2354 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
2355 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
2356 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
2357 assume EMACS_INT is the same width as char *.
2358 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
2359 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
2360 Remove no-longer-needed casts.
2361 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
2362 (xg_tool_bar_help_callback, xg_make_tool_item):
2363 Use EMACS_INTPTR to hold an integer
2364 that will be cast to void *; this can avoid a GCC warning
2365 if EMACS_INT is not the same width as void *.
2366 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
2367 * xdisp.c (display_echo_area_1, resize_mini_window_1):
2368 (current_message_1, set_message_1):
2369 Use a local to convert to proper width without a cast.
2370 * xmenu.c (dialog_selection_callback): Likewise.
2371
2372 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
2373 Also, don't assume VALBITS / RAND_BITS is less than 5,
2374 and don't rely on undefined behavior when shifting a 1 left into
2375 the sign bit.
2376 * lisp.h (get_random): Change signature to match.
2377
2378 * lread.c (hash_string): Use size_t, not int, for hash computation.
2379 Normally we prefer signed values; but hashing is special, because
2380 it's better to use unsigned division on hash table sizes so that
2381 the remainder is nonnegative. Also, size_t is the natural width
2382 for hashing into memory. The previous code used 'int', which doesn't
2383 retain enough info to hash well into very large tables.
2384 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
2385
2386 * dbusbind.c: Don't possibly lose pointer info when converting.
2387 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
2388 Use XPNTR rather than XHASH, so that the high-order bits of
2389 the pointer aren't lost when converting through void *.
2390
2391 * eval.c (Fautoload): Don't double-shift a pointer.
2392
2393 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
2394
2395 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
2396
2397 * gnutls.c (DEF_GNUTLS_FN):
2398 * image.c (DEF_IMGLIB_FN): Make function pointers static.
2399
2400 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
2401
2402 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
2403 marker. (Bug#8610)
2404
2405 2011-05-05 Eli Zaretskii <eliz@gnu.org>
2406
2407 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
2408 New version that can reserve upto 2GB of heap space.
2409
2410 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
2411
2412 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
2413
2414 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
2415
2416 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
2417 `gnutls_certificate_set_x509_key_file'.
2418
2419 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
2420
2421 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
2422 Update dependencies.
2423
2424 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
2425
2426 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
2427 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
2428 Remove unused parameter `fildes'.
2429 * process.c (read_process_output, send_process): Don't pass it.
2430
2431 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
2432
2433 Fix previous change: the library cache is defined in w32.c.
2434 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
2435 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
2436
2437 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
2438
2439 Implement dynamic loading of GnuTLS on Windows.
2440
2441 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
2442 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
2443 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
2444 Declare.
2445
2446 * gnutls.c (Qgnutls_dll): Define.
2447 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
2448 (gnutls_*): Declare function pointers.
2449 (init_gnutls_functions): New function to initialize function pointers.
2450 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
2451 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
2452 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
2453 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
2454 (emacs_gnutls_write, emacs_gnutls_read)
2455 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
2456 (Fgnutls_available_p): New function.
2457 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
2458 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
2459 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
2460
2461 * image.c: Include w32.h.
2462 (Vimage_type_cache): Delete.
2463 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
2464 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
2465 (w32_delayed_load): Move to w32.c.
2466
2467 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
2468
2469 * w32.c (QCloaded_from, Vlibrary_cache): Define.
2470 (w32_delayed_load): Move from image.c. When loading a library, record
2471 its filename in the :loaded-from property of the library id.
2472 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
2473 Initialize and staticpro them.
2474 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
2475
2476 * process.c: Include lisp.h before w32.h, not after.
2477 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
2478 instead of gnutls_record_check_pending.
2479
2480 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
2481
2482 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
2483
2484 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
2485 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
2486 as passed in.
2487
2488 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
2489
2490 * xterm.c (x_set_frame_alpha): Do not set property on anything
2491 else than FRAME_X_OUTER_WINDOW (Bug#8608).
2492
2493 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
2494
2495 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
2496
2497 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
2498
2499 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
2500 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
2501 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
2502 (gnutls_global_initialized, Qgnutls_bootprop_priority)
2503 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
2504 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
2505 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
2506 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
2507 (Qgnutls_bootprop_callbacks_verify): Make static.
2508
2509 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
2510
2511 * callproc.c: Indentation fixup.
2512
2513 * sysdep.c (wait_for_termination_1): Make static.
2514 (wait_for_termination, interruptible_wait_for_termination):
2515 Move after wait_for_termination_1.
2516
2517 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
2518
2519 * sysdep.c (interruptible_wait_for_termination): New function
2520 which is like wait_for_termination, but allows keyboard
2521 interruptions.
2522
2523 * callproc.c (Fcall_process): Add (:file "file") as an option for
2524 the STDOUT buffer.
2525 (Fcall_process_region): Ditto.
2526
2527 2011-04-30 Eli Zaretskii <eliz@gnu.org>
2528
2529 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
2530 rather than `XVECTOR (FOO)->size'.
2531
2532 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
2533 inttypes.h, as a gnulib replacement is used if it not available in
2534 system headers.
2535
2536 2011-04-21 Eli Zaretskii <eliz@gnu.org>
2537
2538 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
2539 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
2540 of MOST_POSITIVE_FIXNUM. (Bug#8528)
2541
2542 * coding.c (coding_alloc_by_realloc): Error out if destination
2543 will grow beyond MOST_POSITIVE_FIXNUM.
2544 (decode_coding_emacs_mule): Abort if there isn't enough place in
2545 charbuf for the composition carryover bytes. Reserve an extra
2546 space for up to 2 characters produced in a loop.
2547 (decode_coding_iso_2022): Abort if there isn't enough place in
2548 charbuf for the composition carryover bytes.
2549
2550 2011-04-21 Eli Zaretskii <eliz@gnu.org>
2551
2552 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
2553 aborting when %lld or %lll format is passed.
2554 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
2555 %llo or %llx format is passed. (Bug#8545)
2556
2557 * window.c (window_scroll_line_based): Use a marker instead of
2558 simple variables to record original value of point. (Bug#7952)
2559
2560 * doprnt.c (doprnt): Fix the case where a multibyte sequence
2561 produced by %s or %c overflows available buffer space. (Bug#8545)
2562
2563 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
2564
2565 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
2566 (SIZE_MAX): Move defn after all includes, as they might #define it.
2567
2568 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
2569
2570 * w32.c (init_environment): Warn about defaulting HOME to C:\.
2571
2572 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
2573
2574 * keyboard.c (Qdelayed_warnings_hook): Define.
2575 (command_loop_1): Run `delayed-warnings-hook'
2576 if Vdelayed_warnings_list is non-nil.
2577 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
2578 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
2579
2580 2011-04-28 Eli Zaretskii <eliz@gnu.org>
2581
2582 * doprnt.c (doprnt): Don't return value smaller than the buffer
2583 size if the message was truncated. (Bug#8545).
2584
2585 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
2586
2587 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
2588 (Fx_window_property): #if-0 the whole functions, not just the bodies.
2589
2590 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
2591
2592 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
2593
2594 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
2595
2596 * makefile.w32-in: Update dependencies.
2597
2598 2011-04-27 Eli Zaretskii <eliz@gnu.org>
2599
2600 Improve `doprnt' and its usage. (Bug#8545)
2601 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
2602 `format_end'. Remove support for %l as a conversion specifier.
2603 Don't use xrealloc. Improve diagnostics when the %l size modifier
2604 is used. Update the commentary.
2605
2606 * eval.c (verror): Simplify calculation of size_t.
2607
2608 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
2609 messages.
2610
2611 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
2612
2613 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
2614 change.
2615
2616 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
2617
2618 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
2619 This makes this file independent of the recent pseudovector change.
2620
2621 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
2622
2623 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
2624
2625 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
2626 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
2627 Remove unused local.
2628 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
2629
2630 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
2631 GCC 4.6.0 optimizes based on type-based alias analysis.
2632 For example, if b is of type struct buffer * and v of type struct
2633 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
2634 != &v->size, and therefore "v->size = 1; b->size = 2; return
2635 v->size;" must therefore return 1. This assumption is incorrect
2636 for Emacs, since it type-puns struct Lisp_Vector * with many other
2637 types. To fix this problem, this patch adds a new type struct
2638 vectorlike_header that documents the constraints on layout of vectors
2639 and pseudovectors, and helps optimizing compilers not get fooled
2640 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
2641 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
2642 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
2643 the size member.
2644 (XSETPVECTYPE): Rewrite in terms of new macro.
2645 (XSETPVECTYPESIZE): New macro, specifying both type and size.
2646 This is a bit clearer, and further avoids the possibility of
2647 undesirable aliasing.
2648 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
2649 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
2650 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
2651 since Lisp_Subr is a special case (no "next" field).
2652 (ASIZE): Now uses header.size rather than size.
2653 All previous uses of XVECTOR (foo)->size replaced to use this macro,
2654 to avoid the hassle of writing XVECTOR (foo)->header.size.
2655 (struct vectorlike_header): New type.
2656 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
2657 object, to help avoid aliasing.
2658 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
2659 (SUBRP): Likewise, since Lisp_Subr is a special case.
2660 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
2661 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
2662 (struct Lisp_Hash_Table): Combine first two members into a single
2663 struct vectorlike_header member. All uses of "size" and "next" members
2664 changed to be "header.size" and "header.next".
2665 * buffer.h (struct buffer): Likewise.
2666 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
2667 * frame.h (struct frame): Likewise.
2668 * process.h (struct Lisp_Process): Likewise.
2669 * termhooks.h (struct terminal): Likewise.
2670 * window.c (struct save_window_data, struct saved_window): Likewise.
2671 * window.h (struct window): Likewise.
2672 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
2673 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
2674 * buffer.c (init_buffer_once): Likewise.
2675 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
2676 special case.
2677 * process.c (Fformat_network_address): Use local var for size,
2678 for brevity.
2679
2680 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
2681
2682 Make the Lisp reader and string-to-float more consistent (Bug#8525)
2683 * data.c (atof): Remove decl; no longer used or needed.
2684 (digit_to_number): Move to lread.c.
2685 (Fstring_to_number): Use new string_to_number function, to be
2686 consistent with how the Lisp reader treats infinities and NaNs.
2687 Do not assume that floating-point numbers represent EMACS_INT
2688 without losing information; this is not true on most 64-bit hosts.
2689 Avoid double-rounding errors, by insisting on integers when
2690 parsing non-base-10 numbers, as the documentation specifies.
2691 * lisp.h (string_to_number): New decl, replacing ...
2692 (isfloat_string): Remove.
2693 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
2694 (read1): Do not accept +. and -. as integers; this
2695 appears to have been a coding error. Similarly, do not accept
2696 strings like +-1e0 as floating point numbers. Do not report
2697 overflow for integer overflows unless the base is not 10 which
2698 means we have no simple and reliable way to continue.
2699 Break out the floating-point parsing into a new
2700 function string_to_number, so that Fstring_to_number parses
2701 floating point numbers consistently with the Lisp reader.
2702 (digit_to_number): Move here from data.c. Make it static inline.
2703 (E_CHAR, EXP_INT): Remove, replacing with ...
2704 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
2705 (string_to_number): New function, replacing isfloat_string.
2706 This function checks for valid syntax and produces the resulting
2707 Lisp float number too. Rework it so that string-to-number
2708 no longer mishandles examples like "1.0e+". Use strtoumax,
2709 so that overflow for non-base-10 numbers is reported only when
2710 there's no portable and simple way to convert to floating point.
2711
2712 * textprop.c (set_text_properties_1): Rewrite for clarity,
2713 and to avoid GCC warning about integer overflow.
2714
2715 * intervals.h (struct interval): Use EMACS_INT for members
2716 where EMACS_UINT might cause problems. See
2717 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
2718 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
2719 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
2720 All uses changed.
2721 (offset_intervals): Tell GCC not to worry about length overflow
2722 when negating a negative length.
2723
2724 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
2725 (overrun_check_free): Likewise.
2726
2727 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
2728 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
2729 word size.
2730
2731 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
2732 (gnutls_make_error): Rename local to avoid shadowing.
2733 (gnutls_emacs_global_deinit): ifdef out; not used.
2734 (Fgnutls_boot): Use const for pointer to readonly storage.
2735 Comment out unused local. Fix pointer signedness problems.
2736
2737 * lread.c (openp): Don't stuff size_t into an 'int'.
2738 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
2739 about possible signed overflow.
2740
2741 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
2742 (GDK_KEY_g): Don't define if already defined.
2743 (xg_prepare_tooltip): Avoid pointer signedness problem.
2744 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
2745
2746 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
2747 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
2748
2749 * xfns.c (Fx_window_property): Simplify a bit,
2750 to make a bit faster and to avoid GCC 4.6.0 warning.
2751 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
2752
2753 * fns.c (internal_equal): Don't assume size_t fits in int.
2754
2755 * alloc.c (compact_small_strings): Tighten assertion a little.
2756
2757 Replace pEd with more-general pI, and fix some printf arg casts.
2758 * lisp.h (pI): New macro, generalizing old pEd macro to other
2759 conversion specifiers. For example, use "...%"pI"d..." rather
2760 than "...%"pEd"...".
2761 (pEd): Remove. All uses replaced with similar uses of pI.
2762 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
2763 * alloc.c (check_pure_size): Don't overflow by converting size to int.
2764 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
2765 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
2766 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
2767 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
2768 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
2769 64-bit hosts.
2770 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
2771 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
2772 * print.c (safe_debug_print, print_object): Likewise.
2773 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
2774 to int.
2775 Use pI instead of if-then-else-abort. Use %p to avoid casts,
2776 avoiding the 0 flag, which is not portable.
2777 * process.c (Fmake_network_process): Use pI to avoid cast.
2778 * region-cache.c (pp_cache): Likewise.
2779 * xdisp.c (decode_mode_spec): Likewise.
2780 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
2781 behavior on 64-bit hosts with printf arg.
2782 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
2783 (x_stop_queuing_selection_requests): Likewise.
2784 (x_get_window_property): Don't truncate byte count to an 'int'
2785 when tracing.
2786
2787 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
2788 here, since it parses constructs like leading '-' and spaces,
2789 which are not wanted; and it overflows with large numbers.
2790 Instead, simply match F[0-9]+, which is what is wanted anyway.
2791
2792 * alloc.c: Remove unportable assumptions about struct layout.
2793 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
2794 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
2795 (allocate_vectorlike, make_pure_vector): Use the new macros,
2796 plus offsetof, to remove unportable assumptions about struct layout.
2797 These assumptions hold on all porting targets that I know of, but
2798 they are not guaranteed, they're easy to remove, and removing them
2799 makes further changes easier.
2800
2801 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
2802 This doesn't fix a bug but makes the code clearer.
2803 (string_overrun_cookie): Now const. Use initializers that
2804 don't formally overflow signed char, to avoid warnings.
2805 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
2806 can cause Emacs to crash when string overrun checking is enabled.
2807 (allocate_buffer): Don't assume sizeof (struct buffer) is a
2808 multiple of sizeof (EMACS_INT); it need not be, if
2809 alignof(EMACS_INT) < sizeof (EMACS_INT).
2810 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
2811
2812 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
2813
2814 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
2815
2816 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
2817
2818 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
2819 supposed to be handshaking. (Bug#8556)
2820 Reported by Paul Eggert <eggert@cs.ucla.edu>.
2821
2822 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
2823
2824 * lisp.h (Qdebug): List symbol.
2825 * eval.c (Qdebug): Restore global linkage.
2826 * keyboard.c (debug-on-event): New variable.
2827 (handle_user_signal): Break into debugger when debug-on-event
2828 matches the current signal symbol.
2829
2830 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
2831
2832 * alloc.c (check_sblock, check_string_bytes)
2833 (check_string_free_list): Convert to standard C.
2834
2835 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
2836
2837 * w32.c (emacs_gnutls_push): Fix typo.
2838
2839 2011-04-25 Eli Zaretskii <eliz@gnu.org>
2840
2841 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
2842 "cast to pointer from integer of different size".
2843
2844 Improve doprnt and its use in verror. (Bug#8545)
2845 * doprnt.c (doprnt): Document the set of format control sequences
2846 supported by the function. Use SAFE_ALLOCA instead of always
2847 using `alloca'.
2848
2849 * eval.c (verror): Don't limit the buffer size at size_max-1, that
2850 is one byte too soon. Don't use xrealloc; instead xfree and
2851 xmalloc anew.
2852
2853 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
2854
2855 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
2856 callbacks stage.
2857
2858 * gnutls.c: Renamed global_initialized to
2859 gnutls_global_initialized. Added internals for the
2860 :verify-hostname-error, :verify-error, and :verify-flags
2861 parameters of `gnutls-boot' and documented those parameters in the
2862 docstring. Start callback support.
2863 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
2864 unless a fatal error occurred. Call gnutls_alert_send_appropriate
2865 on error. Return error code.
2866 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
2867 (emacs_gnutls_read): Likewise.
2868 (Fgnutls_boot): Return handshake error code.
2869 (emacs_gnutls_handle_error): New function.
2870 (wsaerror_to_errno): Likewise.
2871
2872 * w32.h (emacs_gnutls_pull): Add prototype.
2873 (emacs_gnutls_push): Likewise.
2874
2875 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
2876 (emacs_gnutls_push): Likewise.
2877
2878 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
2879
2880 * process.c (wait_reading_process_output): Check if GnuTLS
2881 buffered some data internally if no FDs are set for TLS
2882 connections.
2883
2884 * makefile.w32-in (OBJ2): Add gnutls.$(O).
2885 (LIBS): Link to USER_LIBS.
2886 ($(BLD)/gnutls.$(0)): New target.
2887
2888 2011-04-24 Eli Zaretskii <eliz@gnu.org>
2889
2890 * xdisp.c (handle_single_display_spec): Rename the
2891 display_replaced_before_p argument into display_replaced_p, to
2892 make it consistent with the commentary. Fix typos in the
2893 commentary.
2894
2895 * textprop.c (syms_of_textprop): Remove dead code.
2896 (copy_text_properties): Delete obsolete commentary about an
2897 interface that was deleted long ago. Fix typos in the description
2898 of arguments.
2899
2900 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
2901 to changes in oldXMenu/XMenu.h from 2011-04-16.
2902 <menu_help_message, prev_menu_help_message>: Constify.
2903 (IT_menu_make_room): menu->help_text is now `const char **';
2904 adjust.
2905
2906 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
2907 to changes in oldXMenu/XMenu.h from 2011-04-16.
2908 (struct XMenu): Declare `help_text' `const char **'.
2909
2910 * xfaces.c <Qunspecified>: Make extern again.
2911
2912 * syntax.c: Include sys/types.h before including regex.h, as
2913 required by Posix.
2914
2915 * doc.c (get_doc_string): Improve the format passed to `error'.
2916
2917 * doprnt.c (doprnt): Improve commentary.
2918
2919 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
2920
2921 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
2922 them with etags.
2923
2924 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
2925 changes in globals.h immediately force recompilation.
2926 (TAGS): Depend on $(CURDIR)/m/intel386.h and
2927 $(CURDIR)/s/ms-w32.h.
2928 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
2929
2930 * character.c (Fchar_direction): Function deleted.
2931 (syms_of_character): Don't defsubr it.
2932 <char-direction-table>: Deleted.
2933
2934 2011-04-23 Eli Zaretskii <eliz@gnu.org>
2935
2936 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
2937 * doprnt.c: Include limits.h.
2938 (SIZE_MAX): New macro.
2939 (doprnt): Return a size_t value. 2nd arg is now size_t.
2940 Many local variables are now size_t instead of int or unsigned.
2941 Improve overflow protection. Support `l' modifier for integer
2942 conversions. Support %l conversion. Don't assume an EMACS_INT
2943 argument for integer conversions and for %c.
2944
2945 * lisp.h (doprnt): Restore prototype.
2946
2947 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
2948 $(SRC)/character.h.
2949
2950 * Makefile.in (base_obj): Add back doprnt.o.
2951
2952 * deps.mk (doprnt.o): Add back prerequisites.
2953 (callint.o): Depend on character.h.
2954
2955 * eval.c (internal_lisp_condition_case): Include the handler
2956 representation in the error message.
2957 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
2958 when breaking from the loop.
2959
2960 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
2961
2962 * callint.c (Fcall_interactively): When displaying error message
2963 about invalid control letter, pass the character's codepoint, not
2964 a pointer to its multibyte form. Improve display of the character
2965 in octal and display also its hex code.
2966
2967 * character.c (char_string): Use %x to display the (unsigned)
2968 codepoint of an invalid character, to avoid displaying a bogus
2969 negative value.
2970
2971 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
2972 `error', not SYMBOL_NAME itself.
2973
2974 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
2975 character arguments to `error'.
2976
2977 * charset.c (check_iso_charset_parameter): Fix incorrect argument
2978 to `error' in error message about FINAL_CHAR argument. Make sure
2979 FINAL_CHAR is a character, and use %c when it is passed as
2980 argument to `error'.
2981
2982 2011-04-23 Eli Zaretskii <eliz@gnu.org>
2983
2984 * s/ms-w32.h (localtime): Redirect to sys_localtime.
2985
2986 * w32.c: Include <time.h>.
2987 (sys_localtime): New function.
2988
2989 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
2990
2991 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
2992
2993 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
2994
2995 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
2996
2997 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
2998 zombies (Bug#8467).
2999
3000 2011-04-19 Eli Zaretskii <eliz@gnu.org>
3001
3002 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
3003 gl_state.e_property when gl_state.object is Qt.
3004
3005 * insdel.c (make_gap_larger): Remove limitation of buffer size
3006 to <= INT_MAX.
3007
3008 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
3009
3010 * xdisp.c (lookup_glyphless_char_display)
3011 (produce_glyphless_glyph): Handle cons cell entry in
3012 glyphless-char-display.
3013 (Vglyphless_char_display): Document it.
3014
3015 * term.c (produce_glyphless_glyph): Handle cons cell entry in
3016 glyphless-char-display.
3017
3018 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
3019
3020 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
3021
3022 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
3023
3024 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
3025 definition for no-X builds.
3026
3027 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
3028
3029 Static checks with GCC 4.6.0 and non-default toolkits.
3030
3031 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
3032
3033 * process.c (keyboard_bit_set): Define only if SIGIO.
3034 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
3035 (send_process): Repair possible setjmp clobbering.
3036
3037 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
3038
3039 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
3040
3041 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
3042
3043 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
3044 Define only if needed.
3045
3046 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
3047 by pacifying GCC about it. Maybe it's time to retire it?
3048 * xfaces.c (USG, __TIMEVAL__): Likewise.
3049
3050 * dispextern.h (struct redisplay_interface): Rename param
3051 to avoid shadowing.
3052 * termhooks.h (struct terminal): Likewise.
3053 * xterm.c (xembed_send_message): Likewise.
3054
3055 * insdel.c (make_gap_smaller): Define only if
3056 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
3057
3058 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
3059 it.
3060
3061 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
3062 so that we aren't warned about unused symbols.
3063
3064 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
3065
3066 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
3067
3068 * xfns.c (x_real_positions): Mark locals as initialized.
3069
3070 * xmenu.c (xmenu_show): Don't use uninitialized vars.
3071
3072 * xterm.c: Fix problems found by static analysis with other toolkits.
3073 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
3074 (x_dispatch_event): Declare static if USE_GTK, and
3075 define if USE_GTK || USE_X_TOOLKIT.
3076 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
3077 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
3078 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
3079 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
3080
3081 * xmenu.c (menu_help_callback): Pointer type fixes.
3082 Use const pointers when pointing at readonly data. Avoid pointer
3083 signedness clashes.
3084 (FALSE): Remove unused macro.
3085 (update_frame_menubar): Remove unused decl.
3086
3087 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
3088
3089 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
3090 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
3091 (single_menu_item): Rename local to avoid shadowing.
3092
3093 * keyboard.c (make_lispy_event): Remove unused local var.
3094
3095 * frame.c, frame.h (x_get_resource_string): Bring this back, but
3096 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
3097
3098 * bitmaps: Change bitmaps from unsigned char back to the X11
3099 compatible char. Avoid the old compiler warnings about
3100 out-of-range initializers by using, for example, '\xab' rather
3101 than 0xab.
3102
3103 * xgselect.c (xgselect_initialize): Check vs interface
3104 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
3105
3106 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
3107
3108 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
3109 to read-only memory.
3110
3111 * fns.c (vector): Remove; this old hack is no longer needed.
3112
3113 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
3114 Remove unused var.
3115 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
3116
3117 * xrdb.c (x_load_resources): Omit unused local.
3118
3119 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
3120 (x_window): Rename locals to avoid shadowing.
3121 (USG): Use the kludged USG macro, to pacify gcc.
3122
3123 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
3124 (x_term_init): Remove local to avoid shadowing.
3125
3126 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
3127
3128 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
3129 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
3130
3131 2011-04-16 Eli Zaretskii <eliz@gnu.org>
3132
3133 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
3134
3135 Fix regex.c, syntax.c and friends for buffers > 2GB.
3136 * syntax.h (struct gl_state_s): Declare character position members
3137 EMACS_INT.
3138
3139 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
3140
3141 * textprop.c (verify_interval_modification, interval_of):
3142 Declare arguments EMACS_INT.
3143
3144 * intervals.c (adjust_intervals_for_insertion): Declare arguments
3145 EMACS_INT.
3146
3147 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
3148
3149 * indent.c (Fvertical_motion): Local variable it_start is now
3150 EMACS_INT.
3151
3152 * regex.c (re_match, re_match_2, re_match_2_internal)
3153 (bcmp_translate, regcomp, regexec, print_double_string)
3154 (group_in_compile_stack, re_search, re_search_2, regex_compile)
3155 (re_compile_pattern, re_exec): Declare arguments and local
3156 variables `size_t' and `ssize_t' and return values `regoff_t', as
3157 appropriate.
3158 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
3159 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
3160 <compile_stack_type>: `size' and `avail' are now `size_t'.
3161
3162 * regex.h <regoff_t>: Use ssize_t, not int.
3163 (re_search, re_search_2, re_match, re_match_2): Arguments that
3164 specify buffer/string position and length are now ssize_t and
3165 size_t. Return type is regoff_t.
3166
3167 2011-04-16 Ben Key <bkey76@gmail.com>
3168
3169 * nsfont.m: Fixed bugs in ns_get_family and
3170 ns_descriptor_to_entity that were caused by using free to
3171 deallocate memory blocks that were allocated by xmalloc (via
3172 xstrdup). This caused Emacs to crash when compiled with
3173 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
3174 --enable-checking=xmallocoverrun). xfree is now used to
3175 deallocate these memory blocks.
3176
3177 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3178
3179 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
3180
3181 emacs_write: Accept and return EMACS_INT for sizes.
3182 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
3183 et seq.
3184 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
3185 Accept and return EMACS_INT.
3186 (emacs_gnutls_write): Return the number of bytes written on
3187 partial writes.
3188 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
3189 (emacs_read, emacs_write): Remove check for negative size, as the
3190 Emacs source code has been audited now.
3191 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
3192 (emacs_read, emacs_write): Use it.
3193 * process.c (send_process): Adjust to the new signatures of
3194 emacs_write and emacs_gnutls_write. Do not attempt to store
3195 a byte offset into an 'int'; it might overflow.
3196 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
3197
3198 * sound.c: Don't assume sizes fit in 'int'.
3199 (struct sound_device.period_size, alsa_period_size):
3200 Return EMACS_INT, not int.
3201 (struct sound_device.write, vox_write, alsa_write):
3202 Accept EMACS_INT, not int.
3203 (wav_play, au_play): Use EMACS_INT to store sizes and to
3204 record read return values.
3205
3206 2011-04-15 Ben Key <bkey76@gmail.com>
3207
3208 * keyboard.c (Qundefined): Don't declare static since it is used
3209 in nsfns.m.
3210 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
3211 static since they are used in nsfont.m.
3212
3213 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
3214
3215 * process.c (Qprocessp): Don't declare static.
3216 * lisp.h (Qprocessp): Declare again.
3217
3218 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
3219
3220 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
3221
3222 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
3223
3224 Improve C-level modularity by making more things 'static'.
3225
3226 Don't publish debugger-only interfaces to other modules.
3227 * lisp.h (safe_debug_print, debug_output_compilation_hack):
3228 (verify_bytepos, count_markers): Move decls to the only modules
3229 that need them.
3230 * region-cache.h (pp_cache): Likewise.
3231 * window.h (check_all_windows): Likewise.
3232 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
3233
3234 * sysdep.c (croak): Now static, if
3235 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
3236 * syssignal.h (croak): Declare only if not static.
3237
3238 * alloc.c (refill_memory_reserve): Now static if
3239 !defined REL_ALLOC || defined SYSTEM_MALLOC.
3240 * lisp.h (refill_memory_reserve): Declare only if not static.
3241
3242 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
3243 Define only if USE_LUCID.
3244
3245 * xrdb.c (x_customization_string, x_rm_string): Now static.
3246
3247 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
3248 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
3249
3250 * xdisp.c (draw_row_with_mouse_face): Now static.
3251 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
3252
3253 * window.h (check_all_windows): Mark externally visible.
3254
3255 * window.c (window_deletion_count): Now static.
3256
3257 * undo.c: Make symbols static if they're not exported.
3258 (last_undo_buffer, last_boundary_position, pending_boundary):
3259 Now static.
3260
3261 * textprop.c (interval_insert_behind_hooks): Now static.
3262 (interval_insert_in_front_hooks): Likewise.
3263
3264 * term.c: Make symbols static if they're not exported.
3265 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
3266 (max_frame_lines, tty_set_terminal_modes):
3267 (tty_reset_terminal_modes, tty_turn_off_highlight):
3268 (get_tty_terminal): Now static.
3269 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
3270 * termhooks.h (term_mouse_moveto): Do not declare if
3271 HAVE_WINDOW_SYSTEM.
3272 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
3273 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
3274
3275 * sysdep.c: Make symbols static if they're not exported.
3276 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
3277 Now static.
3278 (sigprocmask_set, full_mask): Remove; unused.
3279 (wait_debugging): Mark as visible.
3280 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
3281 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
3282
3283 * syntax.c (syntax_temp): Define only if !__GNUC__.
3284
3285 * sound.c (current_sound_device, current_sound): Now static.
3286
3287 * search.c (searchbufs, searchbuf_head): Now static.
3288
3289 * scroll.c (scroll_cost): Remove; unused.
3290 * dispextern.h (scroll_cost): Remove decl.
3291
3292 * region-cache.h (pp_cache): Mark as externally visible.
3293
3294 * process.c: Make symbols static if they're not exported.
3295 (process_tick, update_tick, create_process, chan_process):
3296 (Vprocess_alist, proc_buffered_char, datagram_access):
3297 (fd_callback_data, send_process_frame, process_sent_to): Now static.
3298 (deactivate_process): Mark defn as static, as well as decl.
3299 * lisp.h (create_process): Remove decl.
3300 * process.h (chan_process, Vprocess_alist): Remove decls.
3301
3302 * print.c: Make symbols static if they're not exported.
3303 (print_depth, new_backquote_output, being_printed, print_buffer):
3304 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
3305 (print_interval, print_number_index, initial_stderr_stream):
3306 Now static.
3307 * lisp.h (Fprinc): Remove decl.
3308 (debug_output_compilation_hack): Mark as externally visible.
3309
3310 * sysdep.c (croak): Move decl from here to syssignal.h.
3311 * syssignal.h (croak): Put it here, so the API can be checked when
3312 'croak' is called from dissociate_if_controlling_tty.
3313
3314 * minibuf.c: Make symbols static if they're not exported.
3315 (minibuf_save_list, choose_minibuf_frame): Now static.
3316 * lisp.h (choose_minibuf_frame): Remove decl.
3317
3318 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
3319
3320 * lread.c: Make symbols static if they're not exported.
3321 (read_objects, initial_obarray, oblookup_last_bucket_number):
3322 Now static.
3323 (make_symbol): Remove; unused.
3324 * lisp.h (initial_obarray, make_symbol): Remove decls.
3325
3326 * keyboard.c: Make symbols static if they're not exported.
3327 (single_kboard, recent_keys_index, total_keys, recent_keys):
3328 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
3329 (this_single_command_key_start, echoing, last_auto_save):
3330 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
3331 (command_loop, echo_now, keyboard_init_hook, help_char_p):
3332 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
3333 (Vlispy_mouse_stem, double_click_count):
3334 Now static.
3335 (force_auto_save_soon): Define only if SIGDANGER.
3336 (ignore_mouse_drag_p): Now static if
3337 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
3338 (print_help): Remove; unused.
3339 (stop_character, last_timer_event): Mark as externally visible.
3340 * keyboard.h (ignore_mouse_drag_p): Declare only if
3341 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
3342 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
3343 * lisp.h (echoing): Remove decl.
3344 (force_auto_save_soon): Declare only if SIGDANGER.
3345 * xdisp.c (redisplay_window): Simplify code, to make it more
3346 obvious that ignore_mouse_drag_p is not accessed if !defined
3347 USE_GTK && !defined HAVE_NS.
3348
3349 * intervals.c: Make symbols static if they're not exported.
3350 (merge_properties_sticky, merge_interval_right, delete_interval):
3351 Now static.
3352 * intervals.h (merge_interval_right, delete_interval): Remove decls.
3353
3354 * insdel.c: Make symbols static if they're not exported.
3355 However, leave prepare_to_modify_buffer alone. It's never
3356 called from outside this function, but that appears to be a bug.
3357 (combine_after_change_list, combine_after_change_buffer):
3358 (adjust_after_replace, signal_before_change): Now static.
3359 (adjust_after_replace_noundo): Remove; unused.
3360 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
3361 (signal_before_change): Remove decls.
3362
3363 * indent.c (val_compute_motion, val_vmotion): Now static.
3364
3365 * image.c: Make symbols static if they're not exported.
3366 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
3367 if USE_GTK.
3368 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
3369 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
3370
3371 * fringe.c (standard_bitmaps): Now static.
3372 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
3373
3374 * frame.c: Make symbols static if they're not exported.
3375 (x_report_frame_params, make_terminal_frame): Now static.
3376 (get_frame_param): Now static, unless HAVE_NS.
3377 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
3378 (x_get_resource_string): Remove; not used.
3379 * frame.h (make_terminal_frame, x_report_frame_params):
3380 (x_get_resource_string); Remove decls.
3381 (x_fullscreen_adjust): Declare only if WINDOWSNT.
3382 * lisp.h (get_frame_param): Declare only if HAVE_NS.
3383
3384 * font.c, fontset.c: Make symbols static if they're not exported.
3385 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
3386 (FACE_SUITABLE_FOR_CHAR_P): Use it.
3387 * font.c (font_close_object): Now static.
3388 * font.h (font_close_object): Remove.
3389 * fontset.c (FONTSET_OBJLIST): Remove.
3390 (free_realized_fontset) #if-0 the body, which does nothing.
3391 (face_suitable_for_char_p): #if-0, as it's never called.
3392 * fontset.h (face_suitable_for_char_p): Remove decl.
3393 * xfaces.c (face_at_string_position):
3394 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
3395 since 0 is always ASCII.
3396
3397 * fns.c (weak_hash_tables): Now static.
3398
3399 * fileio.c: Make symbols static if they're not exported.
3400 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
3401 (Vwrite_region_annotation_buffers): Now static.
3402
3403 * eval.c: Make symbols static if they're not exported.
3404 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
3405 * lisp.h (backtrace_list): Remove decl.
3406
3407 * emacs.c: Make symbols static if they're not exported.
3408 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
3409 (fatal_error_code, fatal_error_signal_hook, standard_args):
3410 Now static.
3411 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
3412 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
3413 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
3414 * lisp.h (fatal_error_signal_hook): Remove decl.
3415 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
3416
3417 * editfns.c: Move a (normally-unused) function to its only use.
3418 * editfns.c, lisp.h (get_operating_system_release): Remove.
3419 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
3420 worth the hassle of breaking this out.
3421
3422 * xterm.c: Make symbols static if they're not exported.
3423 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
3424 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
3425 (x_destroy_window, x_delete_display):
3426 Now static.
3427 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
3428 (x_mouse_leave): Remove; unused.
3429 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
3430 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
3431 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
3432 Remove decls.
3433 (x_mouse_leave): Declare only if WINDOWSNT.
3434 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
3435 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
3436 USE_X_TOOLKIT.
3437
3438 * ftxfont.c: Make symbols static if they're not exported.
3439 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
3440 HAVE_FREETYPE.
3441 * font.h (ftxfont_driver): Likewise.
3442
3443 * xfns.c: Make symbols static if they're not exported.
3444 (x_last_font_name, x_display_info_for_name):
3445 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
3446 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
3447 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
3448 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
3449 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
3450 (last_show_tip_args): Now static.
3451 (xic_defaut_fontset, xic_create_fontsetname): Define only if
3452 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
3453 (x_screen_planes): Remove; unused.
3454 * dispextern.h (x_screen_planes): Remove decl.
3455
3456 * dispnew.c: Make symbols static if they're not exported.
3457 * dispextern.h (redraw_garbaged_frames, scrolling):
3458 (increment_row_positions): Remove.
3459 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
3460 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
3461 Now static.
3462 (redraw_garbaged_frames): Remove; unused.
3463
3464 * xfaces.c: Make symbols static if they're not exported.
3465 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
3466 Remove decls.
3467 * xterm.h (defined_color): Remove decls.
3468 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
3469 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
3470 (menu_face_changed_default, defined_color, free_realized_face):
3471 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
3472 (ascii_face_of_lisp_face): Remove; unused.
3473
3474 * xdisp.c: Make symbols static if they're not exported.
3475 * dispextern.h (scratch_glyph_row, window_box_edges):
3476 (glyph_to_pixel_coords, set_cursor_from_row):
3477 (get_next_display_element, set_iterator_to_next):
3478 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
3479 (show_mouse_face): Remove decls
3480 * frame.h (message_buf_print): Likewise.
3481 * lisp.h (pop_message, set_message, check_point_in_composition):
3482 Likewise.
3483 * xterm.h (set_vertical_scroll_bar): Likewise.
3484 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
3485 (message_buf_print, scratch_glyph_row, displayed_buffer):
3486 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
3487 (get_next_display_element, show_mouse_face, window_box_edges):
3488 (frame_to_window_pixel_xy, check_point_in_composition):
3489 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
3490 (glyph_to_pixel_coords): Remove; unused.
3491
3492 * dired.c (file_name_completion): Now static.
3493
3494 * dbusbind.c (xd_in_read_queued_messages): Now static.
3495
3496 * lisp.h (circular_list_error, FOREACH): Remove; unused.
3497 * data.c (circular_list_error): Remove.
3498
3499 * commands.h (last_point_position, last_point_position_buffer):
3500 (last_point_position_window): Remove decls.
3501 * keyboard.c: Make these variables static.
3502
3503 * coding.h (coding, code_convert_region, encode_coding_gap):
3504 Remove decls.
3505 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
3506 (iso_code_class, detect_coding, code_convert_region): Now static.
3507 (encode_coding_gap): Remove; unused.
3508
3509 * chartab.c (chartab_chars, chartab_bits): Now static.
3510
3511 * charset.h (charset_iso_8859_1): Remove decl.
3512 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
3513 Now static.
3514
3515 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
3516 * ccl.c (Vccl_program_table): Now static.
3517 (check_ccl_update): Remove; unused.
3518
3519 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
3520 * category.h: ... from here.
3521 * category.c (check_category_table, set_category_set): Now static.
3522
3523 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
3524 * lisp.h: Remove these decls.
3525
3526 * buffer.c (buffer_count): Remove unused var.
3527
3528 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
3529 so that it's not optimized away.
3530 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
3531 * dispextern.h (bidi_dump_cached_states): Remove, since it's
3532 exported only to the debugger.
3533
3534 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
3535 * atimer.h (run_all_atimers): Remove; not exported.
3536
3537 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
3538 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
3539 was inaccessible from Lisp.
3540 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
3541 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
3542
3543 alloc.c: Import and export fewer symbols, and remove unused items.
3544 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
3545 is defined.
3546 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
3547 it's not optimized away by whole-program optimization.
3548 (message_enable_multibyte, free_misc): Remove.
3549 (catchlist, handlerlist, mark_backtrace):
3550 Declare only if BYTE_MARK_STACK.
3551 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
3552 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
3553 (message_enable_multibyte): Remove decl.
3554 (free_misc, interval_free_list, float_block, float_block_index):
3555 (n_float_blocks, float_free_list, cons_block, cons_block_index):
3556 (cons_free_list, last_marked_index):
3557 Now static.
3558 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
3559 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
3560 (mark_backtrace): Define only if BYTE_MARK_STACK.
3561 * xdisp.c (message_enable_multibyte): Now static.
3562
3563 Declare Lisp_Object Q* variables to be 'static' if not exported.
3564 This makes it easier for human readers (and static analyzers)
3565 to see whether these variables are used from other modules.
3566 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
3567 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
3568 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
3569 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
3570 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
3571 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
3572 * xmenu.c, xselect.c:
3573 Declare Q* vars static if they are not used in other modules.
3574 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
3575 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
3576 Remove decls of unexported vars.
3577 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
3578
3579 * lisp.h (DEFINE_FUNC): Make sname 'static'.
3580
3581 Make Emacs functions such as Fatom 'static' by default.
3582 This makes it easier for human readers (and static analyzers)
3583 to see whether these functions can be called from other modules.
3584 DEFUN now defines a static function. To make the function external
3585 so that it can be used in other C modules, use the new macro DEFUE.
3586 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
3587 (Finit_image_library):
3588 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
3589 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
3590 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
3591 Remove decls, since these functions are now static.
3592 (Funintern, Fget_internal_run_time): New decls, since these functions
3593 were already external.
3594
3595 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
3596 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
3597 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
3598 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
3599 * keyboard.c, keymap.c, lread.c:
3600 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
3601 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
3602 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
3603 Mark functions with DEFUE instead of DEFUN,
3604 if they are used in other modules.
3605 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
3606 decls for now-static functions.
3607 * buffer.h (Fdelete_overlay): Remove decl.
3608 * callproc.c (Fgetenv_internal): Mark as internal.
3609 * composite.c (Fremove_list_of_text_properties): Remove decl.
3610 (Fcomposition_get_gstring): New forward static decl.
3611 * composite.h (Fcomposite_get_gstring): Remove decl.
3612 * dired.c (Ffile_attributes): New forward static decl.
3613 * doc.c (Fdocumntation_property): New forward static decl.
3614 * eval.c (Ffetch_bytecode): New forward static decl.
3615 (Funintern): Remove extern decl; now in .h file where it belongs.
3616 * fileio.c (Fmake_symbolic_link): New forward static decl.
3617 * image.c (Finit_image_library): New forward static decl.
3618 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
3619 * intervals.h (Fprevious_property_change):
3620 (Fremove_list_of_text_properties): Remove decls.
3621 * keyboard.c (Fthis_command_keys): Remove decl.
3622 (Fcommand_execute): New forward static decl.
3623 * keymap.c (Flookup_key): New forward static decl.
3624 (Fcopy_keymap): Now static.
3625 * keymap.h (Flookup_key): Remove decl.
3626 * process.c (Fget_process): New forward static decl.
3627 (Fprocess_datagram_address): Mark as internal.
3628 * syntax.c (Fsyntax_table_p): New forward static decl.
3629 (skip_chars): Remove duplicate decl.
3630 * textprop.c (Fprevious_property_change): New forward static decl.
3631 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
3632 Now internal.
3633 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
3634 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
3635
3636 * editfns.c (Fformat): Remove unreachable code.
3637
3638 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
3639
3640 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
3641 change. (Bug#8496)
3642
3643 2011-04-13 Eli Zaretskii <eliz@gnu.org>
3644
3645 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
3646 when at ZV. (Bug#8487)
3647
3648 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
3649
3650 * charset.c (Fclear_charset_maps): Use xfree instead of free.
3651 (Bug#8437)
3652 * keyboard.c (parse_tool_bar_item): Likewise.
3653 * sound.c (sound_cleanup, alsa_close): Likewise.
3654 * termcap.c (tgetent): Likewise.
3655 * xfns.c (x_default_font_parameter): Likewise.
3656 * xsettings.c (read_and_apply_settings): Likewise.
3657
3658 * alloc.c (overrun_check_malloc, overrun_check_realloc)
3659 (overrun_check_free): Protoize.
3660
3661 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
3662
3663 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
3664 since callers should never pass a negative size.
3665 Change the signature to match that of plain 'read' and 'write'; see
3666 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
3667 * lisp.h: Update prototypes of emacs_write and emacs_read.
3668
3669 2011-04-11 Eli Zaretskii <eliz@gnu.org>
3670
3671 * xdisp.c (redisplay_window): Don't try to determine the character
3672 position of the scroll margin if the window start point w->startp
3673 is outside the buffer's accessible region. (Bug#8468)
3674
3675 2011-04-10 Eli Zaretskii <eliz@gnu.org>
3676
3677 Fix write-region and its subroutines for buffers > 2GB.
3678 * fileio.c (a_write, e_write): Modify declaration of arguments and
3679 local variables to support buffers larger than 2GB.
3680 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
3681
3682 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
3683 argument, local variables, and return value.
3684
3685 * lisp.h: Update prototypes of emacs_write and emacs_read.
3686
3687 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
3688
3689 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
3690
3691 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
3692
3693 Fix more problems found by GCC 4.6.0's static checks.
3694
3695 * xdisp.c (vmessage): Use a better test for character truncation.
3696
3697 * charset.c (load_charset_map): <, not <=, for optimization,
3698 and to avoid potential problems with integer overflow.
3699 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
3700 * casetab.c (set_identity, shuffle): Likewise.
3701 * editfns.c (Fformat): Likewise.
3702 * syntax.c (skip_chars): Likewise.
3703
3704 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
3705 This also lets GCC 4.6.0 generate slightly better loop code.
3706
3707 * callint.c (Fcall_interactively): <, not <=, for optimization.
3708 (Fcall_interactively): Count the number of arguments produced,
3709 not the number of arguments given. This is simpler and lets GCC
3710 4.6.0 generate slightly better code.
3711
3712 * ftfont.c: Distingish more carefully between FcChar8 and char.
3713 The previous code passed unsigned char * to a functions like
3714 strlen and xstrcasecmp that expect char *, which does not
3715 conform to the C standard.
3716 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
3717 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
3718 char * when the C standard requires it.
3719
3720 * keyboard.c (read_char): Remove unused var.
3721
3722 * eval.c: Port to Windows vsnprintf (Bug#8435).
3723 Include <limits.h>.
3724 (SIZE_MAX): Define if the headers do not.
3725 (verror): Do not give up if vsnprintf returns a negative count.
3726 Instead, grow the buffer. This ports to Windows vsnprintf, which
3727 does not conform to C99. Problem reported by Eli Zaretskii.
3728 Also, simplify the allocation scheme, by avoiding the need for
3729 calling realloc, and removing the ALLOCATED variable.
3730
3731 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
3732
3733 Remove invocations of doprnt, as Emacs now uses vsnprintf.
3734 But keep the doprint source code for now, as we might revamp it
3735 and use it again (Bug#8435).
3736 * lisp.h (doprnt): Remove.
3737 * Makefile.in (base_obj): Remove doprnt.o.
3738 * deps.mk (doprnt.o): Remove.
3739
3740 error: Print 32- and 64-bit integers portably (Bug#8435).
3741 Without this change, on typical 64-bit hosts error ("...%d...", N)
3742 was used to print both 32- and 64-bit integers N, which relied on
3743 undefined behavior.
3744 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
3745 New macro.
3746 * lisp.h (error, verror): Mark as printf-like functions.
3747 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
3748 Report overflow in size calculations when allocating printf buffer.
3749 Do not truncate output string at its first null byte.
3750 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
3751 Truncate the output at a character boundary, since vsnprintf does not
3752 do that.
3753 * charset.c (check_iso_charset_parameter): Convert internal
3754 character to string before calling 'error', since %c now has the
3755 printf meaning.
3756 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
3757 overflow when computing char to be passed to 'error'. Do not
3758 pass Lisp_Object to 'error'; pass the integer instead.
3759 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
3760 formatted with plain %d.
3761
3762 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
3763
3764 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
3765
3766 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
3767
3768 * xterm.c (x_catch_errors): Remove duplicate declaration.
3769
3770 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
3771
3772 * xdisp.c, lisp.h (message_nolog): Remove; unused.
3773
3774 2011-04-10 Jim Meyering <meyering@redhat.com>
3775
3776 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
3777 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
3778 return ssize_t not "int", and use size_t as the buffer length.
3779 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
3780 * gnutls.h: Update declarations.
3781 * process.c (read_process_output): Use ssize_t, to match.
3782 (send_process): Likewise.
3783
3784 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
3785
3786 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
3787
3788 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
3789
3790 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
3791 Use unsigned char, to match FcChar8 type definition.
3792
3793 * xterm.c (handle_one_xevent):
3794 * xmenu.c (create_and_show_popup_menu):
3795 * xselect.c (x_decline_selection_request)
3796 (x_reply_selection_request): Avoid type-punned deref of X events.
3797
3798 2011-04-09 Eli Zaretskii <eliz@gnu.org>
3799
3800 Fix some uses of `int' instead of EMACS_INT.
3801 * search.c (string_match_1, fast_string_match)
3802 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
3803 (scan_buffer, find_next_newline_no_quit)
3804 (find_before_next_newline, search_command, Freplace_match)
3805 (Fmatch_data): Make some `int' variables be EMACS_INT.
3806
3807 * xdisp.c (display_count_lines): 3rd argument and return value now
3808 EMACS_INT. All callers changed.
3809 (pint2hrstr): Last argument is now EMACS_INT.
3810
3811 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
3812 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
3813 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
3814 (decode_coding_utf_16, decode_coding_emacs_mule)
3815 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
3816 (decode_coding_ccl, decode_coding_charset)
3817 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
3818 (decode_coding_iso_2022, decode_coding_emacs_mule)
3819 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
3820 <char_offset, last_offset>: Declare EMACS_INT.
3821 (encode_coding_utf_8, encode_coding_utf_16)
3822 (encode_coding_emacs_mule, encode_invocation_designation)
3823 (encode_designation_at_bol, encode_coding_iso_2022)
3824 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
3825 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
3826 Declare EMACS_INT.
3827 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
3828 (encode_invocation_designation): Last argument P_NCHARS is now
3829 EMACS_INT.
3830 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
3831 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
3832
3833 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
3834 All users changed.
3835
3836 * ccl.c (Fccl_execute_on_string): Declare some variables
3837 EMACS_INT.
3838
3839 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
3840
3841 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
3842
3843 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
3844
3845 * process.c (Fformat_network_address): Doc fix.
3846
3847 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
3848
3849 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
3850
3851 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
3852
3853 * keyboard.c (read_char): Call Lisp function help-form-show,
3854 instead of using internal_with_output_to_temp_buffer.
3855 (Qhelp_form_show): New var.
3856 (syms_of_keyboard): Use DEFSYM macro.
3857
3858 * print.c (internal_with_output_to_temp_buffer): Function deleted.
3859
3860 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
3861
3862 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
3863
3864 * process.c (Flist_processes): Remove to Lisp.
3865 (list_processes_1): Delete.
3866
3867 2011-04-06 Eli Zaretskii <eliz@gnu.org>
3868
3869 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
3870
3871 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
3872
3873 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
3874
3875 Fix more problems found by GCC 4.6.0's static checks.
3876
3877 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
3878
3879 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
3880
3881 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
3882
3883 * xdisp.c (vmessage): Mark as a printf-like function.
3884
3885 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
3886
3887 * sound.c (sound_warning): Don't crash if arg contains a printf format.
3888
3889 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
3890 printf-like functions.
3891 (tiff_load): Add casts to remove these marks before passing them
3892 to system-supplied API.
3893
3894 * eval.c (Fsignal): Remove excess argument to 'fatal'.
3895
3896 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
3897 This avoids several warnings with gcc -Wstrict-overflow.
3898 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
3899 directly, rather than having caller test rule sign. This avoids
3900 some unnecessary tests.
3901 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
3902 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
3903 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
3904
3905 * xfont.c (xfont_text_extents): Remove var that was set but not used.
3906 (xfont_open): Avoid unnecessary tests.
3907
3908 * composite.c (composition_gstring_put_cache): Use unsigned integer.
3909
3910 * composite.h, composite.c (composition_gstring_put_cache):
3911 Use EMACS_INT, not int, for length.
3912
3913 * composite.h (COMPOSITION_DECODE_REFS): New macro,
3914 breaking out part of COMPOSITION_DECODE_RULE.
3915 (COMPOSITION_DECODE_RULE): Use it.
3916 * composite.c (get_composition_id): Remove unused local vars,
3917 by using the new macro.
3918
3919 * textprop.c (set_text_properties_1): Change while to do-while,
3920 since the condition is always true at first.
3921
3922 * intervals.c (graft_intervals_into_buffer): Mark var as used.
3923 (interval_deletion_adjustment): Return unsigned value.
3924 All uses changed.
3925
3926 * process.c (list_processes_1, create_pty, read_process_output):
3927 (exec_sentinel): Remove vars that were set but not used.
3928 (create_pty): Remove unnecessary "volatile"s.
3929 (Fnetwork_interface_info): Avoid possibility of int overflow.
3930 (read_process_output): Do adaptive read buffering even if carryover.
3931 (read_process_output): Simplify nbytes computation if buffered.
3932
3933 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
3934
3935 * syntax.c (scan_words): Remove var that was set but not used.
3936 (update_syntax_table): Use unsigned instead of int.
3937
3938 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3939 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
3940 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
3941
3942 * print.c (print_error_message): Avoid int overflow.
3943
3944 * font.c (font_list_entities): Redo for clarity,
3945 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
3946
3947 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
3948 (font_score): Avoid potential overflow in diff calculation.
3949
3950 * fns.c (substring_both): Remove var that is set but not used.
3951 (sxhash): Redo loop for clarity and to avoid wraparound warning.
3952
3953 * eval.c (funcall_lambda): Rename local to avoid shadowing.
3954
3955 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
3956 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
3957 can always succeed if overflow has undefined behavior.
3958
3959 * search.c (boyer_moore, wordify): Remove vars set but not used.
3960 (wordify): Omit three unnecessary tests.
3961
3962 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
3963 All callers changed. This avoids the need for an unused var.
3964
3965 * casefiddle.c (casify_region): Remove var that is set but not used.
3966
3967 * dired.c (file_name_completion): Remove var that is set but not used.
3968
3969 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
3970
3971 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
3972 (Finsert_file_contents): Remove unnecessary code checking fd.
3973
3974 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
3975 Check for integer overflow on size calculations.
3976
3977 * buffer.c (Fprevious_overlay_change): Remove var that is set
3978 but not used.
3979
3980 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
3981 Remove vars that are set but not used.
3982 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
3983 (timer_check_2): Mark vars as initialized.
3984
3985 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
3986
3987 * image.c (lookup_image): Remove var that is set but not used.
3988 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
3989
3990 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
3991 that are set but not used.
3992
3993 * xfns.c (make_invisible_cursor): Don't return garbage
3994 if XCreateBitmapFromData fails (Bug#8410).
3995
3996 * xselect.c (x_get_local_selection, x_handle_property_notify):
3997 Remove vars that are set but not used.
3998
3999 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
4000 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
4001
4002 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
4003 Remove var that is set but not used.
4004 (scroll_bar_windows_size): Now size_t, not int.
4005 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
4006 Check for overflow.
4007
4008 * xfaces.c (realize_named_face): Remove vars that are set but not used.
4009 (map_tty_color) [!defined MSDOS]: Likewise.
4010
4011 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
4012
4013 * coding.c: Remove vars that are set but not used.
4014 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
4015 All callers changed.
4016 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
4017 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
4018 (decode_coding_charset): Remove vars that are set but not used.
4019
4020 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
4021 that is set but not used.
4022
4023 * print.c (print_object): Remove var that is set but not used.
4024
4025 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
4026 The gnulib version avoids calling malloc in the usual case,
4027 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
4028 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
4029 * filelock.c (current_lock_owner): Likewise.
4030 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
4031 * sysdep.c: Include allocator.h, careadlinkat.h.
4032 (emacs_no_realloc_allocator): New static constant.
4033 (emacs_readlink): New function.
4034 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
4035 ../lib/careadlinkat.h.
4036
4037 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
4038
4039 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
4040 first non-nil return value).
4041
4042 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
4043
4044 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
4045 if not defined (Bug#8403).
4046
4047 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
4048
4049 * xdisp.c (display_count_lines): Remove parameter `start',
4050 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
4051 (get_char_face_and_encoding): Remove parameter `multibyte_p',
4052 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
4053 (fill_stretch_glyph_string): Remove parameters `row' and `area',
4054 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
4055 and thereabouts. All callers changed.
4056 (get_per_char_metric): Remove parameter `f', unused since
4057 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
4058
4059 2011-04-02 Jim Meyering <meyering@redhat.com>
4060
4061 do not dereference NULL upon failed strdup
4062 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
4063 (ns_get_family): Likewise.
4064
4065 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
4066
4067 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
4068
4069 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
4070
4071 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
4072 later (Bug#8403).
4073
4074 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
4075
4076 Add lexical binding.
4077
4078 * window.c (Ftemp_output_buffer_show): New fun.
4079 (Fsave_window_excursion):
4080 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
4081
4082 * lread.c (lisp_file_lexically_bound_p): New function.
4083 (Fload): Bind Qlexical_binding.
4084 (readevalloop): Remove `evalfun' arg.
4085 Bind Qinternal_interpreter_environment.
4086 (Feval_buffer): Bind Qlexical_binding.
4087 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
4088 Mark as dynamic.
4089 (syms_of_lread): Declare `lexical-binding'.
4090
4091 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
4092
4093 * keyboard.c (eval_dyn): New fun.
4094 (menu_item_eval_property): Use it.
4095
4096 * image.c (parse_image_spec): Use Ffunctionp.
4097
4098 * fns.c (concat, mapcar1): Accept byte-code-functions.
4099
4100 * eval.c (Fsetq): Handle lexical vars.
4101 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
4102 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
4103 (FletX, Flet): Obey lexical binding.
4104 (Fcommandp): Handle closures.
4105 (Feval): New `lexical' arg.
4106 (eval_sub): New function extracted from Feval. Use it almost
4107 everywhere where Feval was used. Look up vars in lexical env.
4108 Handle closures.
4109 (Ffunctionp): Move from subr.el.
4110 (Ffuncall): Handle closures.
4111 (apply_lambda): Remove `eval_flags'.
4112 (funcall_lambda): Handle closures and new byte-code-functions.
4113 (Fspecial_variable_p): New function.
4114 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
4115 but without exporting it to Lisp.
4116
4117 * doc.c (Fdocumentation, store_function_docstring):
4118 * data.c (Finteractive_form): Handle closures.
4119
4120 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
4121 interactive spec.
4122
4123 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
4124 New byte-codes.
4125 (exec_byte_code): New function extracted from Fbyte_code to handle new
4126 calling convention for byte-code-functions. Add new byte-codes.
4127
4128 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
4129
4130 * alloc.c (Fmake_symbol): Init new `declared_special' field.
4131
4132 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
4133
4134 * xdisp.c (redisplay_internal): Fix prototype.
4135
4136 2011-03-31 Eli Zaretskii <eliz@gnu.org>
4137
4138 * xdisp.c (SCROLL_LIMIT): New macro.
4139 (try_scrolling): Use it when setting scroll_limit.
4140 Limit scrolling to 100 screen lines.
4141 (redisplay_window): Even when falling back on "recentering",
4142 position point in the window according to scroll-conservatively,
4143 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
4144
4145 (try_scrolling): When point is above the window, allow searching
4146 as far as scroll_max, or one screenful, to compute vertical
4147 distance from PT to the scroll margin position. This prevents
4148 try_scrolling from unnecessarily failing when
4149 scroll-conservatively is set to a value slightly larger than the
4150 window height. Clean up the case of PT below the margin at bottom
4151 of window: scroll_max can no longer be INT_MAX. When aggressive
4152 scrolling is in use, don't let point enter the opposite scroll
4153 margin as result of the scroll.
4154 (syms_of_xdisp) <scroll-conservatively>: Document the
4155 threshold of 100 lines for never-recentering scrolling.
4156
4157 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
4158
4159 * dispextern.h (move_it_by_lines):
4160 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
4161 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
4162 (message_log_check_duplicate): Remove parameters `prev_bol' and
4163 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
4164 (redisplay_internal): Remove parameter `preserve_echo_area',
4165 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
4166
4167 * indent.c (Fvertical_motion):
4168 * window.c (window_scroll_pixel_based, Frecenter):
4169 Don't pass `need_y_p' to `move_it_by_lines'.
4170
4171 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
4172
4173 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
4174 steal a few bits to be more compact.
4175 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
4176 Remove unneeded casts.
4177
4178 * bytecode.c (Fbyte_code): CAR and CDR can GC.
4179
4180 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
4181
4182 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
4183 binding" message (bug#7967).
4184
4185 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
4186
4187 Fix more problems found by GCC 4.6.0's static checks.
4188
4189 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
4190 Remove unused local var.
4191
4192 * editfns.c (Fmessage_box): Remove unused local var.
4193
4194 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
4195 (note_mode_line_or_margin_highlight, note_mouse_highlight):
4196 Omit unused local vars.
4197 * window.c (shrink_windows): Omit unused local var.
4198 * menu.c (digest_single_submenu): Omit unused local var.
4199 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
4200 Omit unused local var.
4201
4202 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
4203 Don't assume string length fits in int.
4204 (keyremap_step, read_key_sequence): Use size_t for sizes.
4205 (read_key_sequence): Don't check last_real_key_start redundantly.
4206
4207 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
4208 instead of alloca (Bug#8344).
4209
4210 * eval.c (Fbacktrace): Don't assume nargs fits in int.
4211 (Fbacktrace_frame): Don't assume nframes fits in int.
4212
4213 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
4214
4215 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
4216 concerns.
4217
4218 * term.c (produce_glyphless_glyph): Remove unnecessary test.
4219
4220 * cm.c (calccost): Turn while-do into do-while, for clarity.
4221
4222 * keyboard.c (syms_of_keyboard): Use the same style as later
4223 in this function when indexing through an array. This also
4224 works around GCC bug 48267.
4225
4226 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
4227
4228 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
4229
4230 * chartab.c (sub_char_table_ref_and_range): Redo for slight
4231 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
4232
4233 * keyboard.c, keyboard.h (num_input_events): Now size_t.
4234 This avoids undefined behavior on integer overflow, and is a bit
4235 more convenient anyway since it is compared to a size_t variable.
4236
4237 Variadic C functions now count arguments with size_t, not int.
4238 This avoids an unnecessary limitation on 64-bit machines, which
4239 caused (substring ...) to crash on large vectors (Bug#8344).
4240 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
4241 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
4242 All variadic functions and their callers changed accordingly.
4243 (struct gcpro.nvars): Now size_t, not int. All uses changed.
4244 * data.c (arith_driver, float_arith_driver): Likewise.
4245 * editfns.c (general_insert_function): Likewise.
4246 * eval.c (struct backtrace.nargs, interactive_p)
4247 (internal_condition_case_n, run_hook_with_args, apply_lambda)
4248 (funcall_lambda, mark_backtrace): Likewise.
4249 * fns.c (concat): Likewise.
4250 * frame.c (x_set_frame_parameters): Likewise.
4251 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
4252 0 if not found, not -1. All callers changed.
4253
4254 * alloc.c (garbage_collect): Don't assume stack size fits in int.
4255 (stack_copy_size): Now size_t, not int.
4256 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
4257
4258 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
4259
4260 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
4261 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
4262 All callers changed.
4263
4264 * lisp.h (multibyte_char_to_unibyte):
4265 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
4266 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
4267 * character.h (CHAR_TO_BYTE8):
4268 * cmds.c (internal_self_insert):
4269 * editfns.c (general_insert_function):
4270 * keymap.c (push_key_description):
4271 * search.c (Freplace_match):
4272 * xdisp.c (message_dolog, set_message_1): All callers changed.
4273
4274 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4275
4276 * keyboard.c (safe_run_hook_funcall): New function.
4277 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
4278 don't set the hook to nil, but remove the offending function instead.
4279 (Qcommand_hook_internal): Remove, unused.
4280 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
4281 Vcommand_hook_internal.
4282
4283 * eval.c (enum run_hooks_condition): Remove.
4284 (funcall_nil, funcall_not): New functions.
4285 (run_hook_with_args): Call each function through a `funcall' argument.
4286 Remove `cond' argument, now redundant.
4287 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
4288 (Frun_hook_with_args_until_failure): Adjust accordingly.
4289 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
4290
4291 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
4292
4293 * dispextern.h (string_buffer_position): Remove declaration.
4294
4295 * print.c (strout): Remove parameter `multibyte', unused since
4296 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
4297
4298 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
4299 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
4300 All callers changed.
4301
4302 * w32.c (_wsa_errlist): Use braces for struct initializers.
4303
4304 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
4305 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
4306 All callers changed.
4307 (string_buffer_position): Likewise. Also, make static (it's never
4308 used outside xdisp.c).
4309 (cursor_row_p): Remove parameter `w', unused since
4310 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
4311 (decode_mode_spec): Remove parameter `precision', introduced during
4312 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
4313 All callers changed.
4314
4315 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
4316
4317 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
4318
4319 2011-03-27 Anders Lindgren <andlind@gmail.com>
4320
4321 * nsterm.m (ns_menu_bar_is_hidden): New variable.
4322 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
4323 (ns_update_auto_hide_menu_bar): New functions.
4324 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
4325 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
4326 ns_constrain_all_frames.
4327 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
4328 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
4329
4330 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
4331
4332 * nsmenu.m (runDialogAt): Remove argument to timer_check.
4333
4334 2011-03-27 Glenn Morris <rgm@gnu.org>
4335
4336 * syssignal.h: Replace RETSIGTYPE with void.
4337 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
4338 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
4339 Replace SIGTYPE with void everywhere.
4340 * s/usg5-4-common.h (SIGTYPE): Remove definition.
4341 * s/template.h (SIGTYPE): Remove commented out definition.
4342
4343 2011-03-26 Eli Zaretskii <eliz@gnu.org>
4344
4345 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
4346 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
4347
4348 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
4349
4350 * w32.c (read_unc_volume): Use parameter `henum', instead of
4351 global variable `wget_enum_handle'.
4352
4353 * keymap.c (describe_vector): Remove parameters `indices' and
4354 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
4355 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
4356
4357 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
4358
4359 * keyboard.c (timer_check): Remove parameter `do_it_now',
4360 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
4361 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
4362 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
4363
4364 * keyboard.c (read_char):
4365 * w32menu.c (w32_menu_display_help):
4366 * xmenu.c (show_help_event, menu_help_callback):
4367 Adjust calls to `show_help_echo'.
4368
4369 * gtkutil.c (xg_maybe_add_timer):
4370 * keyboard.c (readable_events):
4371 * process.c (wait_reading_process_output):
4372 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
4373
4374 * insdel.c (adjust_markers_gap_motion):
4375 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
4376 (gap_left, gap_right): Don't call it.
4377
4378 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
4379
4380 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
4381 incurred during fontification.
4382
4383 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
4384
4385 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
4386 (DEFVAR_PER_BUFFER): Don't pass it.
4387
4388 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
4389 (scrolling_window): Don't pass it.
4390
4391 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
4392
4393 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
4394
4395 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
4396 and `suffix'.
4397 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
4398 of variables specific to SELinux and computation of `encoded_absname'.
4399
4400 * image.c (XPutPixel): Remove unused variable `height'.
4401
4402 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
4403
4404 * unexw32.c (get_section_info): Remove unused variable `section'.
4405
4406 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
4407 (system_process_attributes): Remove unused variable `sess'.
4408 (sys_read): Remove unused variable `err'.
4409
4410 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
4411 (w32_wnd_proc): Remove unused variable `isdead'.
4412 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
4413 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
4414 (x_create_tip_frame): Remove unused variable `tem'.
4415
4416 * w32inevt.c (w32_console_read_socket):
4417 Remove unused variable `no_events'.
4418
4419 * w32term.c (x_draw_composite_glyph_string_foreground):
4420 Remove unused variable `width'.
4421
4422 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
4423
4424 * w32term.c (x_set_glyph_string_clipping):
4425 Don't pass uninitialized region to CombineRgn.
4426
4427 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
4428
4429 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
4430 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
4431 (Fx_close_connection): Remove unused variable `i'.
4432
4433 * w32font.c (w32font_draw): Return number of glyphs.
4434 (w32font_open_internal): Remove unused variable `i'.
4435 (w32font_driver): Add missing initializer.
4436
4437 * w32menu.c (utf8to16): Remove unused variable `utf16'.
4438 (fill_in_menu): Remove unused variable `items_added'.
4439
4440 * w32term.c (last_mouse_press_frame): Remove static global variable.
4441 (w32_clip_to_row): Remove unused variable `f'.
4442 (x_delete_terminal): Remove unused variable `i'.
4443
4444 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
4445 (NOTHING): Remove unused static global variable.
4446 (uniscribe_check_otf): Remove unused variable `table'.
4447 (uniscribe_font_driver): Add missing initializers.
4448
4449 2011-03-23 Julien Danjou <julien@danjou.info>
4450
4451 * term.c (Fsuspend_tty, Fresume_tty):
4452 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
4453 * window.c (temp_output_buffer_show):
4454 * insdel.c (signal_before_change):
4455 * frame.c (Fhandle_switch_frame):
4456 * fileio.c (Fdo_auto_save):
4457 * emacs.c (Fkill_emacs):
4458 * editfns.c (save_excursion_restore):
4459 * cmds.c (internal_self_insert):
4460 * callint.c (Fcall_interactively):
4461 * buffer.c (Fkill_all_local_variables):
4462 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
4463 Use Frun_hooks.
4464 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
4465 unconditionnaly since it does the check itself.
4466
4467 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
4468
4469 Fix more problems found by GCC 4.5.2's static checks.
4470
4471 * coding.c (encode_coding_raw_text): Avoid unnecessary test
4472 the first time through the loop, since we know p0 < p1 then.
4473 This also avoids a gcc -Wstrict-overflow warning.
4474
4475 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
4476 leading to a memory leak, possible in functions like
4477 load_charset_map_from_file that can allocate an unbounded number
4478 of objects (Bug#8318).
4479
4480 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
4481 that could (at least in theory) be that large.
4482
4483 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
4484 This is less likely to overflow, and avoids undefined behavior if
4485 overflow does occur. All callers changed. Use strtoul to scan
4486 for the unsigned long integer.
4487 (pint2hrstr): Simplify and tune code slightly.
4488 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
4489
4490 * scroll.c (do_scrolling): Work around GCC bug 48228.
4491 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
4492
4493 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
4494 This also avoids a warning with gcc -Wstrict-overflow.
4495 (validate_x_resource_name): Simplify count usage.
4496 This also avoids a warning with gcc -Wstrict-overflow.
4497
4498 * fileio.c (Fcopy_file): Report error if fchown or fchmod
4499 fail (Bug#8306).
4500
4501 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
4502
4503 * process.c (Fmake_network_process): Use socklen_t, not int,
4504 where POSIX says socklen_t is required in portable programs.
4505 This fixes a porting bug on hosts like 64-bit HP-UX, where
4506 socklen_t is wider than int (Bug#8277).
4507 (Fmake_network_process, server_accept_connection):
4508 (wait_reading_process_output, read_process_output):
4509 Likewise.
4510
4511 * process.c: Rename or move locals to avoid shadowing.
4512 (list_processes_1, Fmake_network_process):
4513 (read_process_output_error_handler, exec_sentinel_error_handler):
4514 Rename or move locals.
4515 (Fmake_network_process): Define label "retry_connect" only if needed.
4516 (Fnetwork_interface_info): Fix pointer signedness.
4517 (process_send_signal): Add cast to avoid pointer signedness problem.
4518 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
4519 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
4520
4521 Make tparam.h and terminfo.c consistent.
4522 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
4523 Include tparam.h instead, since it declares them.
4524 * cm.h (PC): Remove extern decl; tparam.h now does this.
4525 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
4526 * terminfo.c: Include tparam.h, to check interfaces.
4527 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
4528 (tparam): Adjust signature to match interface in tparam.h;
4529 this removes some undefined behavior. Check that outstring and len
4530 are zero, which they always are with Emacs.
4531 * tparam.h (PC, BC, UP): New extern decls.
4532
4533 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
4534 (xftfont_open): Rename locals to avoid shadowing.
4535
4536 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
4537 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
4538 (OTF_TAG_SYM): Omit macro if not needed.
4539 (ftfont_list): Remove unused local.
4540 (get_adstyle_property, ftfont_pattern_entity):
4541 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
4542 Rename locals to avoid shadowing.
4543
4544 * xfont.c (xfont_list_family): Mark var as initialized.
4545
4546 * xml.c (make_dom): Now static.
4547
4548 * composite.c (composition_compute_stop_pos): Rename local to
4549 avoid shadowing.
4550 (composition_reseat_it): Remove unused locals.
4551 (find_automatic_composition, composition_adjust_point): Likewise.
4552 (composition_update_it): Mark var as initialized.
4553 (find_automatic_composition): Mark vars as initialized,
4554 with a FIXME (Bug#8290).
4555
4556 character.h: Rename locals to avoid shadowing.
4557 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
4558 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
4559 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
4560 (BUF_DEC_POS): Be more systematic about renaming local temporaries
4561 to avoid shadowing.
4562
4563 * textprop.c (property_change_between_p): Remove; unused.
4564
4565 * intervals.c (interval_start_pos): Now static.
4566
4567 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
4568
4569 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
4570 Rename locals to avoid shadowing.
4571
4572 * sound.c (wav_play, au_play, Fplay_sound_internal):
4573 Fix pointer signedness.
4574 (alsa_choose_format): Remove unused local var.
4575 (wav_play): Initialize a variable to 0, to prevent undefined
4576 behavior (Bug#8278).
4577
4578 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
4579
4580 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
4581
4582 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
4583 clobbering (Bug#8298).
4584 * sysdep.c (sys_subshell): Likewise.
4585 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
4586
4587 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
4588 This should get cleaned up, so that child_setup has the
4589 same signature on all platforms.
4590
4591 * callproc.c (call_process_cleanup): Now static.
4592 (relocate_fd): Rename locals to avoid shadowing.
4593
4594 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
4595
4596 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
4597 not to be necessary, and produces flickering.
4598
4599 2011-03-20 Glenn Morris <rgm@gnu.org>
4600
4601 * config.in: Remove file.
4602
4603 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
4604
4605 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
4606 are now in src/globals.h.
4607 (syms_of_minibuf): Remove spurious & from previous change.
4608
4609 2011-03-20 Leo <sdl.web@gmail.com>
4610
4611 * minibuf.c (completing-read-function): New variable.
4612 (completing-read-default): Rename from completing-read.
4613 (completing-read): Call completing-read-function.
4614
4615 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
4616
4617 * xfaces.c (Fx_load_color_file):
4618 Read color file from absolute filename (bug#8250).
4619
4620 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
4621
4622 * makefile.w32-in: Update dependencies.
4623
4624 2011-03-17 Eli Zaretskii <eliz@gnu.org>
4625
4626 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
4627
4628 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
4629
4630 Fix more problems found by GCC 4.5.2's static checks.
4631
4632 * process.c (make_serial_process_unwind, send_process_trap):
4633 (sigchld_handler): Now static.
4634
4635 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
4636 That way, the code declares only the vars that it needs.
4637 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
4638 * s/cygwin.h (PTY_ITERATION): Likewise.
4639 * s/darwin.h (PTY_ITERATION): Likewise.
4640 * s/gnu-linux.h (PTY_ITERATION): Likewise.
4641
4642 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
4643 * process.c (allocate_pty): Don't declare stb unless it's needed.
4644
4645 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
4646 (CONSTANTLIM): Remove; unused.
4647 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
4648 Define only if needed.
4649
4650 * unexelf.c (unexec): Name an expression,
4651 to avoid gcc -Wbad-function-cast warning.
4652 Use a different way to cause a compilation error if anyone uses
4653 n rather than nn, a way that does not involve shadowing.
4654 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
4655
4656 * deps.mk (unexalpha.o): Remove; unused.
4657
4658 New file unexec.h, the (simple) interface for unexec (Bug#8267).
4659 * unexec.h: New file.
4660 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
4661 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
4662 Depend on unexec.h.
4663 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
4664 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
4665 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
4666 Change as necessary to match prototype in unexec.h.
4667
4668 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
4669 shadowing.
4670 (back_comment, skip_chars): Mark vars as initialized.
4671
4672 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
4673 Rename locals to avoid shadowing.
4674
4675 * lread.c (read1): Rewrite so as not to use empty "else".
4676 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
4677
4678 * print.c (Fredirect_debugging_output): Fix pointer signedess.
4679
4680 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
4681 warning when compiling print.c.
4682
4683 * font.c (font_unparse_fcname): Abort in an "impossible" situation
4684 instead of using an uninitialized var.
4685 (font_sort_entities): Mark var as initialized.
4686
4687 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
4688
4689 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
4690 pointers to constants.
4691 (font_parse_fcname): Remove unused vars.
4692 (font_delete_unmatched): Now static.
4693 (font_get_spec): Remove; unused.
4694 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
4695 (font_update_drivers, Ffont_get_glyphs, font_add_log):
4696 Rename or move locals to avoid shadowing.
4697
4698 * fns.c (require_nesting_list, require_unwind): Now static.
4699 (Ffillarray): Rename locals to avoid shadowing.
4700
4701 * floatfns.c (domain_error2): Define only if needed.
4702 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
4703
4704 * alloc.c (mark_backtrace): Move decl from here ...
4705 * lisp.h: ... to here, so that it can be checked.
4706
4707 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
4708 (Fdefvar): Rewrite so as not to use empty "else".
4709 (lisp_indirect_variable): Name an expression,
4710 to avoid gcc -Wbad-function-cast warning.
4711 (Fdefvar): Rename locals to avoid shadowing.
4712
4713 * callint.c (quotify_arg, quotify_args): Now static.
4714 (Fcall_interactively): Rename locals to avoid shadowing.
4715 Use const pointer when appropriate.
4716
4717 * lisp.h (get_system_name, get_operating_system_release):
4718 Move decls here, to check interfaces.
4719 * process.c (get_operating_system_release): Move decl to lisp.h.
4720 * xrdb.c (get_system_name): Likewise.
4721 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
4722 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
4723 some of which prompt warnings from gcc -Wbad-function-cast.
4724 (Fformat_time_string, Fencode_time, Finsert_char):
4725 (Ftranslate_region_internal, Fformat):
4726 Rename or remove local vars to avoid shadowing.
4727 (Ftranslate_region_internal): Mark var as initialized.
4728
4729 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
4730 avoid shadowing.
4731
4732 * lisp.h (eassert): Check that the argument compiles, even if
4733 ENABLE_CHECKING is not defined.
4734
4735 * data.c (Findirect_variable): Name an expression, to avoid
4736 gcc -Wbad-function-cast warning.
4737 (default_value, arithcompare, arith_driver, arith_error): Now static.
4738 (store_symval_forwarding): Rename local to avoid shadowing.
4739 (Fmake_variable_buffer_local, Fmake_local_variable):
4740 Mark variables as initialized.
4741 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
4742
4743 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
4744 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
4745 Rename locals to avoid shadowing.
4746 (mark_stack): Move local variables into the #ifdef region where
4747 they're used.
4748 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
4749 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
4750 needed otherwise.
4751 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
4752 (GC_STRING_CHARS): Remove; not used.
4753 (Fmemory_limit): Cast sbrk's returned value to char *.
4754
4755 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
4756 avoids undefined behavior in theory.
4757
4758 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
4759
4760 Use functions, not macros, for up- and down-casing (Bug#8254).
4761 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
4762 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
4763 to use the following functions instead of these macros.
4764 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
4765 EMACS_INT, since callers assume the returned value fits in int.
4766 (upcase1): Likewise, for UPCASE_TABLE.
4767 (uppercasep, lowercasep, upcase): New static inline functions.
4768 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
4769 the race-condition problem in the old DOWNCASE.
4770
4771 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
4772 Rename locals to avoid shadowing.
4773 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
4774 (regex_compile, re_search_2, re_match_2_internal):
4775 Remove unused local vars.
4776 (FREE_VAR): Rewrite so as not to use empty "else",
4777 which gcc can warn about.
4778 (regex_compile, re_match_2_internal): Mark locals as initialized.
4779 (RETALLOC_IF): Define only if needed.
4780 (WORDCHAR_P): Likewise. This one is never needed, but is used
4781 only in a comment talking about a compiler bug, so put inside
4782 the #if 0 of that comment.
4783 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
4784 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
4785 Remove; unused.
4786
4787 * search.c (boyer_moore): Rename locals to avoid shadowing.
4788 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
4789 (PREV_CHAR_BOUNDARY): Likewise.
4790
4791 * search.c (simple_search): Remove unused var.
4792
4793 * dired.c (compile_pattern): Move decl from here ...
4794 * lisp.h: ... to here, so that it can be checked.
4795 (struct re_registers): New forward decl.
4796
4797 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
4798
4799 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
4800 All uses changed.
4801 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
4802 Rename locals to avoid shadowing.
4803 (Fvertical_motion): Mark locals as initialized.
4804
4805 * casefiddle.c (casify_object, casify_region): Now static.
4806 (casify_region): Mark local as initialized.
4807
4808 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
4809
4810 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
4811 New macros, so that the caller can use some names other than
4812 gcpro1, gcpro2, etc.
4813 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
4814 of the new macros.
4815 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
4816 argument, for consistency with GCPRO2_VAR, etc: it is now the
4817 prefix of the variable, not the variable itself. All uses
4818 changed.
4819 * dired.c (directory_files_internal, file_name_completion):
4820 Rename locals to avoid shadowing.
4821
4822 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
4823 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
4824 dired.c's scmp function, had undefined behavior.
4825 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
4826 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
4827 * buffer.h: ... to here, because these macros use current_buffer,
4828 and the new implementation with inline functions needs to have
4829 current_buffer in scope now, rather than later when the macros
4830 are used.
4831 (downcase, upcase1): New static inline functions.
4832 (DOWNCASE, UPCASE1): Reimplement using these functions.
4833 This avoids undefined behavior in expressions like
4834 DOWNCASE (x) == DOWNCASE (y), which previously suffered
4835 from race conditions in accessing the global variables
4836 case_temp1 and case_temp2.
4837 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
4838 * lisp.h (case_temp1, case_temp2): Remove their decls.
4839 * character.h (ASCII_CHAR_P): Move from here ...
4840 * lisp.h: ... to here, so that the inline functions mentioned
4841 above can use them.
4842
4843 * dired.c (directory_files_internal_unwind): Now static.
4844
4845 * fileio.c (file_name_as_directory, directory_file_name):
4846 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
4847 Now static.
4848 (file_name_as_directory): Use const pointers when appropriate.
4849 (Fexpand_file_name): Likewise. In particular, newdir might
4850 point at constant storage, so make it a const pointer.
4851 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
4852 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
4853 signedness issues.
4854 (Fset_file_times, Finsert_file_contents, auto_save_error):
4855 Rename locals to avoid shadowing.
4856
4857 * minibuf.c (choose_minibuf_frame_1): Now static.
4858 (Ftry_completion, Fall_completions): Rename or remove locals
4859 to avoid shadowing.
4860
4861 * marker.c (bytepos_to_charpos): Remove; unused.
4862
4863 * lisp.h (verify_bytepos, count_markers): New decls,
4864 so that gcc does not warn that these functions aren't declared.
4865
4866 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
4867 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
4868 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
4869 (copy_text): Remove unused local var.
4870
4871 * filelock.c (within_one_second): Now static.
4872 (lock_file_1): Rename local to avoid shadowing.
4873
4874 * buffer.c (fix_overlays_before): Mark locals as initialized.
4875 (fix_start_end_in_overlays): Likewise. This function should be
4876 simplified by using pointers-to-pointers, but that's a different
4877 matter.
4878 (switch_to_buffer_1): Now static.
4879 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
4880 (report_overlay_modification): Rename locals to avoid shadowing.
4881
4882 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
4883 Fix pointer signedness issue.
4884 (sys_subshell): Mark local as volatile if checking for lint,
4885 to suppress a gcc -Wclobbered warning that does not seem to be right.
4886 (MAXPATHLEN): Define only if needed.
4887
4888 * process.c (serial_open, serial_configure): Move decls from here ...
4889 * systty.h: ... to here, so that they can be checked.
4890
4891 * fns.c (get_random, seed_random): Move extern decls from here ...
4892 * lisp.h: ... to here, so that they can be checked.
4893
4894 * sysdep.c (reset_io): Now static.
4895 (wait_for_termination_signal): Remove; unused.
4896
4897 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
4898 (copy_keymap_item, append_key, push_text_char_description):
4899 Now static.
4900 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
4901 (DENSE_TABLE_SIZE): Remove; unused.
4902 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
4903 (describe_map_tree):
4904 Rename locals to avoid shadowing.
4905
4906 * keyboard.c: Declare functions static if they are not used elsewhere.
4907 (echo_char, echo_dash, cmd_error, top_level_2):
4908 (poll_for_input, handle_async_input): Now static.
4909 (read_char, kbd_buffer_get_event, make_lispy_position):
4910 (make_lispy_event, make_lispy_movement, apply_modifiers):
4911 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
4912 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
4913 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
4914 (read_key_sequence, read_char): Mark locals as initialized.
4915 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
4916
4917 * keyboard.h (make_ctrl_char): New decl.
4918 (mark_kboards): Move decl here ...
4919 * alloc.c (mark_kboards): ... from here.
4920
4921 * lisp.h (force_auto_save_soon): New decl.
4922
4923 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
4924 (DEFINE_DUMMY_FUNCTION): New macro.
4925 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
4926 Use it.
4927 (main): Add casts to avoid warnings
4928 if GCC considers string literals to be constants.
4929
4930 * lisp.h (fatal_error_signal): Add decl, since it's exported.
4931
4932 * dbusbind.c: Pointer signedness fixes.
4933 (xd_signature, xd_append_arg, xd_initialize):
4934 (Fdbus_call_method, Fdbus_call_method_asynchronously):
4935 (Fdbus_method_return_internal, Fdbus_method_error_internal):
4936 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
4937 (Fdbus_register_signal): Use SSDATA when the context wants char *.
4938
4939 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
4940 if GCC considers string literals to be constants.
4941 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
4942
4943 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
4944
4945 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
4946 (print_preprocess, print_object): New macro to fix last change.
4947
4948 * print.c (print_preprocess): Don't forget font objects.
4949
4950 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
4951
4952 * emacs.c (USAGE3): Doc fixes.
4953
4954 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
4955
4956 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
4957 structure.
4958
4959 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
4960
4961 * lisp.h (VWindow_system, Qfile_name_history):
4962 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
4963 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
4964 (w32_system_caret_x, w32_system_caret_y): Declare extern.
4965
4966 * w32select.c: Don't #include "keyboard.h".
4967 (run_protected): Add extern declaration for waiting_for_input.
4968
4969 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
4970 * w32console.c (detect_input_pending, read_input_pending)
4971 (encode_terminal_code):
4972 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
4973 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
4974 (w32_system_caret_y, Qfile_name_history):
4975 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
4976 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
4977 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
4978 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
4979 * w32proc.c (Qlocal, report_file_error):
4980 * w32term.c (Vwindow_system, updating_frame):
4981 * w32uniscribe.c (initialized, uniscribe_font_driver):
4982 Remove unneeded extern declarations.
4983
4984 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
4985
4986 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
4987
4988 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
4989
4990 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
4991 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
4992 These macros can no longer be used for assignment.
4993
4994 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4995 Assign struct members directly, instead of using BUF_BEGV etc.
4996 (record_buffer_markers, fetch_buffer_markers): New functions for
4997 recording and fetching special buffer markers.
4998 (set_buffer_internal_1, set_buffer_temp): Use them.
4999
5000 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
5001
5002 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
5003
5004 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
5005 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
5006
5007 * xdisp.c (hscroll_window_tree):
5008 (reconsider_clip_changes): Use PT instead of BUF_PT.
5009
5010 2011-03-13 Eli Zaretskii <eliz@gnu.org>
5011
5012 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
5013 $(EMACS_ROOT)/lib/intprops.h.
5014
5015 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
5016
5017 Fix more problems found by GCC 4.5.2's static checks.
5018
5019 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
5020 to unsigned char * to avoid compiler diagnostic.
5021 (xg_free_frame_widgets): Make it clear that a local variable is
5022 needed only if USE_GTK_TOOLTIP.
5023 (gdk_window_get_screen): Make it clear that this macro is needed
5024 only if USE_GTK_TOOLTIP.
5025 (int_gtk_range_get_value): New function, which avoids a diagnostic
5026 from gcc -Wbad-function-cast.
5027 (xg_set_toolkit_scroll_bar_thumb): Use it.
5028 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
5029 diagnostic from gcc -Wbad-function-cast.
5030 (get_utf8_string, xg_get_file_with_chooser):
5031 Rename locals to avoid shadowing.
5032 (create_dialog): Move locals to avoid shadowing.
5033
5034 * xgselect.c (xg_select): Remove unused var.
5035
5036 * image.c (four_corners_best): Mark locals as initialized.
5037 (gif_load): Initialize transparent_p to zero (Bug#8238).
5038 Mark another local as initialized.
5039 (my_png_error, my_error_exit): Mark with NO_RETURN.
5040
5041 * image.c (clear_image_cache): Now static.
5042 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
5043 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
5044 (x_edge_detection): Remove unnecessary cast that
5045 gcc -Wbad-function-cast diagnoses.
5046 (gif_load): Fix pointer signedness.
5047 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
5048 (jpeg_load, gif_load): Rename locals to avoid shadowing.
5049
5050 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
5051
5052 Improve quality of tests for time stamp overflow.
5053 For example, without this patch (encode-time 0 0 0 1 1
5054 1152921504606846976) returns the obviously-bogus value (-948597
5055 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
5056 reports time overflow. See
5057 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
5058 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
5059 * editfns.c: Include limits.h and intprops.h.
5060 (TIME_T_MIN, TIME_T_MAX): New macros.
5061 (time_overflow): Move earlier, to before first use.
5062 (hi_time, lo_time): New functions, for an accurate test for
5063 out-of-range times.
5064 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
5065 (Fget_internal_run_time): Don't assume time_t fits in int.
5066 (make_time): Use list2 instead of Fcons twice.
5067 (Fdecode_time): More accurate test for out-of-range times.
5068 (check_tm_member): New function.
5069 (Fencode_time): Use it, to test for out-of-range times.
5070 (lisp_time_argument): Don't rely on undefined left-shift and
5071 right-shift behavior when checking for time stamp overflow.
5072
5073 * editfns.c (time_overflow): New function, refactoring common code.
5074 (Fformat_time_string, Fdecode_time, Fencode_time):
5075 (Fcurrent_time_string): Use it.
5076
5077 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
5078 * dired.c (make_time): Move to ...
5079 * editfns.c (make_time): ... here.
5080 * systime.h: Note the move.
5081
5082 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5083
5084 * fringe.c (update_window_fringes): Remove unused variables.
5085
5086 * unexmacosx.c (copy_data_segment): Also copy __got section.
5087 (Bug#8223)
5088
5089 2011-03-12 Eli Zaretskii <eliz@gnu.org>
5090
5091 * termcap.c [MSDOS]: Include "msdos.h".
5092 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
5093 Constify `char *' arguments and their references according to
5094 prototypes in tparam.h.
5095
5096 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
5097
5098 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
5099 Adapt all references accordingly.
5100
5101 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
5102
5103 2011-03-11 Tom Tromey <tromey@redhat.com>
5104
5105 * buffer.c (syms_of_buffer): Remove obsolete comment.
5106
5107 2011-03-11 Eli Zaretskii <eliz@gnu.org>
5108
5109 * termhooks.h (encode_terminal_code): Declare prototype.
5110
5111 * msdos.c (encode_terminal_code): Don't declare prototype.
5112
5113 * term.c (encode_terminal_code): Now external again, used by
5114 w32console.c and msdos.c.
5115
5116 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
5117 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
5118
5119 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
5120
5121 Fix some minor problems found by GCC 4.5.2's static checks.
5122
5123 * fringe.c (update_window_fringes): Mark locals as initialized
5124 (Bug#8227).
5125 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
5126
5127 * alloc.c (mark_fringe_data): Move decl from here ...
5128 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
5129 to check its interface.
5130 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
5131
5132 * fontset.c (free_realized_fontset): Now static.
5133 (Fset_fontset_font): Rename local to avoid shadowing.
5134 (fontset_font): Mark local as initialized.
5135 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
5136
5137 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
5138
5139 * xselect.c (x_disown_buffer_selections): Remove; not used.
5140 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
5141 (x_own_selection, Fx_disown_selection_internal): Rename locals
5142 to avoid shadowing.
5143 (x_handle_dnd_message): Remove local to avoid shadowing.
5144
5145 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
5146 so that the caller can use some name other than gcpro1.
5147 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
5148 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
5149 (Fx_backspace_delete_keys_p):
5150 Use them to avoid shadowing, and rename vars to avoid shadowing.
5151 (x_decode_color, x_set_name, x_window): Now static.
5152 (Fx_create_frame): Add braces to silence GCC warning.
5153 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
5154 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
5155 Remove unused locals.
5156 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
5157 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
5158 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
5159 macros.
5160
5161 * xterm.h (x_mouse_leave): New decl.
5162
5163 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
5164 Remove unused functions.
5165 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
5166 (x_calc_absolute_position): Now static.
5167 (XTread_socket): Don't define label "out" unless it's used.
5168 Don't declare local "event" unless it's used.
5169 (x_iconify_frame, x_free_frame_resources): Don't declare locals
5170 unless they are used.
5171 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
5172 (x_fatal_error_signal): Remove; not used.
5173 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
5174 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
5175 (x_error_catcher, x_connection_closed, x_error_handler):
5176 (x_error_quitter, xembed_send_message, x_iconify_frame):
5177 (my_log_handler): Rename locals to avoid shadowing.
5178 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
5179 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
5180
5181 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
5182 Rename or move locals to avoid shadowing.
5183 (tty_defined_color, merge_face_heights): Now static.
5184 (free_realized_faces_for_fontset): Remove; not used.
5185 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
5186 does not deduce is never used uninitialized.
5187 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
5188 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
5189
5190 * terminal.c (store_terminal_param): Now static.
5191
5192 * xmenu.c (menu_highlight_callback): Now static.
5193 (set_frame_menubar): Remove unused local.
5194 (xmenu_show): Rename parameter to avoid shadowing.
5195 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
5196 since they might point to immutable storage.
5197 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
5198 since it's unused otherwise.
5199
5200 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
5201 Add a FIXME, since the code still doesn't look right. (Bug#8215)
5202 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
5203 avoids a gcc -Wuninitialized diagnostic.
5204 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
5205 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
5206 does not deduce are never used uninitialized.
5207
5208 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
5209
5210 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
5211 * window.c (window_loop, size_window):
5212 (run_window_configuration_change_hook, enlarge_window): Likewise.
5213
5214 * window.c (display_buffer): Now static.
5215 (size_window): Mark variables that gcc -Wuninitialized
5216 does not deduce are never used uninitialized.
5217 * window.h (check_all_windows): New decl, to forestall
5218 gcc -Wmissing-prototypes diagnostic.
5219 * dispextern.h (bidi_dump_cached_states): Likewise.
5220
5221 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
5222 shadowing.
5223 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
5224 Include <limits.h>.
5225 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
5226 and to avoid gcc -Wuninitialized warning.
5227 (load_charset_map): Mark variables that gcc -Wuninitialized
5228 does not deduce are never used uninitialized.
5229 (load_charset): Abort instead of using uninitialized var (Bug#8229).
5230
5231 * coding.c (coding_set_source, coding_set_destination):
5232 Use "else { /* comment */ }" rather than "else /* comment */;"
5233 for clarity, and to avoid gcc -Wempty-body warning.
5234 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
5235 a block, when the outer 'i' will do.
5236 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
5237 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
5238 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
5239 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
5240 (Fdecode_sjis_char, Fdefine_coding_system_internal):
5241 Rename locals to avoid shadowing.
5242 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
5243 * coding.c (emacs_mule_char, encode_invocation_designation):
5244 Now static, since they're not used elsewhere.
5245 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
5246 (decode_coding_object, encode_coding_object, detect_coding_system):
5247 (decode_coding_emacs_mule): Mark variables that gcc
5248 -Wuninitialized does not deduce are never used uninitialized.
5249 (detect_coding_iso_2022): Initialize a local variable that might
5250 be used uninitialized. Leave a FIXME because it's not clear that
5251 this initialization is needed. (Bug#8211)
5252 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
5253 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
5254 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
5255 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
5256 Remove unused macros.
5257
5258 * category.c (hash_get_category_set): Remove unused local var.
5259 (copy_category_table): Now static, since it's not used elsewhere.
5260 * character.c (string_count_byte8): Likewise.
5261
5262 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
5263 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
5264
5265 * chartab.c (copy_sub_char_table): Now static, since it's not used
5266 elsewhere.
5267 (sub_char_table_ref_and_range, char_table_ref_and_range):
5268 Rename locals to avoid shadowing.
5269 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
5270
5271 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
5272 (BIDI_BOB): Remove unused macro.
5273
5274 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
5275 deduce are never used uninitialized.
5276 * term.c (encode_terminal_code): Likewise.
5277
5278 * term.c (encode_terminal_code): Now static. Remove unused local.
5279
5280 * tparam.h: New file.
5281 * term.c, tparam.h: Include it.
5282 * deps.mk (term.o, tparam.o): Depend on tparam.h.
5283 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
5284 Move these decls to tparam.h, and make them agree with what
5285 is actually in tparam.c. The previous trick of using incompatible
5286 decls in different modules does not conform to the C standard.
5287 All callers of tparam changed to use tparam's actual API.
5288 * tparam.c (tparam1, tparam, tgoto):
5289 Use const pointers where appropriate.
5290
5291 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
5292 * cm.h (struct cm): Likewise.
5293 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
5294 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
5295 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
5296 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
5297 (turn_on_face, init_tty): Likewise.
5298 * termchar.h (struct tty_display_info): Likewise.
5299
5300 * term.c (term_mouse_position): Rename local to avoid shadowing.
5301
5302 * alloc.c (mark_ttys): Move decl from here ...
5303 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
5304
5305 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
5306
5307 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
5308
5309 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
5310
5311 * search.c (compile_pattern_1): Remove argument regp, unused since
5312 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
5313 (compile_pattern): Don't pass it.
5314
5315 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
5316
5317 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
5318 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
5319 for ! HAVE_GTK3.
5320 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
5321
5322 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
5323
5324 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
5325 gdk_window_get_screen, gdk_window_get_geometry,
5326 gdk_x11_window_lookup_for_display and GDK_KEY_g.
5327 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
5328 (xg_get_pixbuf_from_pixmap): New function.
5329 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
5330 to Pixmap, take frame as parameter, remove GdkColormap parameter.
5331 Call xg_get_pixbuf_from_pixmap instead of
5332 gdk_pixbuf_get_from_drawable.
5333 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
5334 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
5335 (xg_check_special_colors): Use GtkStyleContext and its functions
5336 for HAVE_GTK3.
5337 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
5338 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
5339 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
5340 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
5341 Call gtk_widget_get_preferred_size.
5342 (xg_frame_resized): gdk_window_get_geometry only takes 5
5343 parameters.
5344 (xg_win_to_widget, xg_event_is_for_menubar):
5345 Call gdk_x11_window_lookup_for_display.
5346 (xg_set_widget_bg): New function.
5347 (delete_cb): New function.
5348 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5349 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
5350 (xg_set_background_color): Call xg_set_widget_bg.
5351 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
5352 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
5353 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
5354 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
5355 if ! HAVE_GTK3.
5356 (update_frame_tool_bar): Call gtk_widget_hide.
5357 (xg_initialize): Use GDK_KEY_g.
5358
5359 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
5360 if ! HAVE_GTK3
5361 (x_session_initialize): Call gdk_x11_set_sm_client_id.
5362
5363 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
5364 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
5365 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
5366
5367 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
5368
5369 * w32xfns.c (select_palette): Check success of RealizePalette against
5370 GDI_ERROR, not zero.
5371
5372 See ChangeLog.11 for earlier changes.
5373
5374 ;; Local Variables:
5375 ;; coding: utf-8
5376 ;; End:
5377
5378 Copyright (C) 2011 Free Software Foundation, Inc.
5379
5380 This file is part of GNU Emacs.
5381
5382 GNU Emacs is free software: you can redistribute it and/or modify
5383 it under the terms of the GNU General Public License as published by
5384 the Free Software Foundation, either version 3 of the License, or
5385 (at your option) any later version.
5386
5387 GNU Emacs is distributed in the hope that it will be useful,
5388 but WITHOUT ANY WARRANTY; without even the implied warranty of
5389 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5390 GNU General Public License for more details.
5391
5392 You should have received a copy of the GNU General Public License
5393 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.