]> code.delx.au - gnu-emacs/blob - src/ChangeLog
* ftfont.c: Distingish more carefully between FcChar8 and char.
[gnu-emacs] / src / ChangeLog
1 2011-04-09 Paul Eggert <eggert@cs.ucla.edu>
2
3 * ftfont.c: Distingish more carefully between FcChar8 and char.
4 The previous code passed unsigned char * to a functions like
5 strlen and xstrcasecmp that expect char *, which does not
6 conform to the C standard.
7 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
8 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
9 char * when the C standard requires it.
10
11 * keyboard.c (read_char): Remove unused var.
12
13 * eval.c: Port to Windows vsnprintf (Bug#8435).
14 Include <limits.h>.
15 (SIZE_MAX): Define if the headers do not.
16 (verror): Do not give up if vsnprintf returns a negative count.
17 Instead, grow the buffer. This ports to Windows vsnprintf, which
18 does not conform to C99. Problem reported by Eli Zaretskii.
19 Also, simplify the allocation scheme, by avoiding the need for
20 calling realloc, and removing the ALLOCATED variable.
21
22 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
23
24 Remove the doprnt implementation, as Emacs now uses vsnprintf.
25 * doprnt.c: Remove.
26 * lisp.h (doprnt): Remove.
27 * Makefile.in (base_obj): Remove doprnt.o.
28 * deps.mk (doprnt.o): Remove.
29
30 error: Print 32- and 64-bit integers portably (Bug#8435).
31 Without this change, on typical 64-bit hosts error ("...%d...", N)
32 was used to print both 32- and 64-bit integers N, which relied on
33 undefined behavior.
34 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
35 New macro.
36 * lisp.h (error, verror): Mark as printf-like functions.
37 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
38 Report overflow in size calculations when allocating printf buffer.
39 Do not truncate output string at its first null byte.
40 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
41 Truncate the output at a character boundary, since vsnprintf does not
42 do that.
43 * charset.c (check_iso_charset_parameter): Convert internal
44 character to string before calling 'error', since %c now has the
45 printf meaning.
46 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
47 overflow when computing char to be passed to 'error'. Do not
48 pass Lisp_Object to 'error'; pass the integer instead.
49 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
50 formatted with plain %d.
51
52 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
53
54 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
55
56 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
57
58 * xterm.c (x_catch_errors): Remove duplicate declaration.
59
60 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
61
62 * xdisp.c, lisp.h (message_nolog): Remove; unused.
63
64 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
65
66 * ftfont.c (get_adstyle_property, ftfont_pattern_entity): Use
67 unsigned char, to match FcChar8 type definition.
68
69 * xterm.c (handle_one_xevent):
70 * xmenu.c (create_and_show_popup_menu):
71 * xselect.c (x_decline_selection_request)
72 (x_reply_selection_request): Avoid type-punned deref of X events.
73
74 2011-04-09 Eli Zaretskii <eliz@emacstest.gnu.org>
75
76 Fix some uses of `int' instead of EMACS_INT.
77 * search.c (string_match_1, fast_string_match)
78 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
79 (scan_buffer, find_next_newline_no_quit)
80 (find_before_next_newline, search_command, Freplace_match)
81 (Fmatch_data): Make some `int' variables be EMACS_INT.
82
83 * xdisp.c (display_count_lines): 3rd argument and return value now
84 EMACS_INT. All callers changed.
85 (pint2hrstr): Last argument is now EMACS_INT.
86
87 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
88 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
89 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
90 (decode_coding_utf_16, decode_coding_emacs_mule)
91 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
92 (decode_coding_ccl, decode_coding_charset)
93 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
94 (decode_coding_iso_2022, decode_coding_emacs_mule)
95 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
96 <char_offset, last_offset>: Declare EMACS_INT.
97 (encode_coding_utf_8, encode_coding_utf_16)
98 (encode_coding_emacs_mule, encode_invocation_designation)
99 (encode_designation_at_bol, encode_coding_iso_2022)
100 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
101 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
102 Declare EMACS_INT.
103 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
104 (encode_invocation_designation): Last argument P_NCHARS is now
105 EMACS_INT.
106 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
107 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
108
109 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
110 All users changed.
111
112 * ccl.c (Fccl_execute_on_string): Declare some variables
113 EMACS_INT.
114
115 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
116
117 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
118
119 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
120
121 * process.c (Fformat_network_address): Doc fix.
122
123 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
124
125 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
126
127 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
128
129 * keyboard.c (read_char): Call Lisp function help-form-show,
130 instead of using internal_with_output_to_temp_buffer.
131 (Qhelp_form_show): New var.
132 (syms_of_keyboard): Use DEFSYM macro.
133
134 * print.c (internal_with_output_to_temp_buffer): Function deleted.
135
136 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
137
138 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
139
140 * process.c (Flist_processes): Removed to Lisp.
141 (list_processes_1): Deleted.
142
143 2011-04-06 Eli Zaretskii <eliz@gnu.org>
144
145 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
146
147 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
148
149 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
150
151 Fix more problems found by GCC 4.6.0's static checks.
152
153 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
154
155 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
156
157 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
158
159 * xdisp.c (vmessage): Mark as a printf-like function.
160
161 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
162
163 * sound.c (sound_warning): Don't crash if arg contains a printf format.
164
165 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
166 printf-like functions.
167 (tiff_load): Add casts to remove these marks before passing them
168 to system-supplied API.
169
170 * eval.c (Fsignal): Remove excess argument to 'fatal'.
171
172 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
173 This avoids several warnings with gcc -Wstrict-overflow.
174 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
175 directly, rather than having caller test rule sign. This avoids
176 some unnecessary tests.
177 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
178 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
179 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
180
181 * xfont.c (xfont_text_extents): Remove var that was set but not used.
182 (xfont_open): Avoid unnecessary tests.
183
184 * composite.c (composition_gstring_put_cache): Use unsigned integer.
185
186 * composite.h, composite.c (composition_gstring_put_cache):
187 Use EMACS_INT, not int, for length.
188
189 * composite.h (COMPOSITION_DECODE_REFS): New macro,
190 breaking out part of COMPOSITION_DECODE_RULE.
191 (COMPOSITION_DECODE_RULE): Use it.
192 * composite.c (get_composition_id): Remove unused local vars,
193 by using the new macro.
194
195 * textprop.c (set_text_properties_1): Change while to do-while,
196 since the condition is always true at first.
197
198 * intervals.c (graft_intervals_into_buffer): Mark var as used.
199 (interval_deletion_adjustment): Return unsigned value.
200 All uses changed.
201
202 * process.c (list_processes_1, create_pty, read_process_output):
203 (exec_sentinel): Remove vars that were set but not used.
204 (create_pty): Remove unnecessary "volatile"s.
205 (Fnetwork_interface_info): Avoid possibility of int overflow.
206 (read_process_output): Do adaptive read buffering even if carryover.
207 (read_process_output): Simplify nbytes computation if buffered.
208
209 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
210
211 * syntax.c (scan_words): Remove var that was set but not used.
212 (update_syntax_table): Use unsigned instead of int.
213
214 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
215 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
216 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
217
218 * print.c (print_error_message): Avoid int overflow.
219
220 * font.c (font_list_entities): Redo for clarity,
221 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
222
223 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
224 (font_score): Avoid potential overflow in diff calculation.
225
226 * fns.c (substring_both): Remove var that is set but not used.
227 (sxhash): Redo loop for clarity and to avoid wraparound warning.
228
229 * eval.c (funcall_lambda): Rename local to avoid shadowing.
230
231 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
232 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
233 can always succeed if overflow has undefined behavior.
234
235 * search.c (boyer_moore, wordify): Remove vars set but not used.
236 (wordify): Omit three unnecessary tests.
237
238 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
239 All callers changed. This avoids the need for an unused var.
240
241 * casefiddle.c (casify_region): Remove var that is set but not used.
242
243 * dired.c (file_name_completion): Remove var that is set but not used.
244
245 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
246
247 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
248 (Finsert_file_contents): Remove unnecessary code checking fd.
249
250 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
251 Check for integer overflow on size calculations.
252
253 * buffer.c (Fprevious_overlay_change): Remove var that is set
254 but not used.
255
256 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
257 Remove vars that are set but not used.
258 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
259 (timer_check_2): Mark vars as initialized.
260
261 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
262
263 * image.c (lookup_image): Remove var that is set but not used.
264 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
265
266 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
267 that are set but not used.
268
269 * xfns.c (make_invisible_cursor): Don't return garbage
270 if XCreateBitmapFromData fails (Bug#8410).
271
272 * xselect.c (x_get_local_selection, x_handle_property_notify):
273 Remove vars that are set but not used.
274
275 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
276 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
277
278 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
279 Remove var that is set but not used.
280 (scroll_bar_windows_size): Now size_t, not int.
281 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
282 Check for overflow.
283
284 * xfaces.c (realize_named_face): Remove vars that are set but not used.
285 (map_tty_color) [!defined MSDOS]: Likewise.
286
287 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
288
289 * coding.c: Remove vars that are set but not used.
290 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
291 All callers changed.
292 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
293 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
294 (decode_coding_charset): Remove vars that are set but not used.
295
296 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
297 that is set but not used.
298
299 * print.c (print_object): Remove var that is set but not used.
300
301 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
302 The gnulib version avoids calling malloc in the usual case,
303 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
304 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
305 * filelock.c (current_lock_owner): Likewise.
306 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
307 * sysdep.c: Include allocator.h, careadlinkat.h.
308 (emacs_no_realloc_allocator): New static constant.
309 (emacs_readlink): New function.
310 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
311 ../lib/careadlinkat.h.
312
313 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
314
315 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
316 first non-nil return value).
317
318 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
319
320 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
321 if not defined (Bug#8403).
322
323 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
324
325 * xdisp.c (display_count_lines): Remove parameter `start',
326 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
327 (get_char_face_and_encoding): Remove parameter `multibyte_p',
328 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
329 (fill_stretch_glyph_string): Remove parameters `row' and `area',
330 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
331 and thereabouts. All callers changed.
332 (get_per_char_metric): Remove parameter `f', unused since
333 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
334
335 2011-04-02 Jim Meyering <meyering@redhat.com>
336
337 do not dereference NULL upon failed strdup
338 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
339 (ns_get_family): Likewise.
340
341 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
342
343 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
344
345 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
346
347 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
348 later (Bug#8403).
349
350 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
351
352 Add lexical binding.
353
354 * window.c (Ftemp_output_buffer_show): New fun.
355 (Fsave_window_excursion):
356 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
357
358 * lread.c (lisp_file_lexically_bound_p): New function.
359 (Fload): Bind Qlexical_binding.
360 (readevalloop): Remove `evalfun' arg.
361 Bind Qinternal_interpreter_environment.
362 (Feval_buffer): Bind Qlexical_binding.
363 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
364 Mark as dynamic.
365 (syms_of_lread): Declare `lexical-binding'.
366
367 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
368
369 * keyboard.c (eval_dyn): New fun.
370 (menu_item_eval_property): Use it.
371
372 * image.c (parse_image_spec): Use Ffunctionp.
373
374 * fns.c (concat, mapcar1): Accept byte-code-functions.
375
376 * eval.c (Fsetq): Handle lexical vars.
377 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
378 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
379 (FletX, Flet): Obey lexical binding.
380 (Fcommandp): Handle closures.
381 (Feval): New `lexical' arg.
382 (eval_sub): New function extracted from Feval. Use it almost
383 everywhere where Feval was used. Look up vars in lexical env.
384 Handle closures.
385 (Ffunctionp): Move from subr.el.
386 (Ffuncall): Handle closures.
387 (apply_lambda): Remove `eval_flags'.
388 (funcall_lambda): Handle closures and new byte-code-functions.
389 (Fspecial_variable_p): New function.
390 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
391 but without exporting it to Lisp.
392
393 * doc.c (Fdocumentation, store_function_docstring):
394 * data.c (Finteractive_form): Handle closures.
395
396 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
397 interactive spec.
398
399 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN): New
400 byte-codes.
401 (exec_byte_code): New function extracted from Fbyte_code to handle new
402 calling convention for byte-code-functions. Add new byte-codes.
403
404 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
405
406 * alloc.c (Fmake_symbol): Init new `declared_special' field.
407
408 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
409
410 * xdisp.c (redisplay_internal): Fix prototype.
411
412 2011-03-31 Eli Zaretskii <eliz@gnu.org>
413
414 * xdisp.c (SCROLL_LIMIT): New macro.
415 (try_scrolling): Use it when setting scroll_limit. Limit
416 scrolling to 100 screen lines.
417 (redisplay_window): Even when falling back on "recentering",
418 position point in the window according to scroll-conservatively,
419 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
420
421 (try_scrolling): When point is above the window, allow searching
422 as far as scroll_max, or one screenful, to compute vertical
423 distance from PT to the scroll margin position. This prevents
424 try_scrolling from unnecessarily failing when
425 scroll-conservatively is set to a value slightly larger than the
426 window height. Clean up the case of PT below the margin at bottom
427 of window: scroll_max can no longer be INT_MAX. When aggressive
428 scrolling is in use, don't let point enter the opposite scroll
429 margin as result of the scroll.
430 (syms_of_xdisp) <scroll-conservatively>: Document the
431 threshold of 100 lines for never-recentering scrolling.
432
433 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
434
435 * dispextern.h (move_it_by_lines):
436 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
437 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
438 (message_log_check_duplicate): Remove parameters `prev_bol' and
439 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
440 (redisplay_internal): Remove parameter `preserve_echo_area',
441 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
442
443 * indent.c (Fvertical_motion):
444 * window.c (window_scroll_pixel_based, Frecenter):
445 Don't pass `need_y_p' to `move_it_by_lines'.
446
447 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
448
449 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
450 steal a few bits to be more compact.
451 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
452 Remove unneeded casts.
453
454 * bytecode.c (Fbyte_code): CAR and CDR can GC.
455
456 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
457
458 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
459 binding" message (bug#7967).
460
461 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
462
463 Fix more problems found by GCC 4.6.0's static checks.
464
465 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
466 Remove unused local var.
467
468 * editfns.c (Fmessage_box): Remove unused local var.
469
470 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
471 (note_mode_line_or_margin_highlight, note_mouse_highlight):
472 Omit unused local vars.
473 * window.c (shrink_windows): Omit unused local var.
474 * menu.c (digest_single_submenu): Omit unused local var.
475 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
476 Omit unused local var.
477
478 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
479 Don't assume string length fits in int.
480 (keyremap_step, read_key_sequence): Use size_t for sizes.
481 (read_key_sequence): Don't check last_real_key_start redundantly.
482
483 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
484 instead of alloca (Bug#8344).
485
486 * eval.c (Fbacktrace): Don't assume nargs fits in int.
487 (Fbacktrace_frame): Don't assume nframes fits in int.
488
489 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
490
491 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
492 concerns.
493
494 * term.c (produce_glyphless_glyph): Remove unnecessary test.
495
496 * cm.c (calccost): Turn while-do into do-while, for clarity.
497
498 * keyboard.c (syms_of_keyboard): Use the same style as later
499 in this function when indexing through an array. This also
500 works around GCC bug 48267.
501
502 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
503
504 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
505
506 * chartab.c (sub_char_table_ref_and_range): Redo for slight
507 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
508
509 * keyboard.c, keyboard.h (num_input_events): Now size_t.
510 This avoids undefined behavior on integer overflow, and is a bit
511 more convenient anyway since it is compared to a size_t variable.
512
513 Variadic C functions now count arguments with size_t, not int.
514 This avoids an unnecessary limitation on 64-bit machines, which
515 caused (substring ...) to crash on large vectors (Bug#8344).
516 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
517 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
518 All variadic functions and their callers changed accordingly.
519 (struct gcpro.nvars): Now size_t, not int. All uses changed.
520 * data.c (arith_driver, float_arith_driver): Likewise.
521 * editfns.c (general_insert_function): Likewise.
522 * eval.c (struct backtrace.nargs, interactive_p)
523 (internal_condition_case_n, run_hook_with_args, apply_lambda)
524 (funcall_lambda, mark_backtrace): Likewise.
525 * fns.c (concat): Likewise.
526 * frame.c (x_set_frame_parameters): Likewise.
527 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
528 0 if not found, not -1. All callers changed.
529
530 * alloc.c (garbage_collect): Don't assume stack size fits in int.
531 (stack_copy_size): Now size_t, not int.
532 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
533
534 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
535
536 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
537 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
538 All callers changed.
539
540 * lisp.h (multibyte_char_to_unibyte):
541 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
542 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
543 * character.h (CHAR_TO_BYTE8):
544 * cmds.c (internal_self_insert):
545 * editfns.c (general_insert_function):
546 * keymap.c (push_key_description):
547 * search.c (Freplace_match):
548 * xdisp.c (message_dolog, set_message_1): All callers changed.
549
550 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
551
552 * keyboard.c (safe_run_hook_funcall): New function.
553 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
554 don't set the hook to nil, but remove the offending function instead.
555 (Qcommand_hook_internal): Remove, unused.
556 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
557 Vcommand_hook_internal.
558
559 * eval.c (enum run_hooks_condition): Remove.
560 (funcall_nil, funcall_not): New functions.
561 (run_hook_with_args): Call each function through a `funcall' argument.
562 Remove `cond' argument, now redundant.
563 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
564 (Frun_hook_with_args_until_failure): Adjust accordingly.
565 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
566
567 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
568
569 * dispextern.h (string_buffer_position): Remove declaration.
570
571 * print.c (strout): Remove parameter `multibyte', unused since
572 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
573
574 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
575 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
576 All callers changed.
577
578 * w32.c (_wsa_errlist): Use braces for struct initializers.
579
580 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
581 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
582 All callers changed.
583 (string_buffer_position): Likewise. Also, make static (it's never
584 used outside xdisp.c).
585 (cursor_row_p): Remove parameter `w', unused since
586 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
587 (decode_mode_spec): Remove parameter `precision', introduced during
588 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
589 All callers changed.
590
591 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
592
593 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
594
595 2011-03-27 Anders Lindgren <andlind@gmail.com>
596
597 * nsterm.m (ns_menu_bar_is_hidden): New variable.
598 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
599 (ns_update_auto_hide_menu_bar): New functions.
600 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
601 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
602 ns_constrain_all_frames.
603 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
604 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
605
606 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
607
608 * nsmenu.m (runDialogAt): Remove argument to timer_check.
609
610 2011-03-27 Glenn Morris <rgm@gnu.org>
611
612 * syssignal.h: Replace RETSIGTYPE with void.
613 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
614 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
615 Replace SIGTYPE with void everywhere.
616 * s/usg5-4-common.h (SIGTYPE): Remove definition.
617 * s/template.h (SIGTYPE): Remove commented out definition.
618
619 2011-03-26 Eli Zaretskii <eliz@gnu.org>
620
621 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
622 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
623
624 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
625
626 * w32.c (read_unc_volume): Use parameter `henum', instead of
627 global variable `wget_enum_handle'.
628
629 * keymap.c (describe_vector): Remove parameters `indices' and
630 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
631 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
632
633 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
634
635 * keyboard.c (timer_check): Remove parameter `do_it_now',
636 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
637 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
638 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
639
640 * keyboard.c (read_char):
641 * w32menu.c (w32_menu_display_help):
642 * xmenu.c (show_help_event, menu_help_callback):
643 Adjust calls to `show_help_echo'.
644
645 * gtkutil.c (xg_maybe_add_timer):
646 * keyboard.c (readable_events):
647 * process.c (wait_reading_process_output):
648 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
649
650 * insdel.c (adjust_markers_gap_motion):
651 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
652 (gap_left, gap_right): Don't call it.
653
654 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
655
656 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
657 incurred during fontification.
658
659 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
660
661 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
662 (DEFVAR_PER_BUFFER): Don't pass it.
663
664 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
665 (scrolling_window): Don't pass it.
666
667 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
668
669 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
670
671 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
672 and `suffix'.
673 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
674 of variables specific to SELinux and computation of `encoded_absname'.
675
676 * image.c (XPutPixel): Remove unused variable `height'.
677
678 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
679
680 * unexw32.c (get_section_info): Remove unused variable `section'.
681
682 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
683 (system_process_attributes): Remove unused variable `sess'.
684 (sys_read): Remove unused variable `err'.
685
686 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
687 (w32_wnd_proc): Remove unused variable `isdead'.
688 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
689 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
690 (x_create_tip_frame): Remove unused variable `tem'.
691
692 * w32inevt.c (w32_console_read_socket):
693 Remove unused variable `no_events'.
694
695 * w32term.c (x_draw_composite_glyph_string_foreground):
696 Remove unused variable `width'.
697
698 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
699
700 * w32term.c (x_set_glyph_string_clipping):
701 Don't pass uninitialized region to CombineRgn.
702
703 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
704
705 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
706 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
707 (Fx_close_connection): Remove unused variable `i'.
708
709 * w32font.c (w32font_draw): Return number of glyphs.
710 (w32font_open_internal): Remove unused variable `i'.
711 (w32font_driver): Add missing initializer.
712
713 * w32menu.c (utf8to16): Remove unused variable `utf16'.
714 (fill_in_menu): Remove unused variable `items_added'.
715
716 * w32term.c (last_mouse_press_frame): Remove static global variable.
717 (w32_clip_to_row): Remove unused variable `f'.
718 (x_delete_terminal): Remove unused variable `i'.
719
720 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
721 (NOTHING): Remove unused static global variable.
722 (uniscribe_check_otf): Remove unused variable `table'.
723 (uniscribe_font_driver): Add missing initializers.
724
725 2011-03-23 Julien Danjou <julien@danjou.info>
726
727 * term.c (Fsuspend_tty, Fresume_tty):
728 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
729 * window.c (temp_output_buffer_show):
730 * insdel.c (signal_before_change):
731 * frame.c (Fhandle_switch_frame):
732 * fileio.c (Fdo_auto_save):
733 * emacs.c (Fkill_emacs):
734 * editfns.c (save_excursion_restore):
735 * cmds.c (internal_self_insert):
736 * callint.c (Fcall_interactively):
737 * buffer.c (Fkill_all_local_variables):
738 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
739 Use Frun_hooks.
740 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
741 unconditionnaly since it does the check itself.
742
743 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
744
745 Fix more problems found by GCC 4.5.2's static checks.
746
747 * coding.c (encode_coding_raw_text): Avoid unnecessary test
748 the first time through the loop, since we know p0 < p1 then.
749 This also avoids a gcc -Wstrict-overflow warning.
750
751 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
752 leading to a memory leak, possible in functions like
753 load_charset_map_from_file that can allocate an unbounded number
754 of objects (Bug#8318).
755
756 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
757 that could (at least in theory) be that large.
758
759 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
760 This is less likely to overflow, and avoids undefined behavior if
761 overflow does occur. All callers changed. Use strtoul to scan
762 for the unsigned long integer.
763 (pint2hrstr): Simplify and tune code slightly.
764 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
765
766 * scroll.c (do_scrolling): Work around GCC bug 48228.
767 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
768
769 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
770 This also avoids a warning with gcc -Wstrict-overflow.
771 (validate_x_resource_name): Simplify count usage.
772 This also avoids a warning with gcc -Wstrict-overflow.
773
774 * fileio.c (Fcopy_file): Report error if fchown or fchmod
775 fail (Bug#8306).
776
777 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
778
779 * process.c (Fmake_network_process): Use socklen_t, not int,
780 where POSIX says socklen_t is required in portable programs.
781 This fixes a porting bug on hosts like 64-bit HP-UX, where
782 socklen_t is wider than int (Bug#8277).
783 (Fmake_network_process, server_accept_connection):
784 (wait_reading_process_output, read_process_output):
785 Likewise.
786
787 * process.c: Rename or move locals to avoid shadowing.
788 (list_processes_1, Fmake_network_process):
789 (read_process_output_error_handler, exec_sentinel_error_handler):
790 Rename or move locals.
791 (Fmake_network_process): Define label "retry_connect" only if needed.
792 (Fnetwork_interface_info): Fix pointer signedness.
793 (process_send_signal): Add cast to avoid pointer signedness problem.
794 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
795 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
796
797 Make tparam.h and terminfo.c consistent.
798 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
799 Include tparam.h instead, since it declares them.
800 * cm.h (PC): Remove extern decl; tparam.h now does this.
801 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
802 * terminfo.c: Include tparam.h, to check interfaces.
803 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
804 (tparam): Adjust signature to match interface in tparam.h;
805 this removes some undefined behavior. Check that outstring and len
806 are zero, which they always are with Emacs.
807 * tparam.h (PC, BC, UP): New extern decls.
808
809 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
810 (xftfont_open): Rename locals to avoid shadowing.
811
812 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
813 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
814 (OTF_TAG_SYM): Omit macro if not needed.
815 (ftfont_list): Remove unused local.
816 (get_adstyle_property, ftfont_pattern_entity):
817 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
818 Rename locals to avoid shadowing.
819
820 * xfont.c (xfont_list_family): Mark var as initialized.
821
822 * xml.c (make_dom): Now static.
823
824 * composite.c (composition_compute_stop_pos): Rename local to
825 avoid shadowing.
826 (composition_reseat_it): Remove unused locals.
827 (find_automatic_composition, composition_adjust_point): Likewise.
828 (composition_update_it): Mark var as initialized.
829 (find_automatic_composition): Mark vars as initialized,
830 with a FIXME (Bug#8290).
831
832 character.h: Rename locals to avoid shadowing.
833 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
834 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
835 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
836 (BUF_DEC_POS): Be more systematic about renaming local temporaries
837 to avoid shadowing.
838
839 * textprop.c (property_change_between_p): Remove; unused.
840
841 * intervals.c (interval_start_pos): Now static.
842
843 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
844
845 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
846 Rename locals to avoid shadowing.
847
848 * sound.c (wav_play, au_play, Fplay_sound_internal):
849 Fix pointer signedness.
850 (alsa_choose_format): Remove unused local var.
851 (wav_play): Initialize a variable to 0, to prevent undefined
852 behavior (Bug#8278).
853
854 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
855
856 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
857
858 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
859 clobbering (Bug#8298).
860 * sysdep.c (sys_subshell): Likewise.
861 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
862
863 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
864 This should get cleaned up, so that child_setup has the
865 same signature on all platforms.
866
867 * callproc.c (call_process_cleanup): Now static.
868 (relocate_fd): Rename locals to avoid shadowing.
869
870 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
871
872 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
873 not to be necessary, and produces flickering.
874
875 2011-03-20 Glenn Morris <rgm@gnu.org>
876
877 * config.in: Remove file.
878
879 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
880
881 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
882 are now in src/globals.h.
883 (syms_of_minibuf): Remove spurious & from previous change.
884
885 2011-03-20 Leo <sdl.web@gmail.com>
886
887 * minibuf.c (completing-read-function): New variable.
888 (completing-read-default): Rename from completing-read.
889 (completing-read): Call completing-read-function.
890
891 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
892
893 * xfaces.c (Fx_load_color_file):
894 Read color file from absolute filename (bug#8250).
895
896 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
897
898 * makefile.w32-in: Update dependencies.
899
900 2011-03-17 Eli Zaretskii <eliz@gnu.org>
901
902 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
903
904 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
905
906 Fix more problems found by GCC 4.5.2's static checks.
907
908 * process.c (make_serial_process_unwind, send_process_trap):
909 (sigchld_handler): Now static.
910
911 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
912 That way, the code declares only the vars that it needs.
913 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
914 * s/cygwin.h (PTY_ITERATION): Likewise.
915 * s/darwin.h (PTY_ITERATION): Likewise.
916 * s/gnu-linux.h (PTY_ITERATION): Likewise.
917
918 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
919 * process.c (allocate_pty): Don't declare stb unless it's needed.
920
921 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
922 (CONSTANTLIM): Remove; unused.
923 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
924 Define only if needed.
925
926 * unexelf.c (unexec): Name an expression,
927 to avoid gcc -Wbad-function-cast warning.
928 Use a different way to cause a compilation error if anyone uses
929 n rather than nn, a way that does not involve shadowing.
930 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
931
932 * deps.mk (unexalpha.o): Remove; unused.
933
934 New file unexec.h, the (simple) interface for unexec (Bug#8267).
935 * unexec.h: New file.
936 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
937 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
938 Depend on unexec.h.
939 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
940 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
941 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
942 Change as necessary to match prototype in unexec.h.
943
944 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
945 shadowing.
946 (back_comment, skip_chars): Mark vars as initialized.
947
948 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
949 Rename locals to avoid shadowing.
950
951 * lread.c (read1): Rewrite so as not to use empty "else".
952 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
953
954 * print.c (Fredirect_debugging_output): Fix pointer signedess.
955
956 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
957 warning when compiling print.c.
958
959 * font.c (font_unparse_fcname): Abort in an "impossible" situation
960 instead of using an uninitialized var.
961 (font_sort_entities): Mark var as initialized.
962
963 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
964
965 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
966 pointers to constants.
967 (font_parse_fcname): Remove unused vars.
968 (font_delete_unmatched): Now static.
969 (font_get_spec): Remove; unused.
970 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
971 (font_update_drivers, Ffont_get_glyphs, font_add_log):
972 Rename or move locals to avoid shadowing.
973
974 * fns.c (require_nesting_list, require_unwind): Now static.
975 (Ffillarray): Rename locals to avoid shadowing.
976
977 * floatfns.c (domain_error2): Define only if needed.
978 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
979
980 * alloc.c (mark_backtrace): Move decl from here ...
981 * lisp.h: ... to here, so that it can be checked.
982
983 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
984 (Fdefvar): Rewrite so as not to use empty "else".
985 (lisp_indirect_variable): Name an expression,
986 to avoid gcc -Wbad-function-cast warning.
987 (Fdefvar): Rename locals to avoid shadowing.
988
989 * callint.c (quotify_arg, quotify_args): Now static.
990 (Fcall_interactively): Rename locals to avoid shadowing.
991 Use const pointer when appropriate.
992
993 * lisp.h (get_system_name, get_operating_system_release):
994 Move decls here, to check interfaces.
995 * process.c (get_operating_system_release): Move decl to lisp.h.
996 * xrdb.c (get_system_name): Likewise.
997 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
998 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
999 some of which prompt warnings from gcc -Wbad-function-cast.
1000 (Fformat_time_string, Fencode_time, Finsert_char):
1001 (Ftranslate_region_internal, Fformat):
1002 Rename or remove local vars to avoid shadowing.
1003 (Ftranslate_region_internal): Mark var as initialized.
1004
1005 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
1006 avoid shadowing.
1007
1008 * lisp.h (eassert): Check that the argument compiles, even if
1009 ENABLE_CHECKING is not defined.
1010
1011 * data.c (Findirect_variable): Name an expression, to avoid
1012 gcc -Wbad-function-cast warning.
1013 (default_value, arithcompare, arith_driver, arith_error): Now static.
1014 (store_symval_forwarding): Rename local to avoid shadowing.
1015 (Fmake_variable_buffer_local, Fmake_local_variable):
1016 Mark variables as initialized.
1017 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
1018
1019 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
1020 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
1021 Rename locals to avoid shadowing.
1022 (mark_stack): Move local variables into the #ifdef region where
1023 they're used.
1024 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
1025 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
1026 needed otherwise.
1027 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
1028 (GC_STRING_CHARS): Remove; not used.
1029 (Fmemory_limit): Cast sbrk's returned value to char *.
1030
1031 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
1032 avoids undefined behavior in theory.
1033
1034 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
1035
1036 Use functions, not macros, for up- and down-casing (Bug#8254).
1037 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
1038 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
1039 to use the following functions instead of these macros.
1040 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
1041 EMACS_INT, since callers assume the returned value fits in int.
1042 (upcase1): Likewise, for UPCASE_TABLE.
1043 (uppercasep, lowercasep, upcase): New static inline functions.
1044 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
1045 the race-condition problem in the old DOWNCASE.
1046
1047 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
1048 Rename locals to avoid shadowing.
1049 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
1050 (regex_compile, re_search_2, re_match_2_internal):
1051 Remove unused local vars.
1052 (FREE_VAR): Rewrite so as not to use empty "else",
1053 which gcc can warn about.
1054 (regex_compile, re_match_2_internal): Mark locals as initialized.
1055 (RETALLOC_IF): Define only if needed.
1056 (WORDCHAR_P): Likewise. This one is never needed, but is used
1057 only in a comment talking about a compiler bug, so put inside
1058 the #if 0 of that comment.
1059 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
1060 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
1061 Remove; unused.
1062
1063 * search.c (boyer_moore): Rename locals to avoid shadowing.
1064 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
1065 (PREV_CHAR_BOUNDARY): Likewise.
1066
1067 * search.c (simple_search): Remove unused var.
1068
1069 * dired.c (compile_pattern): Move decl from here ...
1070 * lisp.h: ... to here, so that it can be checked.
1071 (struct re_registers): New forward decl.
1072
1073 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
1074
1075 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
1076 All uses changed.
1077 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
1078 Rename locals to avoid shadowing.
1079 (Fvertical_motion): Mark locals as initialized.
1080
1081 * casefiddle.c (casify_object, casify_region): Now static.
1082 (casify_region): Mark local as initialized.
1083
1084 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
1085
1086 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
1087 New macros, so that the caller can use some names other than
1088 gcpro1, gcpro2, etc.
1089 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
1090 of the new macros.
1091 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
1092 argument, for consistency with GCPRO2_VAR, etc: it is now the
1093 prefix of the variable, not the variable itself. All uses
1094 changed.
1095 * dired.c (directory_files_internal, file_name_completion):
1096 Rename locals to avoid shadowing.
1097
1098 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
1099 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
1100 dired.c's scmp function, had undefined behavior.
1101 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
1102 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
1103 * buffer.h: ... to here, because these macros use current_buffer,
1104 and the new implementation with inline functions needs to have
1105 current_buffer in scope now, rather than later when the macros
1106 are used.
1107 (downcase, upcase1): New static inline functions.
1108 (DOWNCASE, UPCASE1): Reimplement using these functions.
1109 This avoids undefined behavior in expressions like
1110 DOWNCASE (x) == DOWNCASE (y), which previously suffered
1111 from race conditions in accessing the global variables
1112 case_temp1 and case_temp2.
1113 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
1114 * lisp.h (case_temp1, case_temp2): Remove their decls.
1115 * character.h (ASCII_CHAR_P): Move from here ...
1116 * lisp.h: ... to here, so that the inline functions mentioned
1117 above can use them.
1118
1119 * dired.c (directory_files_internal_unwind): Now static.
1120
1121 * fileio.c (file_name_as_directory, directory_file_name):
1122 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
1123 Now static.
1124 (file_name_as_directory): Use const pointers when appropriate.
1125 (Fexpand_file_name): Likewise. In particular, newdir might
1126 point at constant storage, so make it a const pointer.
1127 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
1128 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
1129 signedness issues.
1130 (Fset_file_times, Finsert_file_contents, auto_save_error):
1131 Rename locals to avoid shadowing.
1132
1133 * minibuf.c (choose_minibuf_frame_1): Now static.
1134 (Ftry_completion, Fall_completions): Rename or remove locals
1135 to avoid shadowing.
1136
1137 * marker.c (bytepos_to_charpos): Remove; unused.
1138
1139 * lisp.h (verify_bytepos, count_markers): New decls,
1140 so that gcc does not warn that these functions aren't declared.
1141
1142 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
1143 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
1144 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
1145 (copy_text): Remove unused local var.
1146
1147 * filelock.c (within_one_second): Now static.
1148 (lock_file_1): Rename local to avoid shadowing.
1149
1150 * buffer.c (fix_overlays_before): Mark locals as initialized.
1151 (fix_start_end_in_overlays): Likewise. This function should be
1152 simplified by using pointers-to-pointers, but that's a different
1153 matter.
1154 (switch_to_buffer_1): Now static.
1155 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
1156 (report_overlay_modification): Rename locals to avoid shadowing.
1157
1158 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
1159 Fix pointer signedness issue.
1160 (sys_subshell): Mark local as volatile if checking for lint,
1161 to suppress a gcc -Wclobbered warning that does not seem to be right.
1162 (MAXPATHLEN): Define only if needed.
1163
1164 * process.c (serial_open, serial_configure): Move decls from here ...
1165 * systty.h: ... to here, so that they can be checked.
1166
1167 * fns.c (get_random, seed_random): Move extern decls from here ...
1168 * lisp.h: ... to here, so that they can be checked.
1169
1170 * sysdep.c (reset_io): Now static.
1171 (wait_for_termination_signal): Remove; unused.
1172
1173 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
1174 (copy_keymap_item, append_key, push_text_char_description):
1175 Now static.
1176 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
1177 (DENSE_TABLE_SIZE): Remove; unused.
1178 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
1179 (describe_map_tree):
1180 Rename locals to avoid shadowing.
1181
1182 * keyboard.c: Declare functions static if they are not used elsewhere.
1183 (echo_char, echo_dash, cmd_error, top_level_2):
1184 (poll_for_input, handle_async_input): Now static.
1185 (read_char, kbd_buffer_get_event, make_lispy_position):
1186 (make_lispy_event, make_lispy_movement, apply_modifiers):
1187 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
1188 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
1189 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
1190 (read_key_sequence, read_char): Mark locals as initialized.
1191 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
1192
1193 * keyboard.h (make_ctrl_char): New decl.
1194 (mark_kboards): Move decl here ...
1195 * alloc.c (mark_kboards): ... from here.
1196
1197 * lisp.h (force_auto_save_soon): New decl.
1198
1199 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
1200 (DEFINE_DUMMY_FUNCTION): New macro.
1201 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
1202 Use it.
1203 (main): Add casts to avoid warnings
1204 if GCC considers string literals to be constants.
1205
1206 * lisp.h (fatal_error_signal): Add decl, since it's exported.
1207
1208 * dbusbind.c: Pointer signedness fixes.
1209 (xd_signature, xd_append_arg, xd_initialize):
1210 (Fdbus_call_method, Fdbus_call_method_asynchronously):
1211 (Fdbus_method_return_internal, Fdbus_method_error_internal):
1212 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
1213 (Fdbus_register_signal): Use SSDATA when the context wants char *.
1214
1215 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
1216 if GCC considers string literals to be constants.
1217 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
1218
1219 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
1220
1221 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
1222 (print_preprocess, print_object): New macro to fix last change.
1223
1224 * print.c (print_preprocess): Don't forget font objects.
1225
1226 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
1227
1228 * emacs.c (USAGE3): Doc fixes.
1229
1230 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
1231
1232 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
1233 structure.
1234
1235 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
1236
1237 * lisp.h (VWindow_system, Qfile_name_history):
1238 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
1239 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
1240 (w32_system_caret_x, w32_system_caret_y): Declare extern.
1241
1242 * w32select.c: Don't #include "keyboard.h".
1243 (run_protected): Add extern declaration for waiting_for_input.
1244
1245 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
1246 * w32console.c (detect_input_pending, read_input_pending)
1247 (encode_terminal_code):
1248 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
1249 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
1250 (w32_system_caret_y, Qfile_name_history):
1251 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
1252 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
1253 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
1254 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
1255 * w32proc.c (Qlocal, report_file_error):
1256 * w32term.c (Vwindow_system, updating_frame):
1257 * w32uniscribe.c (initialized, uniscribe_font_driver):
1258 Remove unneeded extern declarations.
1259
1260 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
1261
1262 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
1263
1264 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
1265
1266 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
1267 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
1268 These macros can no longer be used for assignment.
1269
1270 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1271 Assign struct members directly, instead of using BUF_BEGV etc.
1272 (record_buffer_markers, fetch_buffer_markers): New functions for
1273 recording and fetching special buffer markers.
1274 (set_buffer_internal_1, set_buffer_temp): Use them.
1275
1276 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
1277
1278 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
1279
1280 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
1281 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
1282
1283 * xdisp.c (hscroll_window_tree):
1284 (reconsider_clip_changes): Use PT instead of BUF_PT.
1285
1286 2011-03-13 Eli Zaretskii <eliz@gnu.org>
1287
1288 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
1289 $(EMACS_ROOT)/lib/intprops.h.
1290
1291 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
1292
1293 Fix more problems found by GCC 4.5.2's static checks.
1294
1295 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
1296 to unsigned char * to avoid compiler diagnostic.
1297 (xg_free_frame_widgets): Make it clear that a local variable is
1298 needed only if USE_GTK_TOOLTIP.
1299 (gdk_window_get_screen): Make it clear that this macro is needed
1300 only if USE_GTK_TOOLTIP.
1301 (int_gtk_range_get_value): New function, which avoids a diagnostic
1302 from gcc -Wbad-function-cast.
1303 (xg_set_toolkit_scroll_bar_thumb): Use it.
1304 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
1305 diagnostic from gcc -Wbad-function-cast.
1306 (get_utf8_string, xg_get_file_with_chooser):
1307 Rename locals to avoid shadowing.
1308 (create_dialog): Move locals to avoid shadowing.
1309
1310 * xgselect.c (xg_select): Remove unused var.
1311
1312 * image.c (four_corners_best): Mark locals as initialized.
1313 (gif_load): Initialize transparent_p to zero (Bug#8238).
1314 Mark another local as initialized.
1315 (my_png_error, my_error_exit): Mark with NO_RETURN.
1316
1317 * image.c (clear_image_cache): Now static.
1318 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
1319 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
1320 (x_edge_detection): Remove unnecessary cast that
1321 gcc -Wbad-function-cast diagnoses.
1322 (gif_load): Fix pointer signedness.
1323 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
1324 (jpeg_load, gif_load): Rename locals to avoid shadowing.
1325
1326 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
1327
1328 Improve quality of tests for time stamp overflow.
1329 For example, without this patch (encode-time 0 0 0 1 1
1330 1152921504606846976) returns the obviously-bogus value (-948597
1331 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
1332 reports time overflow. See
1333 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
1334 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
1335 * editfns.c: Include limits.h and intprops.h.
1336 (TIME_T_MIN, TIME_T_MAX): New macros.
1337 (time_overflow): Move earlier, to before first use.
1338 (hi_time, lo_time): New functions, for an accurate test for
1339 out-of-range times.
1340 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
1341 (Fget_internal_run_time): Don't assume time_t fits in int.
1342 (make_time): Use list2 instead of Fcons twice.
1343 (Fdecode_time): More accurate test for out-of-range times.
1344 (check_tm_member): New function.
1345 (Fencode_time): Use it, to test for out-of-range times.
1346 (lisp_time_argument): Don't rely on undefined left-shift and
1347 right-shift behavior when checking for time stamp overflow.
1348
1349 * editfns.c (time_overflow): New function, refactoring common code.
1350 (Fformat_time_string, Fdecode_time, Fencode_time):
1351 (Fcurrent_time_string): Use it.
1352
1353 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
1354 * dired.c (make_time): Move to ...
1355 * editfns.c (make_time): ... here.
1356 * systime.h: Note the move.
1357
1358 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1359
1360 * fringe.c (update_window_fringes): Remove unused variables.
1361
1362 * unexmacosx.c (copy_data_segment): Also copy __got section.
1363 (Bug#8223)
1364
1365 2011-03-12 Eli Zaretskii <eliz@gnu.org>
1366
1367 * termcap.c [MSDOS]: Include "msdos.h".
1368 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
1369 Constify `char *' arguments and their references according to
1370 prototypes in tparam.h.
1371
1372 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
1373
1374 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
1375 Adapt all references accordingly.
1376
1377 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
1378
1379 2011-03-11 Tom Tromey <tromey@redhat.com>
1380
1381 * buffer.c (syms_of_buffer): Remove obsolete comment.
1382
1383 2011-03-11 Eli Zaretskii <eliz@gnu.org>
1384
1385 * termhooks.h (encode_terminal_code): Declare prototype.
1386
1387 * msdos.c (encode_terminal_code): Don't declare prototype.
1388
1389 * term.c (encode_terminal_code): Now external again, used by
1390 w32console.c and msdos.c.
1391
1392 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
1393 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
1394
1395 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
1396
1397 Fix some minor problems found by GCC 4.5.2's static checks.
1398
1399 * fringe.c (update_window_fringes): Mark locals as initialized
1400 (Bug#8227).
1401 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
1402
1403 * alloc.c (mark_fringe_data): Move decl from here ...
1404 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
1405 to check its interface.
1406 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
1407
1408 * fontset.c (free_realized_fontset): Now static.
1409 (Fset_fontset_font): Rename local to avoid shadowing.
1410 (fontset_font): Mark local as initialized.
1411 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
1412
1413 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
1414
1415 * xselect.c (x_disown_buffer_selections): Remove; not used.
1416 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
1417 (x_own_selection, Fx_disown_selection_internal): Rename locals
1418 to avoid shadowing.
1419 (x_handle_dnd_message): Remove local to avoid shadowing.
1420
1421 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
1422 so that the caller can use some name other than gcpro1.
1423 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
1424 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
1425 (Fx_backspace_delete_keys_p):
1426 Use them to avoid shadowing, and rename vars to avoid shadowing.
1427 (x_decode_color, x_set_name, x_window): Now static.
1428 (Fx_create_frame): Add braces to silence GCC warning.
1429 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
1430 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
1431 Remove unused locals.
1432 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
1433 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
1434 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
1435 macros.
1436
1437 * xterm.h (x_mouse_leave): New decl.
1438
1439 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
1440 Remove unused functions.
1441 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
1442 (x_calc_absolute_position): Now static.
1443 (XTread_socket): Don't define label "out" unless it's used.
1444 Don't declare local "event" unless it's used.
1445 (x_iconify_frame, x_free_frame_resources): Don't declare locals
1446 unless they are used.
1447 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
1448 (x_fatal_error_signal): Remove; not used.
1449 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
1450 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
1451 (x_error_catcher, x_connection_closed, x_error_handler):
1452 (x_error_quitter, xembed_send_message, x_iconify_frame):
1453 (my_log_handler): Rename locals to avoid shadowing.
1454 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
1455 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
1456
1457 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
1458 Rename or move locals to avoid shadowing.
1459 (tty_defined_color, merge_face_heights): Now static.
1460 (free_realized_faces_for_fontset): Remove; not used.
1461 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
1462 does not deduce is never used uninitialized.
1463 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
1464 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
1465
1466 * terminal.c (store_terminal_param): Now static.
1467
1468 * xmenu.c (menu_highlight_callback): Now static.
1469 (set_frame_menubar): Remove unused local.
1470 (xmenu_show): Rename parameter to avoid shadowing.
1471 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
1472 since they might point to immutable storage.
1473 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
1474 since it's unused otherwise.
1475
1476 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
1477 Add a FIXME, since the code still doesn't look right. (Bug#8215)
1478 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
1479 avoids a gcc -Wuninitialized diagnostic.
1480 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
1481 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
1482 does not deduce are never used uninitialized.
1483
1484 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
1485
1486 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
1487 * window.c (window_loop, size_window):
1488 (run_window_configuration_change_hook, enlarge_window): Likewise.
1489
1490 * window.c (display_buffer): Now static.
1491 (size_window): Mark variables that gcc -Wuninitialized
1492 does not deduce are never used uninitialized.
1493 * window.h (check_all_windows): New decl, to forestall
1494 gcc -Wmissing-prototypes diagnostic.
1495 * dispextern.h (bidi_dump_cached_states): Likewise.
1496
1497 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
1498 shadowing.
1499 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
1500 Include <limits.h>.
1501 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
1502 and to avoid gcc -Wuninitialized warning.
1503 (load_charset_map): Mark variables that gcc -Wuninitialized
1504 does not deduce are never used uninitialized.
1505 (load_charset): Abort instead of using uninitialized var (Bug#8229).
1506
1507 * coding.c (coding_set_source, coding_set_destination):
1508 Use "else { /* comment */ }" rather than "else /* comment */;"
1509 for clarity, and to avoid gcc -Wempty-body warning.
1510 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
1511 a block, when the outer 'i' will do.
1512 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
1513 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
1514 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
1515 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
1516 (Fdecode_sjis_char, Fdefine_coding_system_internal):
1517 Rename locals to avoid shadowing.
1518 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
1519 * coding.c (emacs_mule_char, encode_invocation_designation):
1520 Now static, since they're not used elsewhere.
1521 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
1522 (decode_coding_object, encode_coding_object, detect_coding_system):
1523 (decode_coding_emacs_mule): Mark variables that gcc
1524 -Wuninitialized does not deduce are never used uninitialized.
1525 (detect_coding_iso_2022): Initialize a local variable that might
1526 be used uninitialized. Leave a FIXME because it's not clear that
1527 this initialization is needed. (Bug#8211)
1528 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
1529 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
1530 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
1531 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
1532 Remove unused macros.
1533
1534 * category.c (hash_get_category_set): Remove unused local var.
1535 (copy_category_table): Now static, since it's not used elsewhere.
1536 * character.c (string_count_byte8): Likewise.
1537
1538 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
1539 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
1540
1541 * chartab.c (copy_sub_char_table): Now static, since it's not used
1542 elsewhere.
1543 (sub_char_table_ref_and_range, char_table_ref_and_range):
1544 Rename locals to avoid shadowing.
1545 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
1546
1547 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
1548 (BIDI_BOB): Remove unused macro.
1549
1550 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
1551 deduce are never used uninitialized.
1552 * term.c (encode_terminal_code): Likewise.
1553
1554 * term.c (encode_terminal_code): Now static. Remove unused local.
1555
1556 * tparam.h: New file.
1557 * term.c, tparam.h: Include it.
1558 * deps.mk (term.o, tparam.o): Depend on tparam.h.
1559 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
1560 Move these decls to tparam.h, and make them agree with what
1561 is actually in tparam.c. The previous trick of using incompatible
1562 decls in different modules does not conform to the C standard.
1563 All callers of tparam changed to use tparam's actual API.
1564 * tparam.c (tparam1, tparam, tgoto):
1565 Use const pointers where appropriate.
1566
1567 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
1568 * cm.h (struct cm): Likewise.
1569 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
1570 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
1571 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
1572 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
1573 (turn_on_face, init_tty): Likewise.
1574 * termchar.h (struct tty_display_info): Likewise.
1575
1576 * term.c (term_mouse_position): Rename local to avoid shadowing.
1577
1578 * alloc.c (mark_ttys): Move decl from here ...
1579 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
1580
1581 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
1582
1583 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
1584
1585 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
1586
1587 * search.c (compile_pattern_1): Remove argument regp, unused since
1588 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
1589 (compile_pattern): Don't pass it.
1590
1591 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
1592
1593 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
1594 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
1595 for ! HAVE_GTK3.
1596 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
1597
1598 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
1599
1600 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
1601 gdk_window_get_screen, gdk_window_get_geometry,
1602 gdk_x11_window_lookup_for_display and GDK_KEY_g.
1603 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
1604 (xg_get_pixbuf_from_pixmap): New function.
1605 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
1606 to Pixmap, take frame as parameter, remove GdkColormap parameter.
1607 Call xg_get_pixbuf_from_pixmap instead of
1608 gdk_pixbuf_get_from_drawable.
1609 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
1610 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
1611 (xg_check_special_colors): Use GtkStyleContext and its functions
1612 for HAVE_GTK3.
1613 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
1614 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
1615 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
1616 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
1617 Call gtk_widget_get_preferred_size.
1618 (xg_frame_resized): gdk_window_get_geometry only takes 5
1619 parameters.
1620 (xg_win_to_widget, xg_event_is_for_menubar):
1621 Call gdk_x11_window_lookup_for_display.
1622 (xg_set_widget_bg): New function.
1623 (delete_cb): New function.
1624 (xg_create_frame_widgets): connect delete-event to delete_cb.
1625 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
1626 (xg_set_background_color): Call xg_set_widget_bg.
1627 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
1628 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
1629 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
1630 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
1631 if ! HAVE_GTK3.
1632 (update_frame_tool_bar): Call gtk_widget_hide.
1633 (xg_initialize): Use GDK_KEY_g.
1634
1635 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
1636 if ! HAVE_GTK3
1637 (x_session_initialize): Call gdk_x11_set_sm_client_id.
1638
1639 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
1640 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
1641 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
1642
1643 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
1644
1645 * w32xfns.c (select_palette): Check success of RealizePalette against
1646 GDI_ERROR, not zero.
1647
1648 See ChangeLog.11 for earlier changes.
1649
1650 ;; Local Variables:
1651 ;; coding: utf-8
1652 ;; End:
1653
1654 Copyright (C) 2011 Free Software Foundation, Inc.
1655
1656 This file is part of GNU Emacs.
1657
1658 GNU Emacs is free software: you can redistribute it and/or modify
1659 it under the terms of the GNU General Public License as published by
1660 the Free Software Foundation, either version 3 of the License, or
1661 (at your option) any later version.
1662
1663 GNU Emacs is distributed in the hope that it will be useful,
1664 but WITHOUT ANY WARRANTY; without even the implied warranty of
1665 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1666 GNU General Public License for more details.
1667
1668 You should have received a copy of the GNU General Public License
1669 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.