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