]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Remove kludgey save and restore of IT->position for push_it.
[gnu-emacs] / src / ChangeLog
1 2011-05-14 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (compute_display_string_pos): Non-trivial implementation.
4 (compute_display_string_end): New function.
5 (push_it): Accept second argument POSITION, where pop_it should
6 jump to continue iteration.
7
8 * dispextern.h (compute_display_string_end): Declare prototype.
9
10 * bidi.c (bidi_resolve_explicit_1): Use ZV for disp_pos.
11 (bidi_fetch_char): Implement support for runs of characters
12 covered by display strings.
13
14 * bidi.c (bidi_fetch_char): Accept also character position
15 corresponding to BYTEPOS. DISP_POS is now a character position,
16 not a byte position. All callers changed.
17 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
18 (bidi_resolve_explicit, bidi_resolve_weak)
19 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20 bidi_it->nchars is non-positive.
21 (bidi_level_of_next_char): Don't try to lookup the cache for the
22 next/previous character if nothing is cached there yet, or if we
23 were just reseat()'ed to a new position.
24 (bidi_paragraph_init, bidi_resolve_explicit_1)
25 (bidi_level_of_next_char): Fix arguments in the calls to
26 bidi_fetch_char.
27
28 2011-05-10 Eli Zaretskii <eliz@gnu.org>
29
30 * xdisp.c (compute_display_string_pos): New function.
31 (reseat_1): Initialize bidi_it.disp_pos.
32
33 * bidi.c (bidi_copy_it): Use offsetof.
34 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
35 (bidi_cache_search, bidi_cache_iterator_state)
36 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
37 (bidi_level_of_next_char, bidi_move_to_visually_next): Support
38 character positions inside a run of characters covered by a
39 display string.
40 (bidi_paragraph_init, bidi_resolve_explicit_1)
41 (bidi_level_of_next_char): Call bidi_fetch_char and
42 bidi_fetch_char_advance instead of FETCH_CHAR and
43 FETCH_CHAR_ADVANCE.
44 (bidi_init_it): Initialize new members.
45 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
46 definitions.
47 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
48 instead of using explicit *_CHAR codes.
49 (bidi_resolve_explicit, bidi_resolve_weak): Use
50 FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
51 bidirectional text is supported only in multibyte buffers.
52
53 * dispextern.h (struct bidi_it): New members nchars and disp_pos.
54 ch_len is now EMACS_INT.
55 (compute_display_string_pos): Declare prototype.
56
57 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
58
59 * w32menu.c (set_frame_menubar): Fix submenu allocation.
60
61 2011-05-07 Eli Zaretskii <eliz@gnu.org>
62
63 * w32console.c (Fset_screen_color): Doc fix.
64 (Fget_screen_color): New function.
65 (syms_of_ntterm): Defsubr it.
66
67 * callproc.c (call_process_cleanup): Don't close and unlink the
68 temporary file if Fcall_process didn't create it in the first
69 place.
70 (Fcall_process): Don't create tempfile if stdout of the child
71 process will be redirected to a file specified with `:file'.
72 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
73 cue to call_process_cleanup not to close that handle.
74
75 2011-05-07 Ben Key <bkey76@gmail.com>
76
77 * makefile.w32-in: The bootstrap-temacs rule now makes use of
78 one of two shell specific rules, either bootstrap-temacs-CMD or
79 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
80 to the previous implementation of the bootstrap-temacs rule.
81 The bootstrap-temacs-CMD rule is similar to the previous
82 implementation of the bootstrap-temacs rule except that it
83 makes use of the ESC_CFLAGS variable instead of the CFLAGS
84 variable.
85
86 These changes, along with some changes to nt/configure.bat,
87 nt/gmake.defs, and nt/nmake.defs, are required to extend my
88 earlier fix to add support for --cflags and --ldflags options
89 that include quotes so that it works whether make uses cmd or
90 sh as the shell.
91
92 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
93
94 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
95 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
96 is a constant.
97 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
98 a string. Handle both cases.
99 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
100 (Fdbus_register_method): Use Qinvalid_function.
101
102 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
103
104 * makefile.w32-in: Update dependencies.
105 (LISP_H): Add inttypes.h and stdin.h.
106 (PROCESS_H): Add unistd.h.
107
108 2011-05-06 Eli Zaretskii <eliz@gnu.org>
109
110 * lread.c: Include limits.h (fixes the MS-Windows build broken by
111 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
112
113 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
114
115 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
116
117 * term.c (vfatal): Remove stray call to va_end.
118 It's not needed and the C Standard doesn't allow it here anyway.
119
120 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
121 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
122
123 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
124 bytes.
125
126 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
127
128 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
129
130 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
131
132 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
133
134 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
135
136 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
137 * charset.c (Fdefine_charset_internal): Don't initialize
138 charset.code_space[15]. The value was garbage, on hosts with
139 32-bit int (Bug#8600).
140
141 * lread.c (read_integer): Be more consistent with string-to-number.
142 Use string_to_number to do the actual conversion; this avoids
143 rounding errors and fixes some other screwups. Without this fix,
144 for example, #x1fffffffffffffff was misread as -2305843009213693952.
145 (digit_to_number): Move earlier, for benefit of read_integer.
146 Return -1 if the digit is out of range for the base, -2 if it is
147 not a digit in any supported base. (Bug#8602)
148
149 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
150
151 * dispnew.c (scrolling_window): Return 1 if we scrolled,
152 to match comment at start of function. This also removes a
153 GCC warning about overflow in a 32+64-bit port.
154
155 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
156
157 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
158 Reported by Stefan Monnier in
159 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
160 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): Use
161 SYMBOLP-guarded XSYMBOL, not XPNTR.
162
163 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
164 (EMACS_UINTPTR): Likewise, with uintptr_t.
165
166 * lisp.h: Prefer 64-bit EMACS_INT if available.
167 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
168 on 32-bit hosts that have 64-bit int, so that they can access
169 large files.
170 However, temporarily disable this change unless the temporary
171 symbol WIDE_EMACS_INT is defined.
172
173 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
174
175 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
176 This removes an assumption that EMACS_INT and long are the same
177 width as pointers. The assumption is true for Emacs porting targets
178 now, but we want to make other targets possible.
179 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
180 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
181 In the rest of the code, change types of integers that hold casted
182 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
183 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
184 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
185 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
186 No need to cast type when ORing.
187 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
188 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
189 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
190 assume EMACS_INT is the same width as char *.
191 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
192 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
193 Remove no-longer-needed casts.
194 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
195 (xg_tool_bar_help_callback, xg_make_tool_item):
196 Use EMACS_INTPTR to hold an integer
197 that will be cast to void *; this can avoid a GCC warning
198 if EMACS_INT is not the same width as void *.
199 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
200 * xdisp.c (display_echo_area_1, resize_mini_window_1):
201 (current_message_1, set_message_1):
202 Use a local to convert to proper width without a cast.
203 * xmenu.c (dialog_selection_callback): Likewise.
204
205 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
206 Also, don't assume VALBITS / RAND_BITS is less than 5,
207 and don't rely on undefined behavior when shifting a 1 left into
208 the sign bit.
209 * lisp.h (get_random): Change signature to match.
210
211 * lread.c (hash_string): Use size_t, not int, for hash computation.
212 Normally we prefer signed values; but hashing is special, because
213 it's better to use unsigned division on hash table sizes so that
214 the remainder is nonnegative. Also, size_t is the natural width
215 for hashing into memory. The previous code used 'int', which doesn't
216 retain enough info to hash well into very large tables.
217 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
218
219 * dbusbind.c: Don't possibly lose pointer info when converting.
220 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
221 Use XPNTR rather than XHASH, so that the high-order bits of
222 the pointer aren't lost when converting through void *.
223
224 * eval.c (Fautoload): Don't double-shift a pointer.
225
226 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
227
228 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
229
230 * gnutls.c (DEF_GNUTLS_FN):
231 * image.c (DEF_IMGLIB_FN): Make function pointers static.
232
233 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
234
235 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
236 marker. (Bug#8610)
237
238 2011-05-05 Eli Zaretskii <eliz@gnu.org>
239
240 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
241 New version that can reserve upto 2GB of heap space.
242
243 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
244
245 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
246
247 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
248
249 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
250 `gnutls_certificate_set_x509_key_file'.
251
252 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
253
254 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
255 Update dependencies.
256
257 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
258
259 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
260 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
261 Remove unused parameter `fildes'.
262 * process.c (read_process_output, send_process): Don't pass it.
263
264 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
265
266 Fix previous change: the library cache is defined in w32.c.
267 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
268 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
269
270 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
271
272 Implement dynamic loading of GnuTLS on Windows.
273
274 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
275 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
276 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
277 Declare.
278
279 * gnutls.c (Qgnutls_dll): Define.
280 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
281 (gnutls_*): Declare function pointers.
282 (init_gnutls_functions): New function to initialize function pointers.
283 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
284 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
285 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
286 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
287 (emacs_gnutls_write, emacs_gnutls_read)
288 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
289 (Fgnutls_available_p): New function.
290 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
291 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
292 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
293
294 * image.c: Include w32.h.
295 (Vimage_type_cache): Delete.
296 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
297 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
298 (w32_delayed_load): Move to w32.c.
299
300 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
301
302 * w32.c (QCloaded_from, Vlibrary_cache): Define.
303 (w32_delayed_load): Move from image.c. When loading a library, record
304 its filename in the :loaded-from property of the library id.
305 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
306 Initialize and staticpro them.
307 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
308
309 * process.c: Include lisp.h before w32.h, not after.
310 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
311 instead of gnutls_record_check_pending.
312
313 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
314
315 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
316
317 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
318 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
319 as passed in.
320
321 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
322
323 * xterm.c (x_set_frame_alpha): Do not set property on anything
324 else than FRAME_X_OUTER_WINDOW (Bug#8608).
325
326 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
327
328 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
329
330 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
331
332 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
333 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
334 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
335 (gnutls_global_initialized, Qgnutls_bootprop_priority)
336 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
337 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
338 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
339 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
340 (Qgnutls_bootprop_callbacks_verify): Make static.
341
342 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
343
344 * callproc.c: Indentation fixup.
345
346 * sysdep.c (wait_for_termination_1): Make static.
347 (wait_for_termination, interruptible_wait_for_termination): Move
348 after wait_for_termination_1.
349
350 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
351
352 * sysdep.c (interruptible_wait_for_termination): New function
353 which is like wait_for_termination, but allows keyboard
354 interruptions.
355
356 * callproc.c (Fcall_process): Add (:file "file") as an option for
357 the STDOUT buffer.
358 (Fcall_process_region): Ditto.
359
360 2011-04-30 Eli Zaretskii <eliz@gnu.org>
361
362 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
363 rather than `XVECTOR (FOO)->size'.
364
365 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
366 inttypes.h, as a gnulib replacement is used if it not available in
367 system headers.
368
369 2011-04-21 Eli Zaretskii <eliz@gnu.org>
370
371 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
372 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
373 of MOST_POSITIVE_FIXNUM. (Bug#8528)
374
375 * coding.c (coding_alloc_by_realloc): Error out if destination
376 will grow beyond MOST_POSITIVE_FIXNUM.
377 (decode_coding_emacs_mule): Abort if there isn't enough place in
378 charbuf for the composition carryover bytes. Reserve an extra
379 space for up to 2 characters produced in a loop.
380 (decode_coding_iso_2022): Abort if there isn't enough place in
381 charbuf for the composition carryover bytes.
382
383 2011-04-21 Eli Zaretskii <eliz@gnu.org>
384
385 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
386 aborting when %lld or %lll format is passed.
387 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
388 %llo or %llx format is passed. (Bug#8545)
389
390 * window.c (window_scroll_line_based): Use a marker instead of
391 simple variables to record original value of point. (Bug#7952)
392
393 * doprnt.c (doprnt): Fix the case where a multibyte sequence
394 produced by %s or %c overflows available buffer space. (Bug#8545)
395
396 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
397
398 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
399 (SIZE_MAX): Move defn after all includes, as they might #define it.
400
401 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
402
403 * w32.c (init_environment): Warn about defaulting HOME to C:\.
404
405 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
406
407 * keyboard.c (Qdelayed_warnings_hook): Define.
408 (command_loop_1): Run `delayed-warnings-hook'
409 if Vdelayed_warnings_list is non-nil.
410 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
411 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
412
413 2011-04-28 Eli Zaretskii <eliz@gnu.org>
414
415 * doprnt.c (doprnt): Don't return value smaller than the buffer
416 size if the message was truncated. (Bug#8545).
417
418 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
419
420 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
421 (Fx_window_property): #if-0 the whole functions, not just the bodies.
422
423 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
424
425 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
426
427 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
428
429 * makefile.w32-in: Update dependencies.
430
431 2011-04-27 Eli Zaretskii <eliz@gnu.org>
432
433 Improve `doprnt' and its usage. (Bug#8545)
434 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
435 `format_end'. Remove support for %l as a conversion specifier.
436 Don't use xrealloc. Improve diagnostics when the %l size modifier
437 is used. Update the commentary.
438
439 * eval.c (verror): Simplify calculation of size_t.
440
441 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
442 messages.
443
444 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
445
446 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
447 change.
448
449 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
450
451 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
452 This makes this file independent of the recent pseudovector change.
453
454 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
455
456 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
457
458 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
459 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
460 Remove unused local.
461 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
462
463 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
464 GCC 4.6.0 optimizes based on type-based alias analysis. For
465 example, if b is of type struct buffer * and v of type struct
466 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
467 != &v->size, and therefore "v->size = 1; b->size = 2; return
468 v->size;" must therefore return 1. This assumption is incorrect
469 for Emacs, since it type-puns struct Lisp_Vector * with many other
470 types. To fix this problem, this patch adds a new type struct
471 vectorlike_header that documents the constraints on layout of vectors
472 and pseudovectors, and helps optimizing compilers not get fooled
473 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
474 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
475 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
476 the size member.
477 (XSETPVECTYPE): Rewrite in terms of new macro.
478 (XSETPVECTYPESIZE): New macro, specifying both type and size.
479 This is a bit clearer, and further avoids the possibility of
480 undesirable aliasing.
481 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
482 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
483 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
484 since Lisp_Subr is a special case (no "next" field).
485 (ASIZE): Now uses header.size rather than size. All
486 previous uses of XVECTOR (foo)->size replaced to use this macro,
487 to avoid the hassle of writing XVECTOR (foo)->header.size.
488 (struct vectorlike_header): New type.
489 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
490 object, to help avoid aliasing.
491 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
492 (SUBRP): Likewise, since Lisp_Subr is a special case.
493 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
494 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
495 (struct Lisp_Hash_Table): Combine first two members into a single
496 struct vectorlike_header member. All uses of "size" and "next" members
497 changed to be "header.size" and "header.next".
498 * buffer.h (struct buffer): Likewise.
499 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
500 * frame.h (struct frame): Likewise.
501 * process.h (struct Lisp_Process): Likewise.
502 * termhooks.h (struct terminal): Likewise.
503 * window.c (struct save_window_data, struct saved_window): Likewise.
504 * window.h (struct window): Likewise.
505 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
506 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
507 * buffer.c (init_buffer_once): Likewise.
508 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
509 special case.
510 * process.c (Fformat_network_address): Use local var for size,
511 for brevity.
512
513 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
514
515 Make the Lisp reader and string-to-float more consistent (Bug#8525)
516 * data.c (atof): Remove decl; no longer used or needed.
517 (digit_to_number): Move to lread.c.
518 (Fstring_to_number): Use new string_to_number function, to be
519 consistent with how the Lisp reader treats infinities and NaNs.
520 Do not assume that floating-point numbers represent EMACS_INT
521 without losing information; this is not true on most 64-bit hosts.
522 Avoid double-rounding errors, by insisting on integers when
523 parsing non-base-10 numbers, as the documentation specifies.
524 * lisp.h (string_to_number): New decl, replacing ...
525 (isfloat_string): Remove.
526 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
527 (read1): Do not accept +. and -. as integers; this
528 appears to have been a coding error. Similarly, do not accept
529 strings like +-1e0 as floating point numbers. Do not report
530 overflow for integer overflows unless the base is not 10 which
531 means we have no simple and reliable way to continue.
532 Break out the floating-point parsing into a new
533 function string_to_number, so that Fstring_to_number parses
534 floating point numbers consistently with the Lisp reader.
535 (digit_to_number): Moved here from data.c. Make it static inline.
536 (E_CHAR, EXP_INT): Remove, replacing with ...
537 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
538 (string_to_number): New function, replacing isfloat_string.
539 This function checks for valid syntax and produces the resulting
540 Lisp float number too. Rework it so that string-to-number
541 no longer mishandles examples like "1.0e+". Use strtoumax,
542 so that overflow for non-base-10 numbers is reported only when
543 there's no portable and simple way to convert to floating point.
544
545 * textprop.c (set_text_properties_1): Rewrite for clarity,
546 and to avoid GCC warning about integer overflow.
547
548 * intervals.h (struct interval): Use EMACS_INT for members
549 where EMACS_UINT might cause problems. See
550 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
551 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
552 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
553 All uses changed.
554 (offset_intervals): Tell GCC not to worry about length overflow
555 when negating a negative length.
556
557 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
558 (overrun_check_free): Likewise.
559
560 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
561 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
562 word size.
563
564 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
565 (gnutls_make_error): Rename local to avoid shadowing.
566 (gnutls_emacs_global_deinit): ifdef out; not used.
567 (Fgnutls_boot): Use const for pointer to readonly storage.
568 Comment out unused local. Fix pointer signedness problems.
569
570 * lread.c (openp): Don't stuff size_t into an 'int'.
571 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
572 about possible signed overflow.
573
574 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
575 (GDK_KEY_g): Don't define if already defined.
576 (xg_prepare_tooltip): Avoid pointer signedness problem.
577 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
578
579 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
580 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
581
582 * xfns.c (Fx_window_property): Simplify a bit,
583 to make a bit faster and to avoid GCC 4.6.0 warning.
584 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
585
586 * fns.c (internal_equal): Don't assume size_t fits in int.
587
588 * alloc.c (compact_small_strings): Tighten assertion a little.
589
590 Replace pEd with more-general pI, and fix some printf arg casts.
591 * lisp.h (pI): New macro, generalizing old pEd macro to other
592 conversion specifiers. For example, use "...%"pI"d..." rather
593 than "...%"pEd"...".
594 (pEd): Remove. All uses replaced with similar uses of pI.
595 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
596 * alloc.c (check_pure_size): Don't overflow by converting size to int.
597 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
598 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
599 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
600 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
601 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
602 64-bit hosts.
603 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
604 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
605 * print.c (safe_debug_print, print_object): Likewise.
606 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
607 to int.
608 Use pI instead of if-then-else-abort. Use %p to avoid casts,
609 avoiding the 0 flag, which is not portable.
610 * process.c (Fmake_network_process): Use pI to avoid cast.
611 * region-cache.c (pp_cache): Likewise.
612 * xdisp.c (decode_mode_spec): Likewise.
613 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
614 behavior on 64-bit hosts with printf arg.
615 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
616 (x_stop_queuing_selection_requests): Likewise.
617 (x_get_window_property): Don't truncate byte count to an 'int'
618 when tracing.
619
620 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
621 here, since it parses constructs like leading '-' and spaces,
622 which are not wanted; and it overflows with large numbers.
623 Instead, simply match F[0-9]+, which is what is wanted anyway.
624
625 * alloc.c: Remove unportable assumptions about struct layout.
626 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
627 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
628 (allocate_vectorlike, make_pure_vector): Use the new macros,
629 plus offsetof, to remove unportable assumptions about struct layout.
630 These assumptions hold on all porting targets that I know of, but
631 they are not guaranteed, they're easy to remove, and removing them
632 makes further changes easier.
633
634 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
635 This doesn't fix a bug but makes the code clearer.
636 (string_overrun_cookie): Now const. Use initializers that
637 don't formally overflow signed char, to avoid warnings.
638 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
639 can cause Emacs to crash when string overrun checking is enabled.
640 (allocate_buffer): Don't assume sizeof (struct buffer) is a
641 multiple of sizeof (EMACS_INT); it need not be, if
642 alignof(EMACS_INT) < sizeof (EMACS_INT).
643 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
644
645 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
646
647 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
648
649 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
650
651 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
652 supposed to be handshaking. (Bug#8556)
653 Reported by Paul Eggert <eggert@cs.ucla.edu>.
654
655 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
656
657 * lisp.h (Qdebug): List symbol.
658 * eval.c (Qdebug): Restore global linkage.
659 * keyboard.c (debug-on-event): New variable.
660 (handle_user_signal): Break into debugger when debug-on-event
661 matches the current signal symbol.
662
663 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
664
665 * alloc.c (check_sblock, check_string_bytes)
666 (check_string_free_list): Convert to standard C.
667
668 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
669
670 * w32.c (emacs_gnutls_push): Fix typo.
671
672 2011-04-25 Eli Zaretskii <eliz@gnu.org>
673
674 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
675 "cast to pointer from integer of different size".
676
677 Improve doprnt and its use in verror. (Bug#8545)
678 * doprnt.c (doprnt): Document the set of format control sequences
679 supported by the function. Use SAFE_ALLOCA instead of always
680 using `alloca'.
681
682 * eval.c (verror): Don't limit the buffer size at size_max-1, that
683 is one byte too soon. Don't use xrealloc; instead xfree and
684 xmalloc anew.
685
686 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
687
688 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
689 callbacks stage.
690
691 * gnutls.c: Renamed global_initialized to
692 gnutls_global_initialized. Added internals for the
693 :verify-hostname-error, :verify-error, and :verify-flags
694 parameters of `gnutls-boot' and documented those parameters in the
695 docstring. Start callback support.
696 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
697 unless a fatal error occured. Call gnutls_alert_send_appropriate
698 on error. Return error code.
699 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
700 (emacs_gnutls_read): Likewise.
701 (Fgnutls_boot): Return handshake error code.
702 (emacs_gnutls_handle_error): New function.
703 (wsaerror_to_errno): Likewise.
704
705 * w32.h (emacs_gnutls_pull): Add prototype.
706 (emacs_gnutls_push): Likewise.
707
708 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
709 (emacs_gnutls_push): Likewise.
710
711 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
712
713 * process.c (wait_reading_process_output): Check if GnuTLS
714 buffered some data internally if no FDs are set for TLS
715 connections.
716
717 * makefile.w32-in (OBJ2): Add gnutls.$(O).
718 (LIBS): Link to USER_LIBS.
719 ($(BLD)/gnutls.$(0)): New target.
720
721 2011-04-24 Eli Zaretskii <eliz@gnu.org>
722
723 * xdisp.c (handle_single_display_spec): Rename the
724 display_replaced_before_p argument into display_replaced_p, to
725 make it consistent with the commentary. Fix typos in the
726 commentary.
727
728 * textprop.c (syms_of_textprop): Remove dead code.
729 (copy_text_properties): Delete obsolete commentary about an
730 interface that was deleted long ago. Fix typos in the description
731 of arguments.
732
733 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
734 to changes in oldXMenu/XMenu.h from 2011-04-16.
735 <menu_help_message, prev_menu_help_message>: Constify.
736 (IT_menu_make_room): menu->help_text is now `const char **';
737 adjust.
738
739 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
740 to changes in oldXMenu/XMenu.h from 2011-04-16.
741 (struct XMenu): Declare `help_text' `const char **'.
742
743 * xfaces.c <Qunspecified>: Make extern again.
744
745 * syntax.c: Include sys/types.h before including regex.h, as
746 required by Posix.
747
748 * doc.c (get_doc_string): Improve the format passed to `error'.
749
750 * doprnt.c (doprnt): Improve commentary.
751
752 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
753
754 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
755 them with etags.
756
757 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
758 changes in globals.h immediately force recompilation.
759 (TAGS): Depend on $(CURDIR)/m/intel386.h and
760 $(CURDIR)/s/ms-w32.h.
761 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
762
763 * character.c (Fchar_direction): Function deleted.
764 (syms_of_character): Don't defsubr it.
765 <char-direction-table>: Deleted.
766
767 2011-04-23 Eli Zaretskii <eliz@gnu.org>
768
769 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
770 * doprnt.c: Include limits.h.
771 (SIZE_MAX): New macro.
772 (doprnt): Return a size_t value. 2nd arg is now size_t. Many
773 local variables are now size_t instead of int or unsigned.
774 Improve overflow protection. Support `l' modifier for integer
775 conversions. Support %l conversion. Don't assume an EMACS_INT
776 argument for integer conversions and for %c.
777
778 * lisp.h (doprnt): Restore prototype.
779
780 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
781 $(SRC)/character.h.
782
783 * Makefile.in (base_obj): Add back doprnt.o.
784
785 * deps.mk (doprnt.o): Add back prerequisites.
786 (callint.o): Depend on character.h.
787
788 * eval.c (internal_lisp_condition_case): Include the handler
789 representation in the error message.
790 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
791 when breaking from the loop.
792
793 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
794
795 * callint.c (Fcall_interactively): When displaying error message
796 about invalid control letter, pass the character's codepoint, not
797 a pointer to its multibyte form. Improve display of the character
798 in octal and display also its hex code.
799
800 * character.c (char_string): Use %x to display the (unsigned)
801 codepoint of an invalid character, to avoid displaying a bogus
802 negative value.
803
804 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
805 `error', not SYMBOL_NAME itself.
806
807 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
808 character arguments to `error'.
809
810 * charset.c (check_iso_charset_parameter): Fix incorrect argument
811 to `error' in error message about FINAL_CHAR argument. Make sure
812 FINAL_CHAR is a character, and use %c when it is passed as
813 argument to `error'.
814
815 2011-04-23 Eli Zaretskii <eliz@gnu.org>
816
817 * s/ms-w32.h (localtime): Redirect to sys_localtime.
818
819 * w32.c: Include <time.h>.
820 (sys_localtime): New function.
821
822 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
823
824 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
825
826 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
827
828 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
829
830 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
831 zombies (Bug#8467).
832
833 2011-04-19 Eli Zaretskii <eliz@gnu.org>
834
835 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
836 gl_state.e_property when gl_state.object is Qt.
837
838 * insdel.c (make_gap_larger): Remove limitation of buffer size
839 to <= INT_MAX.
840
841 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
842
843 * xdisp.c (lookup_glyphless_char_display)
844 (produce_glyphless_glyph): Handle cons cell entry in
845 glyphless-char-display.
846 (Vglyphless_char_display): Document it.
847
848 * term.c (produce_glyphless_glyph): Handle cons cell entry in
849 glyphless-char-display.
850
851 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
852
853 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
854
855 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
856
857 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
858 definition for no-X builds.
859
860 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
861
862 Static checks with GCC 4.6.0 and non-default toolkits.
863
864 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
865
866 * process.c (keyboard_bit_set): Define only if SIGIO.
867 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
868 (send_process): Repair possible setjmp clobbering.
869
870 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
871
872 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
873
874 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
875
876 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
877 Define only if needed.
878
879 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
880 by pacifying GCC about it. Maybe it's time to retire it?
881 * xfaces.c (USG, __TIMEVAL__): Likewise.
882
883 * dispextern.h (struct redisplay_interface): Rename param
884 to avoid shadowing.
885 * termhooks.h (struct terminal): Likewise.
886 * xterm.c (xembed_send_message): Likewise.
887
888 * insdel.c (make_gap_smaller): Define only if
889 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
890
891 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
892 it.
893
894 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
895 so that we aren't warned about unused symbols.
896
897 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
898
899 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
900
901 * xfns.c (x_real_positions): Mark locals as initialized.
902
903 * xmenu.c (xmenu_show): Don't use uninitialized vars.
904
905 * xterm.c: Fix problems found by static analysis with other toolkits.
906 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
907 (x_dispatch_event): Declare static if USE_GTK, and
908 define if USE_GTK || USE_X_TOOLKIT.
909 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
910 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
911 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
912 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
913
914 * xmenu.c (menu_help_callback): Pointer type fixes.
915 Use const pointers when pointing at readonly data. Avoid pointer
916 signedness clashes.
917 (FALSE): Remove unused macro.
918 (update_frame_menubar): Remove unused decl.
919
920 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
921
922 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
923 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
924 (single_menu_item): Rename local to avoid shadowing.
925
926 * keyboard.c (make_lispy_event): Remove unused local var.
927
928 * frame.c, frame.h (x_get_resource_string): Bring this back, but
929 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
930
931 * bitmaps: Change bitmaps from unsigned char back to the X11
932 compatible char. Avoid the old compiler warnings about
933 out-of-range initializers by using, for example, '\xab' rather
934 than 0xab.
935
936 * xgselect.c (xgselect_initialize): Check vs interface
937 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
938
939 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
940
941 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
942 to read-only memory.
943
944 * fns.c (vector): Remove; this old hack is no longer needed.
945
946 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
947 Remove unused var.
948 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
949
950 * xrdb.c (x_load_resources): Omit unused local.
951
952 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
953 (x_window): Rename locals to avoid shadowing.
954 (USG): Use the kludged USG macro, to pacify gcc.
955
956 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
957 (x_term_init): Remove local to avoid shadowing.
958
959 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
960
961 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
962 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
963
964 2011-04-16 Eli Zaretskii <eliz@gnu.org>
965
966 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
967
968 Fix regex.c, syntax.c and friends for buffers > 2GB.
969 * syntax.h (struct gl_state_s): Declare character position members
970 EMACS_INT.
971
972 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
973
974 * textprop.c (verify_interval_modification, interval_of): Declare
975 arguments EMACS_INT.
976
977 * intervals.c (adjust_intervals_for_insertion): Declare arguments
978 EMACS_INT.
979
980 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
981
982 * indent.c (Fvertical_motion): Local variable it_start is now
983 EMACS_INT.
984
985 * regex.c (re_match, re_match_2, re_match_2_internal)
986 (bcmp_translate, regcomp, regexec, print_double_string)
987 (group_in_compile_stack, re_search, re_search_2, regex_compile)
988 (re_compile_pattern, re_exec): Declare arguments and local
989 variables `size_t' and `ssize_t' and return values `regoff_t', as
990 appropriate.
991 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
992 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
993 <compile_stack_type>: `size' and `avail' are now `size_t'.
994
995 * regex.h <regoff_t>: Use ssize_t, not int.
996 (re_search, re_search_2, re_match, re_match_2): Arguments that
997 specify buffer/string position and length are now ssize_t and
998 size_t. Return type is regoff_t.
999
1000 2011-04-16 Ben Key <bkey76@gmail.com>
1001
1002 * nsfont.m: Fixed bugs in ns_get_family and
1003 ns_descriptor_to_entity that were caused by using free to
1004 deallocate memory blocks that were allocated by xmalloc (via
1005 xstrdup). This caused Emacs to crash when compiled with
1006 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
1007 --enable-checking=xmallocoverrun). xfree is now used to
1008 deallocate these memory blocks.
1009
1010 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
1011
1012 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
1013
1014 emacs_write: Accept and return EMACS_INT for sizes.
1015 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
1016 et seq.
1017 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
1018 Accept and return EMACS_INT.
1019 (emacs_gnutls_write): Return the number of bytes written on
1020 partial writes.
1021 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
1022 (emacs_read, emacs_write): Remove check for negative size, as the
1023 Emacs source code has been audited now.
1024 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
1025 (emacs_read, emacs_write): Use it.
1026 * process.c (send_process): Adjust to the new signatures of
1027 emacs_write and emacs_gnutls_write. Do not attempt to store
1028 a byte offset into an 'int'; it might overflow.
1029 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
1030
1031 * sound.c: Don't assume sizes fit in 'int'.
1032 (struct sound_device.period_size, alsa_period_size):
1033 Return EMACS_INT, not int.
1034 (struct sound_device.write, vox_write, alsa_write):
1035 Accept EMACS_INT, not int.
1036 (wav_play, au_play): Use EMACS_INT to store sizes and to
1037 record read return values.
1038
1039 2011-04-15 Ben Key <bkey76@gmail.com>
1040
1041 * keyboard.c (Qundefined): Don't declare static since it is used
1042 in nsfns.m.
1043 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
1044 static since they are used in nsfont.m.
1045
1046 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
1047
1048 * process.c (Qprocessp): Don't declare static.
1049 * lisp.h (Qprocessp): Declare again.
1050
1051 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
1052
1053 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
1054
1055 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
1056
1057 Improve C-level modularity by making more things 'static'.
1058
1059 Don't publish debugger-only interfaces to other modules.
1060 * lisp.h (safe_debug_print, debug_output_compilation_hack):
1061 (verify_bytepos, count_markers): Move decls to the only modules
1062 that need them.
1063 * region-cache.h (pp_cache): Likewise.
1064 * window.h (check_all_windows): Likewise.
1065 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
1066
1067 * sysdep.c (croak): Now static, if
1068 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
1069 * syssignal.h (croak): Declare only if not static.
1070
1071 * alloc.c (refill_memory_reserve): Now static if
1072 !defined REL_ALLOC || defined SYSTEM_MALLOC.
1073 * lisp.h (refill_memory_reserve): Declare only if not static.
1074
1075 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
1076 Define only if USE_LUCID.
1077
1078 * xrdb.c (x_customization_string, x_rm_string): Now static.
1079
1080 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
1081 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
1082
1083 * xdisp.c (draw_row_with_mouse_face): Now static.
1084 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
1085
1086 * window.h (check_all_windows): Mark externally visible.
1087
1088 * window.c (window_deletion_count): Now static.
1089
1090 * undo.c: Make symbols static if they're not exported.
1091 (last_undo_buffer, last_boundary_position, pending_boundary):
1092 Now static.
1093
1094 * textprop.c (interval_insert_behind_hooks): Now static.
1095 (interval_insert_in_front_hooks): Likewise.
1096
1097 * term.c: Make symbols static if they're not exported.
1098 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
1099 (max_frame_lines, tty_set_terminal_modes):
1100 (tty_reset_terminal_modes, tty_turn_off_highlight):
1101 (get_tty_terminal): Now static.
1102 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
1103 * termhooks.h (term_mouse_moveto): Do not declare if
1104 HAVE_WINDOW_SYSTEM.
1105 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
1106 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
1107
1108 * sysdep.c: Make symbols static if they're not exported.
1109 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
1110 Now static.
1111 (sigprocmask_set, full_mask): Remove; unused.
1112 (wait_debugging): Mark as visible.
1113 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
1114 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
1115
1116 * syntax.c (syntax_temp): Define only if !__GNUC__.
1117
1118 * sound.c (current_sound_device, current_sound): Now static.
1119
1120 * search.c (searchbufs, searchbuf_head): Now static.
1121
1122 * scroll.c (scroll_cost): Remove; unused.
1123 * dispextern.h (scroll_cost): Remove decl.
1124
1125 * region-cache.h (pp_cache): Mark as externally visible.
1126
1127 * process.c: Make symbols static if they're not exported.
1128 (process_tick, update_tick, create_process, chan_process):
1129 (Vprocess_alist, proc_buffered_char, datagram_access):
1130 (fd_callback_data, send_process_frame, process_sent_to): Now static.
1131 (deactivate_process): Mark defn as static, as well as decl.
1132 * lisp.h (create_process): Remove decl.
1133 * process.h (chan_process, Vprocess_alist): Remove decls.
1134
1135 * print.c: Make symbols static if they're not exported.
1136 (print_depth, new_backquote_output, being_printed, print_buffer):
1137 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
1138 (print_interval, print_number_index, initial_stderr_stream):
1139 Now static.
1140 * lisp.h (Fprinc): Remove decl.
1141 (debug_output_compilation_hack): Mark as externally visible.
1142
1143 * sysdep.c (croak): Move decl from here to syssignal.h.
1144 * syssignal.h (croak): Put it here, so the API can be checked when
1145 'croak' is called from dissociate_if_controlling_tty.
1146
1147 * minibuf.c: Make symbols static if they're not exported.
1148 (minibuf_save_list, choose_minibuf_frame): Now static.
1149 * lisp.h (choose_minibuf_frame): Remove decl.
1150
1151 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
1152
1153 * lread.c: Make symbols static if they're not exported.
1154 (read_objects, initial_obarray, oblookup_last_bucket_number):
1155 Now static.
1156 (make_symbol): Remove; unused.
1157 * lisp.h (initial_obarray, make_symbol): Remove decls.
1158
1159 * keyboard.c: Make symbols static if they're not exported.
1160 (single_kboard, recent_keys_index, total_keys, recent_keys):
1161 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
1162 (this_single_command_key_start, echoing, last_auto_save):
1163 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
1164 (command_loop, echo_now, keyboard_init_hook, help_char_p):
1165 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
1166 (Vlispy_mouse_stem, double_click_count):
1167 Now static.
1168 (force_auto_save_soon): Define only if SIGDANGER.
1169 (ignore_mouse_drag_p): Now static if
1170 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
1171 (print_help): Remove; unused.
1172 (stop_character, last_timer_event): Mark as externally visible.
1173 * keyboard.h (ignore_mouse_drag_p): Declare only if
1174 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
1175 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
1176 * lisp.h (echoing): Remove decl.
1177 (force_auto_save_soon): Declare only if SIGDANGER.
1178 * xdisp.c (redisplay_window): Simplify code, to make it more
1179 obvious that ignore_mouse_drag_p is not accessed if !defined
1180 USE_GTK && !defined HAVE_NS.
1181
1182 * intervals.c: Make symbols static if they're not exported.
1183 (merge_properties_sticky, merge_interval_right, delete_interval):
1184 Now static.
1185 * intervals.h (merge_interval_right, delete_interval): Remove decls.
1186
1187 * insdel.c: Make symbols static if they're not exported.
1188 However, leave prepare_to_modify_buffer alone. It's never
1189 called from outside this function, but that appears to be a bug.
1190 (combine_after_change_list, combine_after_change_buffer):
1191 (adjust_after_replace, signal_before_change): Now static.
1192 (adjust_after_replace_noundo): Remove; unused.
1193 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
1194 (signal_before_change): Remove decls.
1195
1196 * indent.c (val_compute_motion, val_vmotion): Now static.
1197
1198 * image.c: Make symbols static if they're not exported.
1199 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
1200 if USE_GTK.
1201 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
1202 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
1203
1204 * fringe.c (standard_bitmaps): Now static.
1205 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
1206
1207 * frame.c: Make symbols static if they're not exported.
1208 (x_report_frame_params, make_terminal_frame): Now static.
1209 (get_frame_param): Now static, unless HAVE_NS.
1210 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
1211 (x_get_resource_string): Remove; not used.
1212 * frame.h (make_terminal_frame, x_report_frame_params):
1213 (x_get_resource_string); Remove decls.
1214 (x_fullscreen_adjust): Declare only if WINDOWSNT.
1215 * lisp.h (get_frame_param): Declare only if HAVE_NS.
1216
1217 * font.c, fontset.c: Make symbols static if they're not exported.
1218 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
1219 (FACE_SUITABLE_FOR_CHAR_P): Use it.
1220 * font.c (font_close_object): Now static.
1221 * font.h (font_close_object): Remove.
1222 * fontset.c (FONTSET_OBJLIST): Remove.
1223 (free_realized_fontset) #if-0 the body, which does nothing.
1224 (face_suitable_for_char_p): #if-0, as it's never called.
1225 * fontset.h (face_suitable_for_char_p): Remove decl.
1226 * xfaces.c (face_at_string_position): Use
1227 FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
1228 since 0 is always ASCII.
1229
1230 * fns.c (weak_hash_tables): Now static.
1231
1232 * fileio.c: Make symbols static if they're not exported.
1233 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
1234 (Vwrite_region_annotation_buffers): Now static.
1235
1236 * eval.c: Make symbols static if they're not exported.
1237 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
1238 * lisp.h (backtrace_list): Remove decl.
1239
1240 * emacs.c: Make symbols static if they're not exported.
1241 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
1242 (fatal_error_code, fatal_error_signal_hook, standard_args):
1243 Now static.
1244 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
1245 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
1246 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
1247 * lisp.h (fatal_error_signal_hook): Remove decl.
1248 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
1249
1250 * editfns.c: Move a (normally-unused) function to its only use.
1251 * editfns.c, lisp.h (get_operating_system_release): Remove.
1252 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
1253 worth the hassle of breaking this out.
1254
1255 * xterm.c: Make symbols static if they're not exported.
1256 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
1257 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
1258 (x_destroy_window, x_delete_display):
1259 Now static.
1260 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
1261 (x_mouse_leave): Remove; unused.
1262 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
1263 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
1264 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
1265 Remove decls.
1266 (x_mouse_leave): Declare only if WINDOWSNT.
1267 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
1268 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
1269 USE_X_TOOLKIT.
1270
1271 * ftxfont.c: Make symbols static if they're not exported.
1272 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
1273 HAVE_FREETYPE.
1274 * font.h (ftxfont_driver): Likewise.
1275
1276 * xfns.c: Make symbols static if they're not exported.
1277 (x_last_font_name, x_display_info_for_name):
1278 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
1279 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
1280 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
1281 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
1282 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
1283 (last_show_tip_args): Now static.
1284 (xic_defaut_fontset, xic_create_fontsetname): Define only if
1285 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
1286 (x_screen_planes): Remove; unused.
1287 * dispextern.h (x_screen_planes): Remove decl.
1288
1289 * dispnew.c: Make symbols static if they're not exported.
1290 * dispextern.h (redraw_garbaged_frames, scrolling):
1291 (increment_row_positions): Remove.
1292 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
1293 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
1294 Now static.
1295 (redraw_garbaged_frames): Remove; unused.
1296
1297 * xfaces.c: Make symbols static if they're not exported.
1298 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
1299 Remove decls.
1300 * xterm.h (defined_color): Remove decls.
1301 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
1302 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
1303 (menu_face_changed_default, defined_color, free_realized_face):
1304 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
1305 (ascii_face_of_lisp_face): Remove; unused.
1306
1307 * xdisp.c: Make symbols static if they're not exported.
1308 * dispextern.h (scratch_glyph_row, window_box_edges):
1309 (glyph_to_pixel_coords, set_cursor_from_row):
1310 (get_next_display_element, set_iterator_to_next):
1311 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
1312 (show_mouse_face): Remove decls
1313 * frame.h (message_buf_print): Likewise.
1314 * lisp.h (pop_message, set_message, check_point_in_composition):
1315 Likewise.
1316 * xterm.h (set_vertical_scroll_bar): Likewise.
1317 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
1318 (message_buf_print, scratch_glyph_row, displayed_buffer):
1319 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
1320 (get_next_display_element, show_mouse_face, window_box_edges):
1321 (frame_to_window_pixel_xy, check_point_in_composition):
1322 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
1323 (glyph_to_pixel_coords): Remove; unused.
1324
1325 * dired.c (file_name_completion): Now static.
1326
1327 * dbusbind.c (xd_in_read_queued_messages): Now static.
1328
1329 * lisp.h (circular_list_error, FOREACH): Remove; unused.
1330 * data.c (circular_list_error): Remove.
1331
1332 * commands.h (last_point_position, last_point_position_buffer):
1333 (last_point_position_window): Remove decls.
1334 * keyboard.c: Make these variables static.
1335
1336 * coding.h (coding, code_convert_region, encode_coding_gap): Remove
1337 decls.
1338 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
1339 (iso_code_class, detect_coding, code_convert_region): Now static.
1340 (encode_coding_gap): Remove; unused.
1341
1342 * chartab.c (chartab_chars, chartab_bits): Now static.
1343
1344 * charset.h (charset_iso_8859_1): Remove decl.
1345 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
1346 Now static.
1347
1348 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
1349 * ccl.c (Vccl_program_table): Now static.
1350 (check_ccl_update): Remove; unused.
1351
1352 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
1353 * category.h: ... from here.
1354 * category.c (check_category_table, set_category_set): Now static.
1355
1356 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
1357 * lisp.h: Remove these decls.
1358
1359 * buffer.c (buffer_count): Remove unused var.
1360
1361 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
1362 so that it's not optimized away.
1363 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
1364 * dispextern.h (bidi_dump_cached_states): Remove, since it's
1365 exported only to the debugger.
1366
1367 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
1368 * atimer.h (run_all_atimers): Removed; not exported.
1369
1370 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
1371 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
1372 was inaccessible from Lisp.
1373 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
1374 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
1375
1376 alloc.c: Import and export fewer symbols, and remove unused items.
1377 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
1378 is defined.
1379 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
1380 it's not optimized away by whole-program optimization.
1381 (message_enable_multibyte, free_misc): Remove.
1382 (catchlist, handlerlist, mark_backtrace):
1383 Declare only if BYTE_MARK_STACK.
1384 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
1385 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
1386 (message_enable_multibyte): Remove decl.
1387 (free_misc, interval_free_list, float_block, float_block_index):
1388 (n_float_blocks, float_free_list, cons_block, cons_block_index):
1389 (cons_free_list, last_marked_index):
1390 Now static.
1391 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
1392 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
1393 (mark_backtrace): Define only if BYTE_MARK_STACK.
1394 * xdisp.c (message_enable_multibyte): Now static.
1395
1396 Declare Lisp_Object Q* variables to be 'static' if not exported.
1397 This makes it easier for human readers (and static analyzers)
1398 to see whether these variables are used from other modules.
1399 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
1400 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
1401 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
1402 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
1403 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
1404 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
1405 * xmenu.c, xselect.c:
1406 Declare Q* vars static if they are not used in other modules.
1407 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
1408 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
1409 Remove decls of unexported vars.
1410 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
1411
1412 * lisp.h (DEFINE_FUNC): Make sname 'static'.
1413
1414 Make Emacs functions such as Fatom 'static' by default.
1415 This makes it easier for human readers (and static analyzers)
1416 to see whether these functions can be called from other modules.
1417 DEFUN now defines a static function. To make the function external
1418 so that it can be used in other C modules, use the new macro DEFUE.
1419 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
1420 (Finit_image_library):
1421 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
1422 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
1423 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
1424 Remove decls, since these functions are now static.
1425 (Funintern, Fget_internal_run_time): New decls, since these functions
1426 were already external.
1427
1428 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
1429 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
1430 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
1431 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
1432 * keyboard.c, keymap.c, lread.c:
1433 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
1434 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
1435 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
1436 Mark functions with DEFUE instead of DEFUN,
1437 if they are used in other modules.
1438 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
1439 decls for now-static functions.
1440 * buffer.h (Fdelete_overlay): Remove decl.
1441 * callproc.c (Fgetenv_internal): Mark as internal.
1442 * composite.c (Fremove_list_of_text_properties): Remove decl.
1443 (Fcomposition_get_gstring): New forward static decl.
1444 * composite.h (Fcomposite_get_gstring): Remove decl.
1445 * dired.c (Ffile_attributes): New forward static decl.
1446 * doc.c (Fdocumntation_property): New forward static decl.
1447 * eval.c (Ffetch_bytecode): New forward static decl.
1448 (Funintern): Remove extern decl; now in .h file where it belongs.
1449 * fileio.c (Fmake_symbolic_link): New forward static decl.
1450 * image.c (Finit_image_library): New forward static decl.
1451 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
1452 * intervals.h (Fprevious_property_change):
1453 (Fremove_list_of_text_properties): Remove decls.
1454 * keyboard.c (Fthis_command_keys): Remove decl.
1455 (Fcommand_execute): New forward static decl.
1456 * keymap.c (Flookup_key): New forward static decl.
1457 (Fcopy_keymap): Now static.
1458 * keymap.h (Flookup_key): Remove decl.
1459 * process.c (Fget_process): New forward static decl.
1460 (Fprocess_datagram_address): Mark as internal.
1461 * syntax.c (Fsyntax_table_p): New forward static decl.
1462 (skip_chars): Remove duplicate decl.
1463 * textprop.c (Fprevious_property_change): New forward static decl.
1464 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
1465 Now internal.
1466 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
1467 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
1468
1469 * editfns.c (Fformat): Remove unreachable code.
1470
1471 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
1472
1473 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
1474 change. (Bug#8496)
1475
1476 2011-04-13 Eli Zaretskii <eliz@gnu.org>
1477
1478 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
1479 when at ZV. (Bug#8487)
1480
1481 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
1482
1483 * charset.c (Fclear_charset_maps): Use xfree instead of free.
1484 (Bug#8437)
1485 * keyboard.c (parse_tool_bar_item): Likewise.
1486 * sound.c (sound_cleanup, alsa_close): Likewise.
1487 * termcap.c (tgetent): Likewise.
1488 * xfns.c (x_default_font_parameter): Likewise.
1489 * xsettings.c (read_and_apply_settings): Likewise.
1490
1491 * alloc.c (overrun_check_malloc, overrun_check_realloc)
1492 (overrun_check_free): Protoize.
1493
1494 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
1495
1496 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
1497 since callers should never pass a negative size.
1498 Change the signature to match that of plain 'read' and 'write'; see
1499 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
1500 * lisp.h: Update prototypes of emacs_write and emacs_read.
1501
1502 2011-04-11 Eli Zaretskii <eliz@gnu.org>
1503
1504 * xdisp.c (redisplay_window): Don't try to determine the character
1505 position of the scroll margin if the window start point w->startp
1506 is outside the buffer's accessible region. (Bug#8468)
1507
1508 2011-04-10 Eli Zaretskii <eliz@gnu.org>
1509
1510 Fix write-region and its subroutines for buffers > 2GB.
1511 * fileio.c (a_write, e_write): Modify declaration of arguments and
1512 local variables to support buffers larger than 2GB.
1513 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
1514
1515 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
1516 argument, local variables, and return value.
1517
1518 * lisp.h: Update prototypes of emacs_write and emacs_read.
1519
1520 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
1521
1522 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
1523
1524 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
1525
1526 Fix more problems found by GCC 4.6.0's static checks.
1527
1528 * xdisp.c (vmessage): Use a better test for character truncation.
1529
1530 * charset.c (load_charset_map): <, not <=, for optimization,
1531 and to avoid potential problems with integer overflow.
1532 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
1533 * casetab.c (set_identity, shuffle): Likewise.
1534 * editfns.c (Fformat): Likewise.
1535 * syntax.c (skip_chars): Likewise.
1536
1537 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
1538 This also lets GCC 4.6.0 generate slightly better loop code.
1539
1540 * callint.c (Fcall_interactively): <, not <=, for optimization.
1541 (Fcall_interactively): Count the number of arguments produced,
1542 not the number of arguments given. This is simpler and lets GCC
1543 4.6.0 generate slightly better code.
1544
1545 * ftfont.c: Distingish more carefully between FcChar8 and char.
1546 The previous code passed unsigned char * to a functions like
1547 strlen and xstrcasecmp that expect char *, which does not
1548 conform to the C standard.
1549 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
1550 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
1551 char * when the C standard requires it.
1552
1553 * keyboard.c (read_char): Remove unused var.
1554
1555 * eval.c: Port to Windows vsnprintf (Bug#8435).
1556 Include <limits.h>.
1557 (SIZE_MAX): Define if the headers do not.
1558 (verror): Do not give up if vsnprintf returns a negative count.
1559 Instead, grow the buffer. This ports to Windows vsnprintf, which
1560 does not conform to C99. Problem reported by Eli Zaretskii.
1561 Also, simplify the allocation scheme, by avoiding the need for
1562 calling realloc, and removing the ALLOCATED variable.
1563
1564 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
1565
1566 Remove invocations of doprnt, as Emacs now uses vsnprintf.
1567 But keep the doprint source code for now, as we might revamp it
1568 and use it again (Bug#8435).
1569 * lisp.h (doprnt): Remove.
1570 * Makefile.in (base_obj): Remove doprnt.o.
1571 * deps.mk (doprnt.o): Remove.
1572
1573 error: Print 32- and 64-bit integers portably (Bug#8435).
1574 Without this change, on typical 64-bit hosts error ("...%d...", N)
1575 was used to print both 32- and 64-bit integers N, which relied on
1576 undefined behavior.
1577 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
1578 New macro.
1579 * lisp.h (error, verror): Mark as printf-like functions.
1580 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
1581 Report overflow in size calculations when allocating printf buffer.
1582 Do not truncate output string at its first null byte.
1583 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
1584 Truncate the output at a character boundary, since vsnprintf does not
1585 do that.
1586 * charset.c (check_iso_charset_parameter): Convert internal
1587 character to string before calling 'error', since %c now has the
1588 printf meaning.
1589 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
1590 overflow when computing char to be passed to 'error'. Do not
1591 pass Lisp_Object to 'error'; pass the integer instead.
1592 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
1593 formatted with plain %d.
1594
1595 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
1596
1597 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
1598
1599 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
1600
1601 * xterm.c (x_catch_errors): Remove duplicate declaration.
1602
1603 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
1604
1605 * xdisp.c, lisp.h (message_nolog): Remove; unused.
1606
1607 2011-04-10 Jim Meyering <meyering@redhat.com>
1608
1609 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
1610 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
1611 return ssize_t not "int", and use size_t as the buffer length.
1612 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
1613 * gnutls.h: Update declarations.
1614 * process.c (read_process_output): Use ssize_t, to match.
1615 (send_process): Likewise.
1616
1617 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
1618
1619 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
1620
1621 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
1622
1623 * ftfont.c (get_adstyle_property, ftfont_pattern_entity): Use
1624 unsigned char, to match FcChar8 type definition.
1625
1626 * xterm.c (handle_one_xevent):
1627 * xmenu.c (create_and_show_popup_menu):
1628 * xselect.c (x_decline_selection_request)
1629 (x_reply_selection_request): Avoid type-punned deref of X events.
1630
1631 2011-04-09 Eli Zaretskii <eliz@gnu.org>
1632
1633 Fix some uses of `int' instead of EMACS_INT.
1634 * search.c (string_match_1, fast_string_match)
1635 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
1636 (scan_buffer, find_next_newline_no_quit)
1637 (find_before_next_newline, search_command, Freplace_match)
1638 (Fmatch_data): Make some `int' variables be EMACS_INT.
1639
1640 * xdisp.c (display_count_lines): 3rd argument and return value now
1641 EMACS_INT. All callers changed.
1642 (pint2hrstr): Last argument is now EMACS_INT.
1643
1644 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
1645 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
1646 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
1647 (decode_coding_utf_16, decode_coding_emacs_mule)
1648 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
1649 (decode_coding_ccl, decode_coding_charset)
1650 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
1651 (decode_coding_iso_2022, decode_coding_emacs_mule)
1652 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
1653 <char_offset, last_offset>: Declare EMACS_INT.
1654 (encode_coding_utf_8, encode_coding_utf_16)
1655 (encode_coding_emacs_mule, encode_invocation_designation)
1656 (encode_designation_at_bol, encode_coding_iso_2022)
1657 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
1658 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
1659 Declare EMACS_INT.
1660 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
1661 (encode_invocation_designation): Last argument P_NCHARS is now
1662 EMACS_INT.
1663 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
1664 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
1665
1666 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
1667 All users changed.
1668
1669 * ccl.c (Fccl_execute_on_string): Declare some variables
1670 EMACS_INT.
1671
1672 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
1673
1674 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
1675
1676 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
1677
1678 * process.c (Fformat_network_address): Doc fix.
1679
1680 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
1681
1682 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
1683
1684 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
1685
1686 * keyboard.c (read_char): Call Lisp function help-form-show,
1687 instead of using internal_with_output_to_temp_buffer.
1688 (Qhelp_form_show): New var.
1689 (syms_of_keyboard): Use DEFSYM macro.
1690
1691 * print.c (internal_with_output_to_temp_buffer): Function deleted.
1692
1693 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
1694
1695 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
1696
1697 * process.c (Flist_processes): Removed to Lisp.
1698 (list_processes_1): Deleted.
1699
1700 2011-04-06 Eli Zaretskii <eliz@gnu.org>
1701
1702 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
1703
1704 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
1705
1706 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
1707
1708 Fix more problems found by GCC 4.6.0's static checks.
1709
1710 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
1711
1712 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
1713
1714 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1715
1716 * xdisp.c (vmessage): Mark as a printf-like function.
1717
1718 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
1719
1720 * sound.c (sound_warning): Don't crash if arg contains a printf format.
1721
1722 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
1723 printf-like functions.
1724 (tiff_load): Add casts to remove these marks before passing them
1725 to system-supplied API.
1726
1727 * eval.c (Fsignal): Remove excess argument to 'fatal'.
1728
1729 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
1730 This avoids several warnings with gcc -Wstrict-overflow.
1731 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
1732 directly, rather than having caller test rule sign. This avoids
1733 some unnecessary tests.
1734 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
1735 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
1736 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
1737
1738 * xfont.c (xfont_text_extents): Remove var that was set but not used.
1739 (xfont_open): Avoid unnecessary tests.
1740
1741 * composite.c (composition_gstring_put_cache): Use unsigned integer.
1742
1743 * composite.h, composite.c (composition_gstring_put_cache):
1744 Use EMACS_INT, not int, for length.
1745
1746 * composite.h (COMPOSITION_DECODE_REFS): New macro,
1747 breaking out part of COMPOSITION_DECODE_RULE.
1748 (COMPOSITION_DECODE_RULE): Use it.
1749 * composite.c (get_composition_id): Remove unused local vars,
1750 by using the new macro.
1751
1752 * textprop.c (set_text_properties_1): Change while to do-while,
1753 since the condition is always true at first.
1754
1755 * intervals.c (graft_intervals_into_buffer): Mark var as used.
1756 (interval_deletion_adjustment): Return unsigned value.
1757 All uses changed.
1758
1759 * process.c (list_processes_1, create_pty, read_process_output):
1760 (exec_sentinel): Remove vars that were set but not used.
1761 (create_pty): Remove unnecessary "volatile"s.
1762 (Fnetwork_interface_info): Avoid possibility of int overflow.
1763 (read_process_output): Do adaptive read buffering even if carryover.
1764 (read_process_output): Simplify nbytes computation if buffered.
1765
1766 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
1767
1768 * syntax.c (scan_words): Remove var that was set but not used.
1769 (update_syntax_table): Use unsigned instead of int.
1770
1771 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
1772 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
1773 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
1774
1775 * print.c (print_error_message): Avoid int overflow.
1776
1777 * font.c (font_list_entities): Redo for clarity,
1778 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
1779
1780 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
1781 (font_score): Avoid potential overflow in diff calculation.
1782
1783 * fns.c (substring_both): Remove var that is set but not used.
1784 (sxhash): Redo loop for clarity and to avoid wraparound warning.
1785
1786 * eval.c (funcall_lambda): Rename local to avoid shadowing.
1787
1788 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
1789 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
1790 can always succeed if overflow has undefined behavior.
1791
1792 * search.c (boyer_moore, wordify): Remove vars set but not used.
1793 (wordify): Omit three unnecessary tests.
1794
1795 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
1796 All callers changed. This avoids the need for an unused var.
1797
1798 * casefiddle.c (casify_region): Remove var that is set but not used.
1799
1800 * dired.c (file_name_completion): Remove var that is set but not used.
1801
1802 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
1803
1804 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
1805 (Finsert_file_contents): Remove unnecessary code checking fd.
1806
1807 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
1808 Check for integer overflow on size calculations.
1809
1810 * buffer.c (Fprevious_overlay_change): Remove var that is set
1811 but not used.
1812
1813 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
1814 Remove vars that are set but not used.
1815 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
1816 (timer_check_2): Mark vars as initialized.
1817
1818 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
1819
1820 * image.c (lookup_image): Remove var that is set but not used.
1821 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
1822
1823 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
1824 that are set but not used.
1825
1826 * xfns.c (make_invisible_cursor): Don't return garbage
1827 if XCreateBitmapFromData fails (Bug#8410).
1828
1829 * xselect.c (x_get_local_selection, x_handle_property_notify):
1830 Remove vars that are set but not used.
1831
1832 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
1833 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
1834
1835 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
1836 Remove var that is set but not used.
1837 (scroll_bar_windows_size): Now size_t, not int.
1838 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
1839 Check for overflow.
1840
1841 * xfaces.c (realize_named_face): Remove vars that are set but not used.
1842 (map_tty_color) [!defined MSDOS]: Likewise.
1843
1844 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
1845
1846 * coding.c: Remove vars that are set but not used.
1847 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
1848 All callers changed.
1849 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
1850 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
1851 (decode_coding_charset): Remove vars that are set but not used.
1852
1853 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
1854 that is set but not used.
1855
1856 * print.c (print_object): Remove var that is set but not used.
1857
1858 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
1859 The gnulib version avoids calling malloc in the usual case,
1860 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
1861 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
1862 * filelock.c (current_lock_owner): Likewise.
1863 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
1864 * sysdep.c: Include allocator.h, careadlinkat.h.
1865 (emacs_no_realloc_allocator): New static constant.
1866 (emacs_readlink): New function.
1867 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
1868 ../lib/careadlinkat.h.
1869
1870 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
1871
1872 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
1873 first non-nil return value).
1874
1875 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
1876
1877 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
1878 if not defined (Bug#8403).
1879
1880 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
1881
1882 * xdisp.c (display_count_lines): Remove parameter `start',
1883 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
1884 (get_char_face_and_encoding): Remove parameter `multibyte_p',
1885 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
1886 (fill_stretch_glyph_string): Remove parameters `row' and `area',
1887 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
1888 and thereabouts. All callers changed.
1889 (get_per_char_metric): Remove parameter `f', unused since
1890 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
1891
1892 2011-04-02 Jim Meyering <meyering@redhat.com>
1893
1894 do not dereference NULL upon failed strdup
1895 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
1896 (ns_get_family): Likewise.
1897
1898 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
1899
1900 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
1901
1902 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
1903
1904 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
1905 later (Bug#8403).
1906
1907 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
1908
1909 Add lexical binding.
1910
1911 * window.c (Ftemp_output_buffer_show): New fun.
1912 (Fsave_window_excursion):
1913 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
1914
1915 * lread.c (lisp_file_lexically_bound_p): New function.
1916 (Fload): Bind Qlexical_binding.
1917 (readevalloop): Remove `evalfun' arg.
1918 Bind Qinternal_interpreter_environment.
1919 (Feval_buffer): Bind Qlexical_binding.
1920 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
1921 Mark as dynamic.
1922 (syms_of_lread): Declare `lexical-binding'.
1923
1924 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
1925
1926 * keyboard.c (eval_dyn): New fun.
1927 (menu_item_eval_property): Use it.
1928
1929 * image.c (parse_image_spec): Use Ffunctionp.
1930
1931 * fns.c (concat, mapcar1): Accept byte-code-functions.
1932
1933 * eval.c (Fsetq): Handle lexical vars.
1934 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
1935 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
1936 (FletX, Flet): Obey lexical binding.
1937 (Fcommandp): Handle closures.
1938 (Feval): New `lexical' arg.
1939 (eval_sub): New function extracted from Feval. Use it almost
1940 everywhere where Feval was used. Look up vars in lexical env.
1941 Handle closures.
1942 (Ffunctionp): Move from subr.el.
1943 (Ffuncall): Handle closures.
1944 (apply_lambda): Remove `eval_flags'.
1945 (funcall_lambda): Handle closures and new byte-code-functions.
1946 (Fspecial_variable_p): New function.
1947 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
1948 but without exporting it to Lisp.
1949
1950 * doc.c (Fdocumentation, store_function_docstring):
1951 * data.c (Finteractive_form): Handle closures.
1952
1953 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
1954 interactive spec.
1955
1956 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN): New
1957 byte-codes.
1958 (exec_byte_code): New function extracted from Fbyte_code to handle new
1959 calling convention for byte-code-functions. Add new byte-codes.
1960
1961 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
1962
1963 * alloc.c (Fmake_symbol): Init new `declared_special' field.
1964
1965 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
1966
1967 * xdisp.c (redisplay_internal): Fix prototype.
1968
1969 2011-03-31 Eli Zaretskii <eliz@gnu.org>
1970
1971 * xdisp.c (SCROLL_LIMIT): New macro.
1972 (try_scrolling): Use it when setting scroll_limit. Limit
1973 scrolling to 100 screen lines.
1974 (redisplay_window): Even when falling back on "recentering",
1975 position point in the window according to scroll-conservatively,
1976 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
1977
1978 (try_scrolling): When point is above the window, allow searching
1979 as far as scroll_max, or one screenful, to compute vertical
1980 distance from PT to the scroll margin position. This prevents
1981 try_scrolling from unnecessarily failing when
1982 scroll-conservatively is set to a value slightly larger than the
1983 window height. Clean up the case of PT below the margin at bottom
1984 of window: scroll_max can no longer be INT_MAX. When aggressive
1985 scrolling is in use, don't let point enter the opposite scroll
1986 margin as result of the scroll.
1987 (syms_of_xdisp) <scroll-conservatively>: Document the
1988 threshold of 100 lines for never-recentering scrolling.
1989
1990 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
1991
1992 * dispextern.h (move_it_by_lines):
1993 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
1994 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
1995 (message_log_check_duplicate): Remove parameters `prev_bol' and
1996 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
1997 (redisplay_internal): Remove parameter `preserve_echo_area',
1998 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
1999
2000 * indent.c (Fvertical_motion):
2001 * window.c (window_scroll_pixel_based, Frecenter):
2002 Don't pass `need_y_p' to `move_it_by_lines'.
2003
2004 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
2005
2006 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
2007 steal a few bits to be more compact.
2008 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
2009 Remove unneeded casts.
2010
2011 * bytecode.c (Fbyte_code): CAR and CDR can GC.
2012
2013 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
2014
2015 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
2016 binding" message (bug#7967).
2017
2018 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
2019
2020 Fix more problems found by GCC 4.6.0's static checks.
2021
2022 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
2023 Remove unused local var.
2024
2025 * editfns.c (Fmessage_box): Remove unused local var.
2026
2027 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
2028 (note_mode_line_or_margin_highlight, note_mouse_highlight):
2029 Omit unused local vars.
2030 * window.c (shrink_windows): Omit unused local var.
2031 * menu.c (digest_single_submenu): Omit unused local var.
2032 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
2033 Omit unused local var.
2034
2035 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
2036 Don't assume string length fits in int.
2037 (keyremap_step, read_key_sequence): Use size_t for sizes.
2038 (read_key_sequence): Don't check last_real_key_start redundantly.
2039
2040 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
2041 instead of alloca (Bug#8344).
2042
2043 * eval.c (Fbacktrace): Don't assume nargs fits in int.
2044 (Fbacktrace_frame): Don't assume nframes fits in int.
2045
2046 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
2047
2048 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
2049 concerns.
2050
2051 * term.c (produce_glyphless_glyph): Remove unnecessary test.
2052
2053 * cm.c (calccost): Turn while-do into do-while, for clarity.
2054
2055 * keyboard.c (syms_of_keyboard): Use the same style as later
2056 in this function when indexing through an array. This also
2057 works around GCC bug 48267.
2058
2059 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
2060
2061 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
2062
2063 * chartab.c (sub_char_table_ref_and_range): Redo for slight
2064 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
2065
2066 * keyboard.c, keyboard.h (num_input_events): Now size_t.
2067 This avoids undefined behavior on integer overflow, and is a bit
2068 more convenient anyway since it is compared to a size_t variable.
2069
2070 Variadic C functions now count arguments with size_t, not int.
2071 This avoids an unnecessary limitation on 64-bit machines, which
2072 caused (substring ...) to crash on large vectors (Bug#8344).
2073 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
2074 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
2075 All variadic functions and their callers changed accordingly.
2076 (struct gcpro.nvars): Now size_t, not int. All uses changed.
2077 * data.c (arith_driver, float_arith_driver): Likewise.
2078 * editfns.c (general_insert_function): Likewise.
2079 * eval.c (struct backtrace.nargs, interactive_p)
2080 (internal_condition_case_n, run_hook_with_args, apply_lambda)
2081 (funcall_lambda, mark_backtrace): Likewise.
2082 * fns.c (concat): Likewise.
2083 * frame.c (x_set_frame_parameters): Likewise.
2084 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
2085 0 if not found, not -1. All callers changed.
2086
2087 * alloc.c (garbage_collect): Don't assume stack size fits in int.
2088 (stack_copy_size): Now size_t, not int.
2089 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
2090
2091 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
2092
2093 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
2094 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
2095 All callers changed.
2096
2097 * lisp.h (multibyte_char_to_unibyte):
2098 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
2099 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
2100 * character.h (CHAR_TO_BYTE8):
2101 * cmds.c (internal_self_insert):
2102 * editfns.c (general_insert_function):
2103 * keymap.c (push_key_description):
2104 * search.c (Freplace_match):
2105 * xdisp.c (message_dolog, set_message_1): All callers changed.
2106
2107 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
2108
2109 * keyboard.c (safe_run_hook_funcall): New function.
2110 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
2111 don't set the hook to nil, but remove the offending function instead.
2112 (Qcommand_hook_internal): Remove, unused.
2113 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
2114 Vcommand_hook_internal.
2115
2116 * eval.c (enum run_hooks_condition): Remove.
2117 (funcall_nil, funcall_not): New functions.
2118 (run_hook_with_args): Call each function through a `funcall' argument.
2119 Remove `cond' argument, now redundant.
2120 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
2121 (Frun_hook_with_args_until_failure): Adjust accordingly.
2122 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
2123
2124 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
2125
2126 * dispextern.h (string_buffer_position): Remove declaration.
2127
2128 * print.c (strout): Remove parameter `multibyte', unused since
2129 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
2130
2131 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
2132 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
2133 All callers changed.
2134
2135 * w32.c (_wsa_errlist): Use braces for struct initializers.
2136
2137 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
2138 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
2139 All callers changed.
2140 (string_buffer_position): Likewise. Also, make static (it's never
2141 used outside xdisp.c).
2142 (cursor_row_p): Remove parameter `w', unused since
2143 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
2144 (decode_mode_spec): Remove parameter `precision', introduced during
2145 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
2146 All callers changed.
2147
2148 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
2149
2150 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
2151
2152 2011-03-27 Anders Lindgren <andlind@gmail.com>
2153
2154 * nsterm.m (ns_menu_bar_is_hidden): New variable.
2155 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
2156 (ns_update_auto_hide_menu_bar): New functions.
2157 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
2158 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
2159 ns_constrain_all_frames.
2160 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
2161 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
2162
2163 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
2164
2165 * nsmenu.m (runDialogAt): Remove argument to timer_check.
2166
2167 2011-03-27 Glenn Morris <rgm@gnu.org>
2168
2169 * syssignal.h: Replace RETSIGTYPE with void.
2170 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
2171 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
2172 Replace SIGTYPE with void everywhere.
2173 * s/usg5-4-common.h (SIGTYPE): Remove definition.
2174 * s/template.h (SIGTYPE): Remove commented out definition.
2175
2176 2011-03-26 Eli Zaretskii <eliz@gnu.org>
2177
2178 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
2179 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
2180
2181 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
2182
2183 * w32.c (read_unc_volume): Use parameter `henum', instead of
2184 global variable `wget_enum_handle'.
2185
2186 * keymap.c (describe_vector): Remove parameters `indices' and
2187 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
2188 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
2189
2190 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
2191
2192 * keyboard.c (timer_check): Remove parameter `do_it_now',
2193 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
2194 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
2195 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
2196
2197 * keyboard.c (read_char):
2198 * w32menu.c (w32_menu_display_help):
2199 * xmenu.c (show_help_event, menu_help_callback):
2200 Adjust calls to `show_help_echo'.
2201
2202 * gtkutil.c (xg_maybe_add_timer):
2203 * keyboard.c (readable_events):
2204 * process.c (wait_reading_process_output):
2205 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
2206
2207 * insdel.c (adjust_markers_gap_motion):
2208 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
2209 (gap_left, gap_right): Don't call it.
2210
2211 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
2212
2213 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
2214 incurred during fontification.
2215
2216 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
2217
2218 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
2219 (DEFVAR_PER_BUFFER): Don't pass it.
2220
2221 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
2222 (scrolling_window): Don't pass it.
2223
2224 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
2225
2226 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
2227
2228 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
2229 and `suffix'.
2230 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
2231 of variables specific to SELinux and computation of `encoded_absname'.
2232
2233 * image.c (XPutPixel): Remove unused variable `height'.
2234
2235 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
2236
2237 * unexw32.c (get_section_info): Remove unused variable `section'.
2238
2239 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
2240 (system_process_attributes): Remove unused variable `sess'.
2241 (sys_read): Remove unused variable `err'.
2242
2243 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
2244 (w32_wnd_proc): Remove unused variable `isdead'.
2245 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
2246 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
2247 (x_create_tip_frame): Remove unused variable `tem'.
2248
2249 * w32inevt.c (w32_console_read_socket):
2250 Remove unused variable `no_events'.
2251
2252 * w32term.c (x_draw_composite_glyph_string_foreground):
2253 Remove unused variable `width'.
2254
2255 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
2256
2257 * w32term.c (x_set_glyph_string_clipping):
2258 Don't pass uninitialized region to CombineRgn.
2259
2260 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
2261
2262 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
2263 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
2264 (Fx_close_connection): Remove unused variable `i'.
2265
2266 * w32font.c (w32font_draw): Return number of glyphs.
2267 (w32font_open_internal): Remove unused variable `i'.
2268 (w32font_driver): Add missing initializer.
2269
2270 * w32menu.c (utf8to16): Remove unused variable `utf16'.
2271 (fill_in_menu): Remove unused variable `items_added'.
2272
2273 * w32term.c (last_mouse_press_frame): Remove static global variable.
2274 (w32_clip_to_row): Remove unused variable `f'.
2275 (x_delete_terminal): Remove unused variable `i'.
2276
2277 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
2278 (NOTHING): Remove unused static global variable.
2279 (uniscribe_check_otf): Remove unused variable `table'.
2280 (uniscribe_font_driver): Add missing initializers.
2281
2282 2011-03-23 Julien Danjou <julien@danjou.info>
2283
2284 * term.c (Fsuspend_tty, Fresume_tty):
2285 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
2286 * window.c (temp_output_buffer_show):
2287 * insdel.c (signal_before_change):
2288 * frame.c (Fhandle_switch_frame):
2289 * fileio.c (Fdo_auto_save):
2290 * emacs.c (Fkill_emacs):
2291 * editfns.c (save_excursion_restore):
2292 * cmds.c (internal_self_insert):
2293 * callint.c (Fcall_interactively):
2294 * buffer.c (Fkill_all_local_variables):
2295 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
2296 Use Frun_hooks.
2297 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
2298 unconditionnaly since it does the check itself.
2299
2300 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
2301
2302 Fix more problems found by GCC 4.5.2's static checks.
2303
2304 * coding.c (encode_coding_raw_text): Avoid unnecessary test
2305 the first time through the loop, since we know p0 < p1 then.
2306 This also avoids a gcc -Wstrict-overflow warning.
2307
2308 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
2309 leading to a memory leak, possible in functions like
2310 load_charset_map_from_file that can allocate an unbounded number
2311 of objects (Bug#8318).
2312
2313 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
2314 that could (at least in theory) be that large.
2315
2316 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
2317 This is less likely to overflow, and avoids undefined behavior if
2318 overflow does occur. All callers changed. Use strtoul to scan
2319 for the unsigned long integer.
2320 (pint2hrstr): Simplify and tune code slightly.
2321 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
2322
2323 * scroll.c (do_scrolling): Work around GCC bug 48228.
2324 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
2325
2326 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
2327 This also avoids a warning with gcc -Wstrict-overflow.
2328 (validate_x_resource_name): Simplify count usage.
2329 This also avoids a warning with gcc -Wstrict-overflow.
2330
2331 * fileio.c (Fcopy_file): Report error if fchown or fchmod
2332 fail (Bug#8306).
2333
2334 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
2335
2336 * process.c (Fmake_network_process): Use socklen_t, not int,
2337 where POSIX says socklen_t is required in portable programs.
2338 This fixes a porting bug on hosts like 64-bit HP-UX, where
2339 socklen_t is wider than int (Bug#8277).
2340 (Fmake_network_process, server_accept_connection):
2341 (wait_reading_process_output, read_process_output):
2342 Likewise.
2343
2344 * process.c: Rename or move locals to avoid shadowing.
2345 (list_processes_1, Fmake_network_process):
2346 (read_process_output_error_handler, exec_sentinel_error_handler):
2347 Rename or move locals.
2348 (Fmake_network_process): Define label "retry_connect" only if needed.
2349 (Fnetwork_interface_info): Fix pointer signedness.
2350 (process_send_signal): Add cast to avoid pointer signedness problem.
2351 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
2352 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
2353
2354 Make tparam.h and terminfo.c consistent.
2355 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
2356 Include tparam.h instead, since it declares them.
2357 * cm.h (PC): Remove extern decl; tparam.h now does this.
2358 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
2359 * terminfo.c: Include tparam.h, to check interfaces.
2360 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
2361 (tparam): Adjust signature to match interface in tparam.h;
2362 this removes some undefined behavior. Check that outstring and len
2363 are zero, which they always are with Emacs.
2364 * tparam.h (PC, BC, UP): New extern decls.
2365
2366 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
2367 (xftfont_open): Rename locals to avoid shadowing.
2368
2369 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
2370 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
2371 (OTF_TAG_SYM): Omit macro if not needed.
2372 (ftfont_list): Remove unused local.
2373 (get_adstyle_property, ftfont_pattern_entity):
2374 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
2375 Rename locals to avoid shadowing.
2376
2377 * xfont.c (xfont_list_family): Mark var as initialized.
2378
2379 * xml.c (make_dom): Now static.
2380
2381 * composite.c (composition_compute_stop_pos): Rename local to
2382 avoid shadowing.
2383 (composition_reseat_it): Remove unused locals.
2384 (find_automatic_composition, composition_adjust_point): Likewise.
2385 (composition_update_it): Mark var as initialized.
2386 (find_automatic_composition): Mark vars as initialized,
2387 with a FIXME (Bug#8290).
2388
2389 character.h: Rename locals to avoid shadowing.
2390 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
2391 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
2392 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
2393 (BUF_DEC_POS): Be more systematic about renaming local temporaries
2394 to avoid shadowing.
2395
2396 * textprop.c (property_change_between_p): Remove; unused.
2397
2398 * intervals.c (interval_start_pos): Now static.
2399
2400 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
2401
2402 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
2403 Rename locals to avoid shadowing.
2404
2405 * sound.c (wav_play, au_play, Fplay_sound_internal):
2406 Fix pointer signedness.
2407 (alsa_choose_format): Remove unused local var.
2408 (wav_play): Initialize a variable to 0, to prevent undefined
2409 behavior (Bug#8278).
2410
2411 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
2412
2413 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
2414
2415 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
2416 clobbering (Bug#8298).
2417 * sysdep.c (sys_subshell): Likewise.
2418 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
2419
2420 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
2421 This should get cleaned up, so that child_setup has the
2422 same signature on all platforms.
2423
2424 * callproc.c (call_process_cleanup): Now static.
2425 (relocate_fd): Rename locals to avoid shadowing.
2426
2427 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
2428
2429 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
2430 not to be necessary, and produces flickering.
2431
2432 2011-03-20 Glenn Morris <rgm@gnu.org>
2433
2434 * config.in: Remove file.
2435
2436 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
2437
2438 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
2439 are now in src/globals.h.
2440 (syms_of_minibuf): Remove spurious & from previous change.
2441
2442 2011-03-20 Leo <sdl.web@gmail.com>
2443
2444 * minibuf.c (completing-read-function): New variable.
2445 (completing-read-default): Rename from completing-read.
2446 (completing-read): Call completing-read-function.
2447
2448 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
2449
2450 * xfaces.c (Fx_load_color_file):
2451 Read color file from absolute filename (bug#8250).
2452
2453 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
2454
2455 * makefile.w32-in: Update dependencies.
2456
2457 2011-03-17 Eli Zaretskii <eliz@gnu.org>
2458
2459 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
2460
2461 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
2462
2463 Fix more problems found by GCC 4.5.2's static checks.
2464
2465 * process.c (make_serial_process_unwind, send_process_trap):
2466 (sigchld_handler): Now static.
2467
2468 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
2469 That way, the code declares only the vars that it needs.
2470 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
2471 * s/cygwin.h (PTY_ITERATION): Likewise.
2472 * s/darwin.h (PTY_ITERATION): Likewise.
2473 * s/gnu-linux.h (PTY_ITERATION): Likewise.
2474
2475 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
2476 * process.c (allocate_pty): Don't declare stb unless it's needed.
2477
2478 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
2479 (CONSTANTLIM): Remove; unused.
2480 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
2481 Define only if needed.
2482
2483 * unexelf.c (unexec): Name an expression,
2484 to avoid gcc -Wbad-function-cast warning.
2485 Use a different way to cause a compilation error if anyone uses
2486 n rather than nn, a way that does not involve shadowing.
2487 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
2488
2489 * deps.mk (unexalpha.o): Remove; unused.
2490
2491 New file unexec.h, the (simple) interface for unexec (Bug#8267).
2492 * unexec.h: New file.
2493 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
2494 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
2495 Depend on unexec.h.
2496 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
2497 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
2498 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
2499 Change as necessary to match prototype in unexec.h.
2500
2501 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
2502 shadowing.
2503 (back_comment, skip_chars): Mark vars as initialized.
2504
2505 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
2506 Rename locals to avoid shadowing.
2507
2508 * lread.c (read1): Rewrite so as not to use empty "else".
2509 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
2510
2511 * print.c (Fredirect_debugging_output): Fix pointer signedess.
2512
2513 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
2514 warning when compiling print.c.
2515
2516 * font.c (font_unparse_fcname): Abort in an "impossible" situation
2517 instead of using an uninitialized var.
2518 (font_sort_entities): Mark var as initialized.
2519
2520 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
2521
2522 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
2523 pointers to constants.
2524 (font_parse_fcname): Remove unused vars.
2525 (font_delete_unmatched): Now static.
2526 (font_get_spec): Remove; unused.
2527 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
2528 (font_update_drivers, Ffont_get_glyphs, font_add_log):
2529 Rename or move locals to avoid shadowing.
2530
2531 * fns.c (require_nesting_list, require_unwind): Now static.
2532 (Ffillarray): Rename locals to avoid shadowing.
2533
2534 * floatfns.c (domain_error2): Define only if needed.
2535 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
2536
2537 * alloc.c (mark_backtrace): Move decl from here ...
2538 * lisp.h: ... to here, so that it can be checked.
2539
2540 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
2541 (Fdefvar): Rewrite so as not to use empty "else".
2542 (lisp_indirect_variable): Name an expression,
2543 to avoid gcc -Wbad-function-cast warning.
2544 (Fdefvar): Rename locals to avoid shadowing.
2545
2546 * callint.c (quotify_arg, quotify_args): Now static.
2547 (Fcall_interactively): Rename locals to avoid shadowing.
2548 Use const pointer when appropriate.
2549
2550 * lisp.h (get_system_name, get_operating_system_release):
2551 Move decls here, to check interfaces.
2552 * process.c (get_operating_system_release): Move decl to lisp.h.
2553 * xrdb.c (get_system_name): Likewise.
2554 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
2555 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
2556 some of which prompt warnings from gcc -Wbad-function-cast.
2557 (Fformat_time_string, Fencode_time, Finsert_char):
2558 (Ftranslate_region_internal, Fformat):
2559 Rename or remove local vars to avoid shadowing.
2560 (Ftranslate_region_internal): Mark var as initialized.
2561
2562 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
2563 avoid shadowing.
2564
2565 * lisp.h (eassert): Check that the argument compiles, even if
2566 ENABLE_CHECKING is not defined.
2567
2568 * data.c (Findirect_variable): Name an expression, to avoid
2569 gcc -Wbad-function-cast warning.
2570 (default_value, arithcompare, arith_driver, arith_error): Now static.
2571 (store_symval_forwarding): Rename local to avoid shadowing.
2572 (Fmake_variable_buffer_local, Fmake_local_variable):
2573 Mark variables as initialized.
2574 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
2575
2576 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
2577 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
2578 Rename locals to avoid shadowing.
2579 (mark_stack): Move local variables into the #ifdef region where
2580 they're used.
2581 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
2582 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
2583 needed otherwise.
2584 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
2585 (GC_STRING_CHARS): Remove; not used.
2586 (Fmemory_limit): Cast sbrk's returned value to char *.
2587
2588 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
2589 avoids undefined behavior in theory.
2590
2591 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
2592
2593 Use functions, not macros, for up- and down-casing (Bug#8254).
2594 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
2595 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
2596 to use the following functions instead of these macros.
2597 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
2598 EMACS_INT, since callers assume the returned value fits in int.
2599 (upcase1): Likewise, for UPCASE_TABLE.
2600 (uppercasep, lowercasep, upcase): New static inline functions.
2601 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
2602 the race-condition problem in the old DOWNCASE.
2603
2604 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
2605 Rename locals to avoid shadowing.
2606 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
2607 (regex_compile, re_search_2, re_match_2_internal):
2608 Remove unused local vars.
2609 (FREE_VAR): Rewrite so as not to use empty "else",
2610 which gcc can warn about.
2611 (regex_compile, re_match_2_internal): Mark locals as initialized.
2612 (RETALLOC_IF): Define only if needed.
2613 (WORDCHAR_P): Likewise. This one is never needed, but is used
2614 only in a comment talking about a compiler bug, so put inside
2615 the #if 0 of that comment.
2616 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
2617 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
2618 Remove; unused.
2619
2620 * search.c (boyer_moore): Rename locals to avoid shadowing.
2621 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
2622 (PREV_CHAR_BOUNDARY): Likewise.
2623
2624 * search.c (simple_search): Remove unused var.
2625
2626 * dired.c (compile_pattern): Move decl from here ...
2627 * lisp.h: ... to here, so that it can be checked.
2628 (struct re_registers): New forward decl.
2629
2630 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
2631
2632 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
2633 All uses changed.
2634 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
2635 Rename locals to avoid shadowing.
2636 (Fvertical_motion): Mark locals as initialized.
2637
2638 * casefiddle.c (casify_object, casify_region): Now static.
2639 (casify_region): Mark local as initialized.
2640
2641 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
2642
2643 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
2644 New macros, so that the caller can use some names other than
2645 gcpro1, gcpro2, etc.
2646 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
2647 of the new macros.
2648 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
2649 argument, for consistency with GCPRO2_VAR, etc: it is now the
2650 prefix of the variable, not the variable itself. All uses
2651 changed.
2652 * dired.c (directory_files_internal, file_name_completion):
2653 Rename locals to avoid shadowing.
2654
2655 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
2656 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
2657 dired.c's scmp function, had undefined behavior.
2658 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
2659 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
2660 * buffer.h: ... to here, because these macros use current_buffer,
2661 and the new implementation with inline functions needs to have
2662 current_buffer in scope now, rather than later when the macros
2663 are used.
2664 (downcase, upcase1): New static inline functions.
2665 (DOWNCASE, UPCASE1): Reimplement using these functions.
2666 This avoids undefined behavior in expressions like
2667 DOWNCASE (x) == DOWNCASE (y), which previously suffered
2668 from race conditions in accessing the global variables
2669 case_temp1 and case_temp2.
2670 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
2671 * lisp.h (case_temp1, case_temp2): Remove their decls.
2672 * character.h (ASCII_CHAR_P): Move from here ...
2673 * lisp.h: ... to here, so that the inline functions mentioned
2674 above can use them.
2675
2676 * dired.c (directory_files_internal_unwind): Now static.
2677
2678 * fileio.c (file_name_as_directory, directory_file_name):
2679 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
2680 Now static.
2681 (file_name_as_directory): Use const pointers when appropriate.
2682 (Fexpand_file_name): Likewise. In particular, newdir might
2683 point at constant storage, so make it a const pointer.
2684 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
2685 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
2686 signedness issues.
2687 (Fset_file_times, Finsert_file_contents, auto_save_error):
2688 Rename locals to avoid shadowing.
2689
2690 * minibuf.c (choose_minibuf_frame_1): Now static.
2691 (Ftry_completion, Fall_completions): Rename or remove locals
2692 to avoid shadowing.
2693
2694 * marker.c (bytepos_to_charpos): Remove; unused.
2695
2696 * lisp.h (verify_bytepos, count_markers): New decls,
2697 so that gcc does not warn that these functions aren't declared.
2698
2699 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
2700 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
2701 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
2702 (copy_text): Remove unused local var.
2703
2704 * filelock.c (within_one_second): Now static.
2705 (lock_file_1): Rename local to avoid shadowing.
2706
2707 * buffer.c (fix_overlays_before): Mark locals as initialized.
2708 (fix_start_end_in_overlays): Likewise. This function should be
2709 simplified by using pointers-to-pointers, but that's a different
2710 matter.
2711 (switch_to_buffer_1): Now static.
2712 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
2713 (report_overlay_modification): Rename locals to avoid shadowing.
2714
2715 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
2716 Fix pointer signedness issue.
2717 (sys_subshell): Mark local as volatile if checking for lint,
2718 to suppress a gcc -Wclobbered warning that does not seem to be right.
2719 (MAXPATHLEN): Define only if needed.
2720
2721 * process.c (serial_open, serial_configure): Move decls from here ...
2722 * systty.h: ... to here, so that they can be checked.
2723
2724 * fns.c (get_random, seed_random): Move extern decls from here ...
2725 * lisp.h: ... to here, so that they can be checked.
2726
2727 * sysdep.c (reset_io): Now static.
2728 (wait_for_termination_signal): Remove; unused.
2729
2730 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
2731 (copy_keymap_item, append_key, push_text_char_description):
2732 Now static.
2733 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
2734 (DENSE_TABLE_SIZE): Remove; unused.
2735 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
2736 (describe_map_tree):
2737 Rename locals to avoid shadowing.
2738
2739 * keyboard.c: Declare functions static if they are not used elsewhere.
2740 (echo_char, echo_dash, cmd_error, top_level_2):
2741 (poll_for_input, handle_async_input): Now static.
2742 (read_char, kbd_buffer_get_event, make_lispy_position):
2743 (make_lispy_event, make_lispy_movement, apply_modifiers):
2744 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
2745 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
2746 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
2747 (read_key_sequence, read_char): Mark locals as initialized.
2748 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2749
2750 * keyboard.h (make_ctrl_char): New decl.
2751 (mark_kboards): Move decl here ...
2752 * alloc.c (mark_kboards): ... from here.
2753
2754 * lisp.h (force_auto_save_soon): New decl.
2755
2756 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
2757 (DEFINE_DUMMY_FUNCTION): New macro.
2758 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
2759 Use it.
2760 (main): Add casts to avoid warnings
2761 if GCC considers string literals to be constants.
2762
2763 * lisp.h (fatal_error_signal): Add decl, since it's exported.
2764
2765 * dbusbind.c: Pointer signedness fixes.
2766 (xd_signature, xd_append_arg, xd_initialize):
2767 (Fdbus_call_method, Fdbus_call_method_asynchronously):
2768 (Fdbus_method_return_internal, Fdbus_method_error_internal):
2769 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
2770 (Fdbus_register_signal): Use SSDATA when the context wants char *.
2771
2772 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
2773 if GCC considers string literals to be constants.
2774 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
2775
2776 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
2777
2778 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
2779 (print_preprocess, print_object): New macro to fix last change.
2780
2781 * print.c (print_preprocess): Don't forget font objects.
2782
2783 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
2784
2785 * emacs.c (USAGE3): Doc fixes.
2786
2787 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
2788
2789 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
2790 structure.
2791
2792 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
2793
2794 * lisp.h (VWindow_system, Qfile_name_history):
2795 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
2796 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
2797 (w32_system_caret_x, w32_system_caret_y): Declare extern.
2798
2799 * w32select.c: Don't #include "keyboard.h".
2800 (run_protected): Add extern declaration for waiting_for_input.
2801
2802 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
2803 * w32console.c (detect_input_pending, read_input_pending)
2804 (encode_terminal_code):
2805 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
2806 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
2807 (w32_system_caret_y, Qfile_name_history):
2808 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
2809 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
2810 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
2811 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
2812 * w32proc.c (Qlocal, report_file_error):
2813 * w32term.c (Vwindow_system, updating_frame):
2814 * w32uniscribe.c (initialized, uniscribe_font_driver):
2815 Remove unneeded extern declarations.
2816
2817 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
2818
2819 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2820
2821 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
2822
2823 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
2824 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
2825 These macros can no longer be used for assignment.
2826
2827 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2828 Assign struct members directly, instead of using BUF_BEGV etc.
2829 (record_buffer_markers, fetch_buffer_markers): New functions for
2830 recording and fetching special buffer markers.
2831 (set_buffer_internal_1, set_buffer_temp): Use them.
2832
2833 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
2834
2835 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
2836
2837 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
2838 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
2839
2840 * xdisp.c (hscroll_window_tree):
2841 (reconsider_clip_changes): Use PT instead of BUF_PT.
2842
2843 2011-03-13 Eli Zaretskii <eliz@gnu.org>
2844
2845 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
2846 $(EMACS_ROOT)/lib/intprops.h.
2847
2848 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
2849
2850 Fix more problems found by GCC 4.5.2's static checks.
2851
2852 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
2853 to unsigned char * to avoid compiler diagnostic.
2854 (xg_free_frame_widgets): Make it clear that a local variable is
2855 needed only if USE_GTK_TOOLTIP.
2856 (gdk_window_get_screen): Make it clear that this macro is needed
2857 only if USE_GTK_TOOLTIP.
2858 (int_gtk_range_get_value): New function, which avoids a diagnostic
2859 from gcc -Wbad-function-cast.
2860 (xg_set_toolkit_scroll_bar_thumb): Use it.
2861 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
2862 diagnostic from gcc -Wbad-function-cast.
2863 (get_utf8_string, xg_get_file_with_chooser):
2864 Rename locals to avoid shadowing.
2865 (create_dialog): Move locals to avoid shadowing.
2866
2867 * xgselect.c (xg_select): Remove unused var.
2868
2869 * image.c (four_corners_best): Mark locals as initialized.
2870 (gif_load): Initialize transparent_p to zero (Bug#8238).
2871 Mark another local as initialized.
2872 (my_png_error, my_error_exit): Mark with NO_RETURN.
2873
2874 * image.c (clear_image_cache): Now static.
2875 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
2876 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
2877 (x_edge_detection): Remove unnecessary cast that
2878 gcc -Wbad-function-cast diagnoses.
2879 (gif_load): Fix pointer signedness.
2880 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
2881 (jpeg_load, gif_load): Rename locals to avoid shadowing.
2882
2883 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
2884
2885 Improve quality of tests for time stamp overflow.
2886 For example, without this patch (encode-time 0 0 0 1 1
2887 1152921504606846976) returns the obviously-bogus value (-948597
2888 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
2889 reports time overflow. See
2890 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
2891 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
2892 * editfns.c: Include limits.h and intprops.h.
2893 (TIME_T_MIN, TIME_T_MAX): New macros.
2894 (time_overflow): Move earlier, to before first use.
2895 (hi_time, lo_time): New functions, for an accurate test for
2896 out-of-range times.
2897 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
2898 (Fget_internal_run_time): Don't assume time_t fits in int.
2899 (make_time): Use list2 instead of Fcons twice.
2900 (Fdecode_time): More accurate test for out-of-range times.
2901 (check_tm_member): New function.
2902 (Fencode_time): Use it, to test for out-of-range times.
2903 (lisp_time_argument): Don't rely on undefined left-shift and
2904 right-shift behavior when checking for time stamp overflow.
2905
2906 * editfns.c (time_overflow): New function, refactoring common code.
2907 (Fformat_time_string, Fdecode_time, Fencode_time):
2908 (Fcurrent_time_string): Use it.
2909
2910 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
2911 * dired.c (make_time): Move to ...
2912 * editfns.c (make_time): ... here.
2913 * systime.h: Note the move.
2914
2915 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2916
2917 * fringe.c (update_window_fringes): Remove unused variables.
2918
2919 * unexmacosx.c (copy_data_segment): Also copy __got section.
2920 (Bug#8223)
2921
2922 2011-03-12 Eli Zaretskii <eliz@gnu.org>
2923
2924 * termcap.c [MSDOS]: Include "msdos.h".
2925 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
2926 Constify `char *' arguments and their references according to
2927 prototypes in tparam.h.
2928
2929 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
2930
2931 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
2932 Adapt all references accordingly.
2933
2934 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
2935
2936 2011-03-11 Tom Tromey <tromey@redhat.com>
2937
2938 * buffer.c (syms_of_buffer): Remove obsolete comment.
2939
2940 2011-03-11 Eli Zaretskii <eliz@gnu.org>
2941
2942 * termhooks.h (encode_terminal_code): Declare prototype.
2943
2944 * msdos.c (encode_terminal_code): Don't declare prototype.
2945
2946 * term.c (encode_terminal_code): Now external again, used by
2947 w32console.c and msdos.c.
2948
2949 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
2950 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
2951
2952 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
2953
2954 Fix some minor problems found by GCC 4.5.2's static checks.
2955
2956 * fringe.c (update_window_fringes): Mark locals as initialized
2957 (Bug#8227).
2958 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
2959
2960 * alloc.c (mark_fringe_data): Move decl from here ...
2961 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
2962 to check its interface.
2963 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
2964
2965 * fontset.c (free_realized_fontset): Now static.
2966 (Fset_fontset_font): Rename local to avoid shadowing.
2967 (fontset_font): Mark local as initialized.
2968 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
2969
2970 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
2971
2972 * xselect.c (x_disown_buffer_selections): Remove; not used.
2973 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
2974 (x_own_selection, Fx_disown_selection_internal): Rename locals
2975 to avoid shadowing.
2976 (x_handle_dnd_message): Remove local to avoid shadowing.
2977
2978 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
2979 so that the caller can use some name other than gcpro1.
2980 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
2981 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
2982 (Fx_backspace_delete_keys_p):
2983 Use them to avoid shadowing, and rename vars to avoid shadowing.
2984 (x_decode_color, x_set_name, x_window): Now static.
2985 (Fx_create_frame): Add braces to silence GCC warning.
2986 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
2987 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
2988 Remove unused locals.
2989 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
2990 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
2991 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
2992 macros.
2993
2994 * xterm.h (x_mouse_leave): New decl.
2995
2996 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
2997 Remove unused functions.
2998 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
2999 (x_calc_absolute_position): Now static.
3000 (XTread_socket): Don't define label "out" unless it's used.
3001 Don't declare local "event" unless it's used.
3002 (x_iconify_frame, x_free_frame_resources): Don't declare locals
3003 unless they are used.
3004 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
3005 (x_fatal_error_signal): Remove; not used.
3006 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
3007 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
3008 (x_error_catcher, x_connection_closed, x_error_handler):
3009 (x_error_quitter, xembed_send_message, x_iconify_frame):
3010 (my_log_handler): Rename locals to avoid shadowing.
3011 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
3012 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
3013
3014 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
3015 Rename or move locals to avoid shadowing.
3016 (tty_defined_color, merge_face_heights): Now static.
3017 (free_realized_faces_for_fontset): Remove; not used.
3018 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
3019 does not deduce is never used uninitialized.
3020 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
3021 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
3022
3023 * terminal.c (store_terminal_param): Now static.
3024
3025 * xmenu.c (menu_highlight_callback): Now static.
3026 (set_frame_menubar): Remove unused local.
3027 (xmenu_show): Rename parameter to avoid shadowing.
3028 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
3029 since they might point to immutable storage.
3030 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
3031 since it's unused otherwise.
3032
3033 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
3034 Add a FIXME, since the code still doesn't look right. (Bug#8215)
3035 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
3036 avoids a gcc -Wuninitialized diagnostic.
3037 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
3038 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
3039 does not deduce are never used uninitialized.
3040
3041 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
3042
3043 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
3044 * window.c (window_loop, size_window):
3045 (run_window_configuration_change_hook, enlarge_window): Likewise.
3046
3047 * window.c (display_buffer): Now static.
3048 (size_window): Mark variables that gcc -Wuninitialized
3049 does not deduce are never used uninitialized.
3050 * window.h (check_all_windows): New decl, to forestall
3051 gcc -Wmissing-prototypes diagnostic.
3052 * dispextern.h (bidi_dump_cached_states): Likewise.
3053
3054 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
3055 shadowing.
3056 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
3057 Include <limits.h>.
3058 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
3059 and to avoid gcc -Wuninitialized warning.
3060 (load_charset_map): Mark variables that gcc -Wuninitialized
3061 does not deduce are never used uninitialized.
3062 (load_charset): Abort instead of using uninitialized var (Bug#8229).
3063
3064 * coding.c (coding_set_source, coding_set_destination):
3065 Use "else { /* comment */ }" rather than "else /* comment */;"
3066 for clarity, and to avoid gcc -Wempty-body warning.
3067 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
3068 a block, when the outer 'i' will do.
3069 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
3070 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
3071 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
3072 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
3073 (Fdecode_sjis_char, Fdefine_coding_system_internal):
3074 Rename locals to avoid shadowing.
3075 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
3076 * coding.c (emacs_mule_char, encode_invocation_designation):
3077 Now static, since they're not used elsewhere.
3078 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
3079 (decode_coding_object, encode_coding_object, detect_coding_system):
3080 (decode_coding_emacs_mule): Mark variables that gcc
3081 -Wuninitialized does not deduce are never used uninitialized.
3082 (detect_coding_iso_2022): Initialize a local variable that might
3083 be used uninitialized. Leave a FIXME because it's not clear that
3084 this initialization is needed. (Bug#8211)
3085 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
3086 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
3087 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
3088 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
3089 Remove unused macros.
3090
3091 * category.c (hash_get_category_set): Remove unused local var.
3092 (copy_category_table): Now static, since it's not used elsewhere.
3093 * character.c (string_count_byte8): Likewise.
3094
3095 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
3096 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
3097
3098 * chartab.c (copy_sub_char_table): Now static, since it's not used
3099 elsewhere.
3100 (sub_char_table_ref_and_range, char_table_ref_and_range):
3101 Rename locals to avoid shadowing.
3102 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
3103
3104 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
3105 (BIDI_BOB): Remove unused macro.
3106
3107 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
3108 deduce are never used uninitialized.
3109 * term.c (encode_terminal_code): Likewise.
3110
3111 * term.c (encode_terminal_code): Now static. Remove unused local.
3112
3113 * tparam.h: New file.
3114 * term.c, tparam.h: Include it.
3115 * deps.mk (term.o, tparam.o): Depend on tparam.h.
3116 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
3117 Move these decls to tparam.h, and make them agree with what
3118 is actually in tparam.c. The previous trick of using incompatible
3119 decls in different modules does not conform to the C standard.
3120 All callers of tparam changed to use tparam's actual API.
3121 * tparam.c (tparam1, tparam, tgoto):
3122 Use const pointers where appropriate.
3123
3124 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
3125 * cm.h (struct cm): Likewise.
3126 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
3127 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
3128 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
3129 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
3130 (turn_on_face, init_tty): Likewise.
3131 * termchar.h (struct tty_display_info): Likewise.
3132
3133 * term.c (term_mouse_position): Rename local to avoid shadowing.
3134
3135 * alloc.c (mark_ttys): Move decl from here ...
3136 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
3137
3138 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
3139
3140 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
3141
3142 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
3143
3144 * search.c (compile_pattern_1): Remove argument regp, unused since
3145 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
3146 (compile_pattern): Don't pass it.
3147
3148 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
3149
3150 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
3151 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
3152 for ! HAVE_GTK3.
3153 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
3154
3155 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
3156
3157 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
3158 gdk_window_get_screen, gdk_window_get_geometry,
3159 gdk_x11_window_lookup_for_display and GDK_KEY_g.
3160 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
3161 (xg_get_pixbuf_from_pixmap): New function.
3162 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
3163 to Pixmap, take frame as parameter, remove GdkColormap parameter.
3164 Call xg_get_pixbuf_from_pixmap instead of
3165 gdk_pixbuf_get_from_drawable.
3166 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
3167 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
3168 (xg_check_special_colors): Use GtkStyleContext and its functions
3169 for HAVE_GTK3.
3170 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
3171 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
3172 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
3173 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
3174 Call gtk_widget_get_preferred_size.
3175 (xg_frame_resized): gdk_window_get_geometry only takes 5
3176 parameters.
3177 (xg_win_to_widget, xg_event_is_for_menubar):
3178 Call gdk_x11_window_lookup_for_display.
3179 (xg_set_widget_bg): New function.
3180 (delete_cb): New function.
3181 (xg_create_frame_widgets): Connect delete-event to delete_cb.
3182 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
3183 (xg_set_background_color): Call xg_set_widget_bg.
3184 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
3185 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
3186 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
3187 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
3188 if ! HAVE_GTK3.
3189 (update_frame_tool_bar): Call gtk_widget_hide.
3190 (xg_initialize): Use GDK_KEY_g.
3191
3192 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
3193 if ! HAVE_GTK3
3194 (x_session_initialize): Call gdk_x11_set_sm_client_id.
3195
3196 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
3197 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
3198 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
3199
3200 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
3201
3202 * w32xfns.c (select_palette): Check success of RealizePalette against
3203 GDI_ERROR, not zero.
3204
3205 See ChangeLog.11 for earlier changes.
3206
3207 ;; Local Variables:
3208 ;; coding: utf-8
3209 ;; End:
3210
3211 Copyright (C) 2011 Free Software Foundation, Inc.
3212
3213 This file is part of GNU Emacs.
3214
3215 GNU Emacs is free software: you can redistribute it and/or modify
3216 it under the terms of the GNU General Public License as published by
3217 the Free Software Foundation, either version 3 of the License, or
3218 (at your option) any later version.
3219
3220 GNU Emacs is distributed in the hope that it will be useful,
3221 but WITHOUT ANY WARRANTY; without even the implied warranty of
3222 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3223 GNU General Public License for more details.
3224
3225 You should have received a copy of the GNU General Public License
3226 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.