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