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