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