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