* process.c (Fnetwork_interface_info): Avoid left-shift undefined
[bpt/emacs.git] / src / ChangeLog
1 2011-04-19 Paul Eggert <eggert@cs.ucla.edu>
2
3 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
4 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
5
6 * xfns.c (Fx_window_property): Simplify a bit,
7 to make a bit faster and to avoid GCC 4.6.0 warning.
8 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
9
10 * fns.c (internal_equal): Don't assume size_t fits in int.
11
12 * alloc.c (compact_small_strings): Tighten assertion a little.
13
14 Replace pEd with more-general pI, and fix some printf arg casts.
15 * lisp.h (pI): New macro, generalizing old pEd macro to other
16 conversion specifiers. For example, use "...%"pI"d..." rather
17 than "...%"pEd"...".
18 (pEd): Remove. All uses replaced with similar uses of pI.
19 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
20 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
22 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
23 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
24 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
25 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
26 64-bit hosts.
27 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
28 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
29 * print.c (safe_debug_print, print_object): Likewise.
30 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
31 to int.
32 Use pI instead of if-then-else-abort. Use %p to avoid casts.
33 * process.c (Fmake_network_process): Use pI to avoid cast.
34 * region-cache.c (pp_cache): Likewise.
35 * xdisp.c (decode_mode_spec): Likewise.
36 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
37 behavior on 64-bit hosts with printf arg.
38 * xselect.c (x_queue_event): Use %p to avoid casts.
39 (x_stop_queuing_selection_requests): Likewise.
40 (x_get_window_property): Don't truncate byte count to an 'int'
41 when tracing.
42
43 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
44 here, since it parses constructs like leading '-' and spaces,
45 which are not wanted; and it overflows with large numbers.
46 Instead, simply match F[0-9]+, which is what is wanted anyway.
47
48 * alloc.c: Remove unportable assumptions about struct layout.
49 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
50 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
51 (allocate_vectorlike, make_pure_vector): Use the new macros,
52 plus offsetof, to remove unportable assumptions about struct layout.
53 These assumptions hold on all porting targets that I know of, but
54 they are not guaranteed, they're easy to remove, and removing them
55 makes further changes easier.
56
57 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
58 This doesn't fix a bug but makes the code clearer.
59 (string_overrun_cookie): Now const. Use initializers that
60 don't formally overflow signed char, to avoid warnings.
61 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
62 can cause Emacs to crash when string overrun checking is enabled.
63 (allocate_buffer): Don't assume sizeof (struct buffer) is a
64 multiple of sizeof (EMACS_INT); it need not be, if
65 alignof(EMACS_INT) < sizeof (EMACS_INT).
66 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
67
68 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
69
70 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
71
72 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
73
74 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
75 definition for no-X builds.
76
77 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
78
79 Static checks with GCC 4.6.0 and non-default toolkits.
80
81 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
82
83 * process.c (keyboard_bit_set): Define only if SIGIO.
84 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
85 (send_process): Repair possible setjmp clobbering.
86
87 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
88
89 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
90
91 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
92
93 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
94 Define only if needed.
95
96 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
97 by pacifying GCC about it. Maybe it's time to retire it?
98 * xfaces.c (USG, __TIMEVAL__): Likewise.
99
100 * dispextern.h (struct redisplay_interface): Rename param
101 to avoid shadowing.
102 * termhooks.h (struct terminal): Likewise.
103 * xterm.c (xembed_send_message): Likewise.
104
105 * insdel.c (make_gap_smaller): Define only if
106 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
107
108 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
109 it.
110
111 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
112 so that we aren't warned about unused symbols.
113
114 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
115
116 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
117
118 * xfns.c (x_real_positions): Mark locals as initialized.
119
120 * xmenu.c (xmenu_show): Don't use uninitialized vars.
121
122 * xterm.c: Fix problems found by static analysis with other toolkits.
123 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
124 (x_dispatch_event): Declare static if USE_GTK, and
125 define if USE_GTK || USE_X_TOOLKIT.
126 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
127 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
128 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only if
129 defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
130
131 * xmenu.c (menu_help_callback): Pointer type fixes.
132 Use const pointers when pointing at readonly data. Avoid pointer
133 signedness clashes.
134 (FALSE): Remove unused macro.
135 (update_frame_menubar): Remove unused decl.
136
137 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
138
139 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
140 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
141 (single_menu_item): Rename local to avoid shadowing.
142
143 * keyboard.c (make_lispy_event): Remove unused local var.
144
145 * frame.c, frame.h (x_get_resource_string): Bring this back, but
146 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
147
148 * bitmaps: Change bitmaps from unsigned char back to the X11
149 compatible char. Avoid the old compiler warnings about
150 out-of-range initializers by using, for example, '\xab' rather
151 than 0xab.
152
153 * xgselect.c (xgselect_initialize): Check vs interface
154 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
155
156 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
157
158 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
159 to read-only memory.
160
161 * fns.c (vector): Remove; this old hack is no longer needed.
162
163 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
164 Remove unused var.
165 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
166
167 * xrdb.c (x_load_resources): Omit unused local.
168
169 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
170 (x_window): Rename locals to avoid shadowing.
171 (USG): Use the kludged USG macro, to pacify gcc.
172
173 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
174 (x_term_init): Remove local to avoid shadowing.
175
176 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
177
178 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
179 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
180
181 2011-04-16 Eli Zaretskii <eliz@gnu.org>
182
183 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
184
185 Fix regex.c, syntax.c and friends for buffers > 2GB.
186 * syntax.h (struct gl_state_s): Declare character position members
187 EMACS_INT.
188
189 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
190
191 * textprop.c (verify_interval_modification, interval_of): Declare
192 arguments EMACS_INT.
193
194 * intervals.c (adjust_intervals_for_insertion): Declare arguments
195 EMACS_INT.
196
197 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
198
199 * indent.c (Fvertical_motion): Local variable it_start is now
200 EMACS_INT.
201
202 * regex.c (re_match, re_match_2, re_match_2_internal)
203 (bcmp_translate, regcomp, regexec, print_double_string)
204 (group_in_compile_stack, re_search, re_search_2, regex_compile)
205 (re_compile_pattern, re_exec): Declare arguments and local
206 variables `size_t' and `ssize_t' and return values `regoff_t', as
207 appropriate.
208 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
209 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
210 <compile_stack_type>: `size' and `avail' are now `size_t'.
211
212 * regex.h <regoff_t>: Use ssize_t, not int.
213 (re_search, re_search_2, re_match, re_match_2): Arguments that
214 specify buffer/string position and length are now ssize_t and
215 size_t. Return type is regoff_t.
216
217 2011-04-16 Ben Key <bkey76@gmail.com>
218
219 * nsfont.m: Fixed bugs in ns_get_family and
220 ns_descriptor_to_entity that were caused by using free to
221 deallocate memory blocks that were allocated by xmalloc (via
222 xstrdup). This caused Emacs to crash when compiled with
223 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
224 --enable-checking=xmallocoverrun). xfree is now used to
225 deallocate these memory blocks.
226
227 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
228
229 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
230
231 emacs_write: Accept and return EMACS_INT for sizes.
232 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
233 et seq.
234 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
235 Accept and return EMACS_INT.
236 (emacs_gnutls_write): Return the number of bytes written on
237 partial writes.
238 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
239 (emacs_read, emacs_write): Remove check for negative size, as the
240 Emacs source code has been audited now.
241 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
242 (emacs_read, emacs_write): Use it.
243 * process.c (send_process): Adjust to the new signatures of
244 emacs_write and emacs_gnutls_write. Do not attempt to store
245 a byte offset into an 'int'; it might overflow.
246 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
247
248 * sound.c: Don't assume sizes fit in 'int'.
249 (struct sound_device.period_size, alsa_period_size):
250 Return EMACS_INT, not int.
251 (struct sound_device.write, vox_write, alsa_write):
252 Accept EMACS_INT, not int.
253 (wav_play, au_play): Use EMACS_INT to store sizes and to
254 record read return values.
255
256 2011-04-15 Ben Key <bkey76@gmail.com>
257
258 * keyboard.c (Qundefined): Don't declare static since it is used
259 in nsfns.m.
260 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
261 static since they are used in nsfont.m.
262
263 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
264
265 * process.c (Qprocessp): Don't declare static.
266 * lisp.h (Qprocessp): Declare again.
267
268 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
269
270 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
271
272 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
273
274 Improve C-level modularity by making more things 'static'.
275
276 Don't publish debugger-only interfaces to other modules.
277 * lisp.h (safe_debug_print, debug_output_compilation_hack):
278 (verify_bytepos, count_markers): Move decls to the only modules
279 that need them.
280 * region-cache.h (pp_cache): Likewise.
281 * window.h (check_all_windows): Likewise.
282 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
283
284 * sysdep.c (croak): Now static, if
285 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
286 * syssignal.h (croak): Declare only if not static.
287
288 * alloc.c (refill_memory_reserve): Now static if
289 !defined REL_ALLOC || defined SYSTEM_MALLOC.
290 * lisp.h (refill_memory_reserve): Declare only if not static.
291
292 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
293 Define only if USE_LUCID.
294
295 * xrdb.c (x_customization_string, x_rm_string): Now static.
296
297 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
298 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
299
300 * xdisp.c (draw_row_with_mouse_face): Now static.
301 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
302
303 * window.h (check_all_windows): Mark externally visible.
304
305 * window.c (window_deletion_count): Now static.
306
307 * undo.c: Make symbols static if they're not exported.
308 (last_undo_buffer, last_boundary_position, pending_boundary):
309 Now static.
310
311 * textprop.c (interval_insert_behind_hooks): Now static.
312 (interval_insert_in_front_hooks): Likewise.
313
314 * term.c: Make symbols static if they're not exported.
315 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
316 (max_frame_lines, tty_set_terminal_modes):
317 (tty_reset_terminal_modes, tty_turn_off_highlight):
318 (get_tty_terminal): Now static.
319 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
320 * termhooks.h (term_mouse_moveto): Do not declare if
321 HAVE_WINDOW_SYSTEM.
322 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
323 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
324
325 * sysdep.c: Make symbols static if they're not exported.
326 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
327 Now static.
328 (sigprocmask_set, full_mask): Remove; unused.
329 (wait_debugging): Mark as visible.
330 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
331 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
332
333 * syntax.c (syntax_temp): Define only if !__GNUC__.
334
335 * sound.c (current_sound_device, current_sound): Now static.
336
337 * search.c (searchbufs, searchbuf_head): Now static.
338
339 * scroll.c (scroll_cost): Remove; unused.
340 * dispextern.h (scroll_cost): Remove decl.
341
342 * region-cache.h (pp_cache): Mark as externally visible.
343
344 * process.c: Make symbols static if they're not exported.
345 (process_tick, update_tick, create_process, chan_process):
346 (Vprocess_alist, proc_buffered_char, datagram_access):
347 (fd_callback_data, send_process_frame, process_sent_to): Now static.
348 (deactivate_process): Mark defn as static, as well as decl.
349 * lisp.h (create_process): Remove decl.
350 * process.h (chan_process, Vprocess_alist): Remove decls.
351
352 * print.c: Make symbols static if they're not exported.
353 (print_depth, new_backquote_output, being_printed, print_buffer):
354 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
355 (print_interval, print_number_index, initial_stderr_stream):
356 Now static.
357 * lisp.h (Fprinc): Remove decl.
358 (debug_output_compilation_hack): Mark as externally visible.
359
360 * sysdep.c (croak): Move decl from here to syssignal.h.
361 * syssignal.h (croak): Put it here, so the API can be checked when
362 'croak' is called from dissociate_if_controlling_tty.
363
364 * minibuf.c: Make symbols static if they're not exported.
365 (minibuf_save_list, choose_minibuf_frame): Now static.
366 * lisp.h (choose_minibuf_frame): Remove decl.
367
368 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
369
370 * lread.c: Make symbols static if they're not exported.
371 (read_objects, initial_obarray, oblookup_last_bucket_number):
372 Now static.
373 (make_symbol): Remove; unused.
374 * lisp.h (initial_obarray, make_symbol): Remove decls.
375
376 * keyboard.c: Make symbols static if they're not exported.
377 (single_kboard, recent_keys_index, total_keys, recent_keys):
378 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
379 (this_single_command_key_start, echoing, last_auto_save):
380 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
381 (command_loop, echo_now, keyboard_init_hook, help_char_p):
382 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
383 (Vlispy_mouse_stem, double_click_count):
384 Now static.
385 (force_auto_save_soon): Define only if SIGDANGER.
386 (ignore_mouse_drag_p): Now static if
387 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
388 (print_help): Remove; unused.
389 (stop_character, last_timer_event): Mark as externally visible.
390 * keyboard.h (ignore_mouse_drag_p): Declare only if
391 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
392 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
393 * lisp.h (echoing): Remove decl.
394 (force_auto_save_soon): Declare only if SIGDANGER.
395 * xdisp.c (redisplay_window): Simplify code, to make it more
396 obvious that ignore_mouse_drag_p is not accessed if !defined
397 USE_GTK && !defined HAVE_NS.
398
399 * intervals.c: Make symbols static if they're not exported.
400 (merge_properties_sticky, merge_interval_right, delete_interval):
401 Now static.
402 * intervals.h (merge_interval_right, delete_interval): Remove decls.
403
404 * insdel.c: Make symbols static if they're not exported.
405 However, leave prepare_to_modify_buffer alone. It's never
406 called from outside this function, but that appears to be a bug.
407 (combine_after_change_list, combine_after_change_buffer):
408 (adjust_after_replace, signal_before_change): Now static.
409 (adjust_after_replace_noundo): Remove; unused.
410 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
411 (signal_before_change): Remove decls.
412
413 * indent.c (val_compute_motion, val_vmotion): Now static.
414
415 * image.c: Make symbols static if they're not exported.
416 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
417 if USE_GTK.
418 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
419 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
420
421 * fringe.c (standard_bitmaps): Now static.
422 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
423
424 * frame.c: Make symbols static if they're not exported.
425 (x_report_frame_params, make_terminal_frame): Now static.
426 (get_frame_param): Now static, unless HAVE_NS.
427 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
428 (x_get_resource_string): Remove; not used.
429 * frame.h (make_terminal_frame, x_report_frame_params):
430 (x_get_resource_string); Remove decls.
431 (x_fullscreen_adjust): Declare only if WINDOWSNT.
432 * lisp.h (get_frame_param): Declare only if HAVE_NS.
433
434 * font.c, fontset.c: Make symbols static if they're not exported.
435 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
436 (FACE_SUITABLE_FOR_CHAR_P): Use it.
437 * font.c (font_close_object): Now static.
438 * font.h (font_close_object): Remove.
439 * fontset.c (FONTSET_OBJLIST): Remove.
440 (free_realized_fontset) #if-0 the body, which does nothing.
441 (face_suitable_for_char_p): #if-0, as it's never called.
442 * fontset.h (face_suitable_for_char_p): Remove decl.
443 * xfaces.c (face_at_string_position): Use
444 FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
445 since 0 is always ASCII.
446
447 * fns.c (weak_hash_tables): Now static.
448
449 * fileio.c: Make symbols static if they're not exported.
450 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
451 (Vwrite_region_annotation_buffers): Now static.
452
453 * eval.c: Make symbols static if they're not exported.
454 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
455 * lisp.h (backtrace_list): Remove decl.
456
457 * emacs.c: Make symbols static if they're not exported.
458 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
459 (fatal_error_code, fatal_error_signal_hook, standard_args):
460 Now static.
461 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
462 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
463 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
464 * lisp.h (fatal_error_signal_hook): Remove decl.
465 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
466
467 * editfns.c: Move a (normally-unused) function to its only use.
468 * editfns.c, lisp.h (get_operating_system_release): Remove.
469 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
470 worth the hassle of breaking this out.
471
472 * xterm.c: Make symbols static if they're not exported.
473 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
474 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
475 (x_destroy_window, x_delete_display):
476 Now static.
477 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
478 (x_mouse_leave): Remove; unused.
479 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
480 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
481 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
482 Remove decls.
483 (x_mouse_leave): Declare only if WINDOWSNT.
484 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
485 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
486 USE_X_TOOLKIT.
487
488 * ftxfont.c: Make symbols static if they're not exported.
489 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
490 HAVE_FREETYPE.
491 * font.h (ftxfont_driver): Likewise.
492
493 * xfns.c: Make symbols static if they're not exported.
494 (x_last_font_name, x_display_info_for_name):
495 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
496 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
497 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
498 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
499 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
500 (last_show_tip_args): Now static.
501 (xic_defaut_fontset, xic_create_fontsetname): Define only if
502 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
503 (x_screen_planes): Remove; unused.
504 * dispextern.h (x_screen_planes): Remove decl.
505
506 * dispnew.c: Make symbols static if they're not exported.
507 * dispextern.h (redraw_garbaged_frames, scrolling):
508 (increment_row_positions): Remove.
509 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
510 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
511 Now static.
512 (redraw_garbaged_frames): Remove; unused.
513
514 * xfaces.c: Make symbols static if they're not exported.
515 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
516 Remove decls.
517 * xterm.h (defined_color): Remove decls.
518 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
519 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
520 (menu_face_changed_default, defined_color, free_realized_face):
521 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
522 (ascii_face_of_lisp_face): Remove; unused.
523
524 * xdisp.c: Make symbols static if they're not exported.
525 * dispextern.h (scratch_glyph_row, window_box_edges):
526 (glyph_to_pixel_coords, set_cursor_from_row):
527 (get_next_display_element, set_iterator_to_next):
528 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
529 (show_mouse_face): Remove decls
530 * frame.h (message_buf_print): Likewise.
531 * lisp.h (pop_message, set_message, check_point_in_composition):
532 Likewise.
533 * xterm.h (set_vertical_scroll_bar): Likewise.
534 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
535 (message_buf_print, scratch_glyph_row, displayed_buffer):
536 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
537 (get_next_display_element, show_mouse_face, window_box_edges):
538 (frame_to_window_pixel_xy, check_point_in_composition):
539 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
540 (glyph_to_pixel_coords): Remove; unused.
541
542 * dired.c (file_name_completion): Now static.
543
544 * dbusbind.c (xd_in_read_queued_messages): Now static.
545
546 * lisp.h (circular_list_error, FOREACH): Remove; unused.
547 * data.c (circular_list_error): Remove.
548
549 * commands.h (last_point_position, last_point_position_buffer):
550 (last_point_position_window): Remove decls.
551 * keyboard.c: Make these variables static.
552
553 * coding.h (coding, code_convert_region, encode_coding_gap): Remove
554 decls.
555 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
556 (iso_code_class, detect_coding, code_convert_region): Now static.
557 (encode_coding_gap): Remove; unused.
558
559 * chartab.c (chartab_chars, chartab_bits): Now static.
560
561 * charset.h (charset_iso_8859_1): Remove decl.
562 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
563 Now static.
564
565 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
566 * ccl.c (Vccl_program_table): Now static.
567 (check_ccl_update): Remove; unused.
568
569 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
570 * category.h: ... from here.
571 * category.c (check_category_table, set_category_set): Now static.
572
573 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
574 * lisp.h: Remove these decls.
575
576 * buffer.c (buffer_count): Remove unused var.
577
578 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
579 so that it's not optimized away.
580 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
581 * dispextern.h (bidi_dump_cached_states): Remove, since it's
582 exported only to the debugger.
583
584 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
585 * atimer.h (run_all_atimers): Removed; not exported.
586
587 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
588 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
589 was inaccessible from Lisp.
590 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
591 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
592
593 alloc.c: Import and export fewer symbols, and remove unused items.
594 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
595 is defined.
596 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
597 it's not optimized away by whole-program optimization.
598 (message_enable_multibyte, free_misc): Remove.
599 (catchlist, handlerlist, mark_backtrace):
600 Declare only if BYTE_MARK_STACK.
601 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
602 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
603 (message_enable_multibyte): Remove decl.
604 (free_misc, interval_free_list, float_block, float_block_index):
605 (n_float_blocks, float_free_list, cons_block, cons_block_index):
606 (cons_free_list, last_marked_index):
607 Now static.
608 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
609 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
610 (mark_backtrace): Define only if BYTE_MARK_STACK.
611 * xdisp.c (message_enable_multibyte): Now static.
612
613 Declare Lisp_Object Q* variables to be 'static' if not exported.
614 This makes it easier for human readers (and static analyzers)
615 to see whether these variables are used from other modules.
616 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
617 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
618 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
619 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
620 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
621 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
622 * xmenu.c, xselect.c:
623 Declare Q* vars static if they are not used in other modules.
624 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
625 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
626 Remove decls of unexported vars.
627 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
628
629 * lisp.h (DEFINE_FUNC): Make sname 'static'.
630
631 Make Emacs functions such as Fatom 'static' by default.
632 This makes it easier for human readers (and static analyzers)
633 to see whether these functions can be called from other modules.
634 DEFUN now defines a static function. To make the function external
635 so that it can be used in other C modules, use the new macro DEFUE.
636 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
637 (Finit_image_library):
638 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
639 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
640 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
641 Remove decls, since these functions are now static.
642 (Funintern, Fget_internal_run_time): New decls, since these functions
643 were already external.
644
645 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
646 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
647 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
648 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
649 * keyboard.c, keymap.c, lread.c:
650 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
651 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
652 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
653 Mark functions with DEFUE instead of DEFUN,
654 if they are used in other modules.
655 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
656 decls for now-static functions.
657 * buffer.h (Fdelete_overlay): Remove decl.
658 * callproc.c (Fgetenv_internal): Mark as internal.
659 * composite.c (Fremove_list_of_text_properties): Remove decl.
660 (Fcomposition_get_gstring): New forward static decl.
661 * composite.h (Fcomposite_get_gstring): Remove decl.
662 * dired.c (Ffile_attributes): New forward static decl.
663 * doc.c (Fdocumntation_property): New forward static decl.
664 * eval.c (Ffetch_bytecode): New forward static decl.
665 (Funintern): Remove extern decl; now in .h file where it belongs.
666 * fileio.c (Fmake_symbolic_link): New forward static decl.
667 * image.c (Finit_image_library): New forward static decl.
668 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
669 * intervals.h (Fprevious_property_change):
670 (Fremove_list_of_text_properties): Remove decls.
671 * keyboard.c (Fthis_command_keys): Remove decl.
672 (Fcommand_execute): New forward static decl.
673 * keymap.c (Flookup_key): New forward static decl.
674 (Fcopy_keymap): Now static.
675 * keymap.h (Flookup_key): Remove decl.
676 * process.c (Fget_process): New forward static decl.
677 (Fprocess_datagram_address): Mark as internal.
678 * syntax.c (Fsyntax_table_p): New forward static decl.
679 (skip_chars): Remove duplicate decl.
680 * textprop.c (Fprevious_property_change): New forward static decl.
681 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
682 Now internal.
683 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
684 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
685
686 * editfns.c (Fformat): Remove unreachable code.
687
688 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
689
690 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
691 change. (Bug#8496)
692
693 2011-04-13 Eli Zaretskii <eliz@gnu.org>
694
695 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
696 when at ZV. (Bug#8487)
697
698 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
699
700 * charset.c (Fclear_charset_maps): Use xfree instead of free.
701 (Bug#8437)
702 * keyboard.c (parse_tool_bar_item): Likewise.
703 * sound.c (sound_cleanup, alsa_close): Likewise.
704 * termcap.c (tgetent): Likewise.
705 * xfns.c (x_default_font_parameter): Likewise.
706 * xsettings.c (read_and_apply_settings): Likewise.
707
708 * alloc.c (overrun_check_malloc, overrun_check_realloc)
709 (overrun_check_free): Protoize.
710
711 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
712
713 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
714 since callers should never pass a negative size.
715 Change the signature to match that of plain 'read' and 'write'; see
716 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
717 * lisp.h: Update prototypes of emacs_write and emacs_read.
718
719 2011-04-11 Eli Zaretskii <eliz@gnu.org>
720
721 * xdisp.c (redisplay_window): Don't try to determine the character
722 position of the scroll margin if the window start point w->startp
723 is outside the buffer's accessible region. (Bug#8468)
724
725 2011-04-10 Eli Zaretskii <eliz@gnu.org>
726
727 Fix write-region and its subroutines for buffers > 2GB.
728 * fileio.c (a_write, e_write): Modify declaration of arguments and
729 local variables to support buffers larger than 2GB.
730 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
731
732 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
733 argument, local variables, and return value.
734
735 * lisp.h: Update prototypes of emacs_write and emacs_read.
736
737 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
738
739 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
740
741 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
742
743 Fix more problems found by GCC 4.6.0's static checks.
744
745 * xdisp.c (vmessage): Use a better test for character truncation.
746
747 * charset.c (load_charset_map): <, not <=, for optimization,
748 and to avoid potential problems with integer overflow.
749 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
750 * casetab.c (set_identity, shuffle): Likewise.
751 * editfns.c (Fformat): Likewise.
752 * syntax.c (skip_chars): Likewise.
753
754 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
755 This also lets GCC 4.6.0 generate slightly better loop code.
756
757 * callint.c (Fcall_interactively): <, not <=, for optimization.
758 (Fcall_interactively): Count the number of arguments produced,
759 not the number of arguments given. This is simpler and lets GCC
760 4.6.0 generate slightly better code.
761
762 * ftfont.c: Distingish more carefully between FcChar8 and char.
763 The previous code passed unsigned char * to a functions like
764 strlen and xstrcasecmp that expect char *, which does not
765 conform to the C standard.
766 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
767 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
768 char * when the C standard requires it.
769
770 * keyboard.c (read_char): Remove unused var.
771
772 * eval.c: Port to Windows vsnprintf (Bug#8435).
773 Include <limits.h>.
774 (SIZE_MAX): Define if the headers do not.
775 (verror): Do not give up if vsnprintf returns a negative count.
776 Instead, grow the buffer. This ports to Windows vsnprintf, which
777 does not conform to C99. Problem reported by Eli Zaretskii.
778 Also, simplify the allocation scheme, by avoiding the need for
779 calling realloc, and removing the ALLOCATED variable.
780
781 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
782
783 Remove invocations of doprnt, as Emacs now uses vsnprintf.
784 But keep the doprint source code for now, as we might revamp it
785 and use it again (Bug#8435).
786 * lisp.h (doprnt): Remove.
787 * Makefile.in (base_obj): Remove doprnt.o.
788 * deps.mk (doprnt.o): Remove.
789
790 error: Print 32- and 64-bit integers portably (Bug#8435).
791 Without this change, on typical 64-bit hosts error ("...%d...", N)
792 was used to print both 32- and 64-bit integers N, which relied on
793 undefined behavior.
794 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
795 New macro.
796 * lisp.h (error, verror): Mark as printf-like functions.
797 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
798 Report overflow in size calculations when allocating printf buffer.
799 Do not truncate output string at its first null byte.
800 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
801 Truncate the output at a character boundary, since vsnprintf does not
802 do that.
803 * charset.c (check_iso_charset_parameter): Convert internal
804 character to string before calling 'error', since %c now has the
805 printf meaning.
806 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
807 overflow when computing char to be passed to 'error'. Do not
808 pass Lisp_Object to 'error'; pass the integer instead.
809 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
810 formatted with plain %d.
811
812 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
813
814 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
815
816 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
817
818 * xterm.c (x_catch_errors): Remove duplicate declaration.
819
820 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
821
822 * xdisp.c, lisp.h (message_nolog): Remove; unused.
823
824 2011-04-10 Jim Meyering <meyering@redhat.com>
825
826 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
827 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
828 return ssize_t not "int", and use size_t as the buffer length.
829 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
830 * gnutls.h: Update declarations.
831 * process.c (read_process_output): Use ssize_t, to match.
832 (send_process): Likewise.
833
834 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
835
836 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
837
838 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
839
840 * ftfont.c (get_adstyle_property, ftfont_pattern_entity): Use
841 unsigned char, to match FcChar8 type definition.
842
843 * xterm.c (handle_one_xevent):
844 * xmenu.c (create_and_show_popup_menu):
845 * xselect.c (x_decline_selection_request)
846 (x_reply_selection_request): Avoid type-punned deref of X events.
847
848 2011-04-09 Eli Zaretskii <eliz@gnu.org>
849
850 Fix some uses of `int' instead of EMACS_INT.
851 * search.c (string_match_1, fast_string_match)
852 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
853 (scan_buffer, find_next_newline_no_quit)
854 (find_before_next_newline, search_command, Freplace_match)
855 (Fmatch_data): Make some `int' variables be EMACS_INT.
856
857 * xdisp.c (display_count_lines): 3rd argument and return value now
858 EMACS_INT. All callers changed.
859 (pint2hrstr): Last argument is now EMACS_INT.
860
861 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
862 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
863 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
864 (decode_coding_utf_16, decode_coding_emacs_mule)
865 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
866 (decode_coding_ccl, decode_coding_charset)
867 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
868 (decode_coding_iso_2022, decode_coding_emacs_mule)
869 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
870 <char_offset, last_offset>: Declare EMACS_INT.
871 (encode_coding_utf_8, encode_coding_utf_16)
872 (encode_coding_emacs_mule, encode_invocation_designation)
873 (encode_designation_at_bol, encode_coding_iso_2022)
874 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
875 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
876 Declare EMACS_INT.
877 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
878 (encode_invocation_designation): Last argument P_NCHARS is now
879 EMACS_INT.
880 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
881 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
882
883 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
884 All users changed.
885
886 * ccl.c (Fccl_execute_on_string): Declare some variables
887 EMACS_INT.
888
889 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
890
891 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
892
893 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
894
895 * process.c (Fformat_network_address): Doc fix.
896
897 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
898
899 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
900
901 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
902
903 * keyboard.c (read_char): Call Lisp function help-form-show,
904 instead of using internal_with_output_to_temp_buffer.
905 (Qhelp_form_show): New var.
906 (syms_of_keyboard): Use DEFSYM macro.
907
908 * print.c (internal_with_output_to_temp_buffer): Function deleted.
909
910 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
911
912 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
913
914 * process.c (Flist_processes): Removed to Lisp.
915 (list_processes_1): Deleted.
916
917 2011-04-06 Eli Zaretskii <eliz@gnu.org>
918
919 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
920
921 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
922
923 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
924
925 Fix more problems found by GCC 4.6.0's static checks.
926
927 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
928
929 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
930
931 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
932
933 * xdisp.c (vmessage): Mark as a printf-like function.
934
935 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
936
937 * sound.c (sound_warning): Don't crash if arg contains a printf format.
938
939 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
940 printf-like functions.
941 (tiff_load): Add casts to remove these marks before passing them
942 to system-supplied API.
943
944 * eval.c (Fsignal): Remove excess argument to 'fatal'.
945
946 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
947 This avoids several warnings with gcc -Wstrict-overflow.
948 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
949 directly, rather than having caller test rule sign. This avoids
950 some unnecessary tests.
951 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
952 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
953 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
954
955 * xfont.c (xfont_text_extents): Remove var that was set but not used.
956 (xfont_open): Avoid unnecessary tests.
957
958 * composite.c (composition_gstring_put_cache): Use unsigned integer.
959
960 * composite.h, composite.c (composition_gstring_put_cache):
961 Use EMACS_INT, not int, for length.
962
963 * composite.h (COMPOSITION_DECODE_REFS): New macro,
964 breaking out part of COMPOSITION_DECODE_RULE.
965 (COMPOSITION_DECODE_RULE): Use it.
966 * composite.c (get_composition_id): Remove unused local vars,
967 by using the new macro.
968
969 * textprop.c (set_text_properties_1): Change while to do-while,
970 since the condition is always true at first.
971
972 * intervals.c (graft_intervals_into_buffer): Mark var as used.
973 (interval_deletion_adjustment): Return unsigned value.
974 All uses changed.
975
976 * process.c (list_processes_1, create_pty, read_process_output):
977 (exec_sentinel): Remove vars that were set but not used.
978 (create_pty): Remove unnecessary "volatile"s.
979 (Fnetwork_interface_info): Avoid possibility of int overflow.
980 (read_process_output): Do adaptive read buffering even if carryover.
981 (read_process_output): Simplify nbytes computation if buffered.
982
983 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
984
985 * syntax.c (scan_words): Remove var that was set but not used.
986 (update_syntax_table): Use unsigned instead of int.
987
988 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
989 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
990 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
991
992 * print.c (print_error_message): Avoid int overflow.
993
994 * font.c (font_list_entities): Redo for clarity,
995 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
996
997 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
998 (font_score): Avoid potential overflow in diff calculation.
999
1000 * fns.c (substring_both): Remove var that is set but not used.
1001 (sxhash): Redo loop for clarity and to avoid wraparound warning.
1002
1003 * eval.c (funcall_lambda): Rename local to avoid shadowing.
1004
1005 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
1006 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
1007 can always succeed if overflow has undefined behavior.
1008
1009 * search.c (boyer_moore, wordify): Remove vars set but not used.
1010 (wordify): Omit three unnecessary tests.
1011
1012 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
1013 All callers changed. This avoids the need for an unused var.
1014
1015 * casefiddle.c (casify_region): Remove var that is set but not used.
1016
1017 * dired.c (file_name_completion): Remove var that is set but not used.
1018
1019 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
1020
1021 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
1022 (Finsert_file_contents): Remove unnecessary code checking fd.
1023
1024 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
1025 Check for integer overflow on size calculations.
1026
1027 * buffer.c (Fprevious_overlay_change): Remove var that is set
1028 but not used.
1029
1030 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
1031 Remove vars that are set but not used.
1032 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
1033 (timer_check_2): Mark vars as initialized.
1034
1035 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
1036
1037 * image.c (lookup_image): Remove var that is set but not used.
1038 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
1039
1040 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
1041 that are set but not used.
1042
1043 * xfns.c (make_invisible_cursor): Don't return garbage
1044 if XCreateBitmapFromData fails (Bug#8410).
1045
1046 * xselect.c (x_get_local_selection, x_handle_property_notify):
1047 Remove vars that are set but not used.
1048
1049 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
1050 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
1051
1052 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
1053 Remove var that is set but not used.
1054 (scroll_bar_windows_size): Now size_t, not int.
1055 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
1056 Check for overflow.
1057
1058 * xfaces.c (realize_named_face): Remove vars that are set but not used.
1059 (map_tty_color) [!defined MSDOS]: Likewise.
1060
1061 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
1062
1063 * coding.c: Remove vars that are set but not used.
1064 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
1065 All callers changed.
1066 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
1067 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
1068 (decode_coding_charset): Remove vars that are set but not used.
1069
1070 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
1071 that is set but not used.
1072
1073 * print.c (print_object): Remove var that is set but not used.
1074
1075 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
1076 The gnulib version avoids calling malloc in the usual case,
1077 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
1078 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
1079 * filelock.c (current_lock_owner): Likewise.
1080 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
1081 * sysdep.c: Include allocator.h, careadlinkat.h.
1082 (emacs_no_realloc_allocator): New static constant.
1083 (emacs_readlink): New function.
1084 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
1085 ../lib/careadlinkat.h.
1086
1087 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
1088
1089 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
1090 first non-nil return value).
1091
1092 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
1093
1094 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
1095 if not defined (Bug#8403).
1096
1097 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
1098
1099 * xdisp.c (display_count_lines): Remove parameter `start',
1100 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
1101 (get_char_face_and_encoding): Remove parameter `multibyte_p',
1102 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
1103 (fill_stretch_glyph_string): Remove parameters `row' and `area',
1104 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
1105 and thereabouts. All callers changed.
1106 (get_per_char_metric): Remove parameter `f', unused since
1107 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
1108
1109 2011-04-02 Jim Meyering <meyering@redhat.com>
1110
1111 do not dereference NULL upon failed strdup
1112 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
1113 (ns_get_family): Likewise.
1114
1115 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
1116
1117 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
1118
1119 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
1120
1121 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
1122 later (Bug#8403).
1123
1124 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
1125
1126 Add lexical binding.
1127
1128 * window.c (Ftemp_output_buffer_show): New fun.
1129 (Fsave_window_excursion):
1130 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
1131
1132 * lread.c (lisp_file_lexically_bound_p): New function.
1133 (Fload): Bind Qlexical_binding.
1134 (readevalloop): Remove `evalfun' arg.
1135 Bind Qinternal_interpreter_environment.
1136 (Feval_buffer): Bind Qlexical_binding.
1137 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
1138 Mark as dynamic.
1139 (syms_of_lread): Declare `lexical-binding'.
1140
1141 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
1142
1143 * keyboard.c (eval_dyn): New fun.
1144 (menu_item_eval_property): Use it.
1145
1146 * image.c (parse_image_spec): Use Ffunctionp.
1147
1148 * fns.c (concat, mapcar1): Accept byte-code-functions.
1149
1150 * eval.c (Fsetq): Handle lexical vars.
1151 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
1152 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
1153 (FletX, Flet): Obey lexical binding.
1154 (Fcommandp): Handle closures.
1155 (Feval): New `lexical' arg.
1156 (eval_sub): New function extracted from Feval. Use it almost
1157 everywhere where Feval was used. Look up vars in lexical env.
1158 Handle closures.
1159 (Ffunctionp): Move from subr.el.
1160 (Ffuncall): Handle closures.
1161 (apply_lambda): Remove `eval_flags'.
1162 (funcall_lambda): Handle closures and new byte-code-functions.
1163 (Fspecial_variable_p): New function.
1164 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
1165 but without exporting it to Lisp.
1166
1167 * doc.c (Fdocumentation, store_function_docstring):
1168 * data.c (Finteractive_form): Handle closures.
1169
1170 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
1171 interactive spec.
1172
1173 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN): New
1174 byte-codes.
1175 (exec_byte_code): New function extracted from Fbyte_code to handle new
1176 calling convention for byte-code-functions. Add new byte-codes.
1177
1178 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
1179
1180 * alloc.c (Fmake_symbol): Init new `declared_special' field.
1181
1182 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
1183
1184 * xdisp.c (redisplay_internal): Fix prototype.
1185
1186 2011-03-31 Eli Zaretskii <eliz@gnu.org>
1187
1188 * xdisp.c (SCROLL_LIMIT): New macro.
1189 (try_scrolling): Use it when setting scroll_limit. Limit
1190 scrolling to 100 screen lines.
1191 (redisplay_window): Even when falling back on "recentering",
1192 position point in the window according to scroll-conservatively,
1193 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
1194
1195 (try_scrolling): When point is above the window, allow searching
1196 as far as scroll_max, or one screenful, to compute vertical
1197 distance from PT to the scroll margin position. This prevents
1198 try_scrolling from unnecessarily failing when
1199 scroll-conservatively is set to a value slightly larger than the
1200 window height. Clean up the case of PT below the margin at bottom
1201 of window: scroll_max can no longer be INT_MAX. When aggressive
1202 scrolling is in use, don't let point enter the opposite scroll
1203 margin as result of the scroll.
1204 (syms_of_xdisp) <scroll-conservatively>: Document the
1205 threshold of 100 lines for never-recentering scrolling.
1206
1207 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
1208
1209 * dispextern.h (move_it_by_lines):
1210 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
1211 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
1212 (message_log_check_duplicate): Remove parameters `prev_bol' and
1213 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
1214 (redisplay_internal): Remove parameter `preserve_echo_area',
1215 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
1216
1217 * indent.c (Fvertical_motion):
1218 * window.c (window_scroll_pixel_based, Frecenter):
1219 Don't pass `need_y_p' to `move_it_by_lines'.
1220
1221 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
1222
1223 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
1224 steal a few bits to be more compact.
1225 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
1226 Remove unneeded casts.
1227
1228 * bytecode.c (Fbyte_code): CAR and CDR can GC.
1229
1230 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
1231
1232 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
1233 binding" message (bug#7967).
1234
1235 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
1236
1237 Fix more problems found by GCC 4.6.0's static checks.
1238
1239 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
1240 Remove unused local var.
1241
1242 * editfns.c (Fmessage_box): Remove unused local var.
1243
1244 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
1245 (note_mode_line_or_margin_highlight, note_mouse_highlight):
1246 Omit unused local vars.
1247 * window.c (shrink_windows): Omit unused local var.
1248 * menu.c (digest_single_submenu): Omit unused local var.
1249 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
1250 Omit unused local var.
1251
1252 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
1253 Don't assume string length fits in int.
1254 (keyremap_step, read_key_sequence): Use size_t for sizes.
1255 (read_key_sequence): Don't check last_real_key_start redundantly.
1256
1257 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
1258 instead of alloca (Bug#8344).
1259
1260 * eval.c (Fbacktrace): Don't assume nargs fits in int.
1261 (Fbacktrace_frame): Don't assume nframes fits in int.
1262
1263 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
1264
1265 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
1266 concerns.
1267
1268 * term.c (produce_glyphless_glyph): Remove unnecessary test.
1269
1270 * cm.c (calccost): Turn while-do into do-while, for clarity.
1271
1272 * keyboard.c (syms_of_keyboard): Use the same style as later
1273 in this function when indexing through an array. This also
1274 works around GCC bug 48267.
1275
1276 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
1277
1278 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
1279
1280 * chartab.c (sub_char_table_ref_and_range): Redo for slight
1281 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
1282
1283 * keyboard.c, keyboard.h (num_input_events): Now size_t.
1284 This avoids undefined behavior on integer overflow, and is a bit
1285 more convenient anyway since it is compared to a size_t variable.
1286
1287 Variadic C functions now count arguments with size_t, not int.
1288 This avoids an unnecessary limitation on 64-bit machines, which
1289 caused (substring ...) to crash on large vectors (Bug#8344).
1290 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
1291 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
1292 All variadic functions and their callers changed accordingly.
1293 (struct gcpro.nvars): Now size_t, not int. All uses changed.
1294 * data.c (arith_driver, float_arith_driver): Likewise.
1295 * editfns.c (general_insert_function): Likewise.
1296 * eval.c (struct backtrace.nargs, interactive_p)
1297 (internal_condition_case_n, run_hook_with_args, apply_lambda)
1298 (funcall_lambda, mark_backtrace): Likewise.
1299 * fns.c (concat): Likewise.
1300 * frame.c (x_set_frame_parameters): Likewise.
1301 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
1302 0 if not found, not -1. All callers changed.
1303
1304 * alloc.c (garbage_collect): Don't assume stack size fits in int.
1305 (stack_copy_size): Now size_t, not int.
1306 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
1307
1308 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
1309
1310 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
1311 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
1312 All callers changed.
1313
1314 * lisp.h (multibyte_char_to_unibyte):
1315 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
1316 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
1317 * character.h (CHAR_TO_BYTE8):
1318 * cmds.c (internal_self_insert):
1319 * editfns.c (general_insert_function):
1320 * keymap.c (push_key_description):
1321 * search.c (Freplace_match):
1322 * xdisp.c (message_dolog, set_message_1): All callers changed.
1323
1324 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1325
1326 * keyboard.c (safe_run_hook_funcall): New function.
1327 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
1328 don't set the hook to nil, but remove the offending function instead.
1329 (Qcommand_hook_internal): Remove, unused.
1330 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
1331 Vcommand_hook_internal.
1332
1333 * eval.c (enum run_hooks_condition): Remove.
1334 (funcall_nil, funcall_not): New functions.
1335 (run_hook_with_args): Call each function through a `funcall' argument.
1336 Remove `cond' argument, now redundant.
1337 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
1338 (Frun_hook_with_args_until_failure): Adjust accordingly.
1339 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
1340
1341 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
1342
1343 * dispextern.h (string_buffer_position): Remove declaration.
1344
1345 * print.c (strout): Remove parameter `multibyte', unused since
1346 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
1347
1348 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
1349 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
1350 All callers changed.
1351
1352 * w32.c (_wsa_errlist): Use braces for struct initializers.
1353
1354 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
1355 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
1356 All callers changed.
1357 (string_buffer_position): Likewise. Also, make static (it's never
1358 used outside xdisp.c).
1359 (cursor_row_p): Remove parameter `w', unused since
1360 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
1361 (decode_mode_spec): Remove parameter `precision', introduced during
1362 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
1363 All callers changed.
1364
1365 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
1366
1367 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
1368
1369 2011-03-27 Anders Lindgren <andlind@gmail.com>
1370
1371 * nsterm.m (ns_menu_bar_is_hidden): New variable.
1372 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
1373 (ns_update_auto_hide_menu_bar): New functions.
1374 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
1375 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
1376 ns_constrain_all_frames.
1377 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
1378 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
1379
1380 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
1381
1382 * nsmenu.m (runDialogAt): Remove argument to timer_check.
1383
1384 2011-03-27 Glenn Morris <rgm@gnu.org>
1385
1386 * syssignal.h: Replace RETSIGTYPE with void.
1387 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
1388 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
1389 Replace SIGTYPE with void everywhere.
1390 * s/usg5-4-common.h (SIGTYPE): Remove definition.
1391 * s/template.h (SIGTYPE): Remove commented out definition.
1392
1393 2011-03-26 Eli Zaretskii <eliz@gnu.org>
1394
1395 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
1396 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
1397
1398 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
1399
1400 * w32.c (read_unc_volume): Use parameter `henum', instead of
1401 global variable `wget_enum_handle'.
1402
1403 * keymap.c (describe_vector): Remove parameters `indices' and
1404 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
1405 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
1406
1407 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
1408
1409 * keyboard.c (timer_check): Remove parameter `do_it_now',
1410 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
1411 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
1412 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
1413
1414 * keyboard.c (read_char):
1415 * w32menu.c (w32_menu_display_help):
1416 * xmenu.c (show_help_event, menu_help_callback):
1417 Adjust calls to `show_help_echo'.
1418
1419 * gtkutil.c (xg_maybe_add_timer):
1420 * keyboard.c (readable_events):
1421 * process.c (wait_reading_process_output):
1422 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
1423
1424 * insdel.c (adjust_markers_gap_motion):
1425 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
1426 (gap_left, gap_right): Don't call it.
1427
1428 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
1429
1430 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
1431 incurred during fontification.
1432
1433 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
1434
1435 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
1436 (DEFVAR_PER_BUFFER): Don't pass it.
1437
1438 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
1439 (scrolling_window): Don't pass it.
1440
1441 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
1442
1443 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
1444
1445 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
1446 and `suffix'.
1447 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
1448 of variables specific to SELinux and computation of `encoded_absname'.
1449
1450 * image.c (XPutPixel): Remove unused variable `height'.
1451
1452 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
1453
1454 * unexw32.c (get_section_info): Remove unused variable `section'.
1455
1456 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
1457 (system_process_attributes): Remove unused variable `sess'.
1458 (sys_read): Remove unused variable `err'.
1459
1460 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
1461 (w32_wnd_proc): Remove unused variable `isdead'.
1462 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
1463 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
1464 (x_create_tip_frame): Remove unused variable `tem'.
1465
1466 * w32inevt.c (w32_console_read_socket):
1467 Remove unused variable `no_events'.
1468
1469 * w32term.c (x_draw_composite_glyph_string_foreground):
1470 Remove unused variable `width'.
1471
1472 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
1473
1474 * w32term.c (x_set_glyph_string_clipping):
1475 Don't pass uninitialized region to CombineRgn.
1476
1477 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
1478
1479 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
1480 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
1481 (Fx_close_connection): Remove unused variable `i'.
1482
1483 * w32font.c (w32font_draw): Return number of glyphs.
1484 (w32font_open_internal): Remove unused variable `i'.
1485 (w32font_driver): Add missing initializer.
1486
1487 * w32menu.c (utf8to16): Remove unused variable `utf16'.
1488 (fill_in_menu): Remove unused variable `items_added'.
1489
1490 * w32term.c (last_mouse_press_frame): Remove static global variable.
1491 (w32_clip_to_row): Remove unused variable `f'.
1492 (x_delete_terminal): Remove unused variable `i'.
1493
1494 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
1495 (NOTHING): Remove unused static global variable.
1496 (uniscribe_check_otf): Remove unused variable `table'.
1497 (uniscribe_font_driver): Add missing initializers.
1498
1499 2011-03-23 Julien Danjou <julien@danjou.info>
1500
1501 * term.c (Fsuspend_tty, Fresume_tty):
1502 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
1503 * window.c (temp_output_buffer_show):
1504 * insdel.c (signal_before_change):
1505 * frame.c (Fhandle_switch_frame):
1506 * fileio.c (Fdo_auto_save):
1507 * emacs.c (Fkill_emacs):
1508 * editfns.c (save_excursion_restore):
1509 * cmds.c (internal_self_insert):
1510 * callint.c (Fcall_interactively):
1511 * buffer.c (Fkill_all_local_variables):
1512 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
1513 Use Frun_hooks.
1514 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
1515 unconditionnaly since it does the check itself.
1516
1517 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
1518
1519 Fix more problems found by GCC 4.5.2's static checks.
1520
1521 * coding.c (encode_coding_raw_text): Avoid unnecessary test
1522 the first time through the loop, since we know p0 < p1 then.
1523 This also avoids a gcc -Wstrict-overflow warning.
1524
1525 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
1526 leading to a memory leak, possible in functions like
1527 load_charset_map_from_file that can allocate an unbounded number
1528 of objects (Bug#8318).
1529
1530 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
1531 that could (at least in theory) be that large.
1532
1533 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
1534 This is less likely to overflow, and avoids undefined behavior if
1535 overflow does occur. All callers changed. Use strtoul to scan
1536 for the unsigned long integer.
1537 (pint2hrstr): Simplify and tune code slightly.
1538 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
1539
1540 * scroll.c (do_scrolling): Work around GCC bug 48228.
1541 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
1542
1543 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
1544 This also avoids a warning with gcc -Wstrict-overflow.
1545 (validate_x_resource_name): Simplify count usage.
1546 This also avoids a warning with gcc -Wstrict-overflow.
1547
1548 * fileio.c (Fcopy_file): Report error if fchown or fchmod
1549 fail (Bug#8306).
1550
1551 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
1552
1553 * process.c (Fmake_network_process): Use socklen_t, not int,
1554 where POSIX says socklen_t is required in portable programs.
1555 This fixes a porting bug on hosts like 64-bit HP-UX, where
1556 socklen_t is wider than int (Bug#8277).
1557 (Fmake_network_process, server_accept_connection):
1558 (wait_reading_process_output, read_process_output):
1559 Likewise.
1560
1561 * process.c: Rename or move locals to avoid shadowing.
1562 (list_processes_1, Fmake_network_process):
1563 (read_process_output_error_handler, exec_sentinel_error_handler):
1564 Rename or move locals.
1565 (Fmake_network_process): Define label "retry_connect" only if needed.
1566 (Fnetwork_interface_info): Fix pointer signedness.
1567 (process_send_signal): Add cast to avoid pointer signedness problem.
1568 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
1569 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
1570
1571 Make tparam.h and terminfo.c consistent.
1572 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
1573 Include tparam.h instead, since it declares them.
1574 * cm.h (PC): Remove extern decl; tparam.h now does this.
1575 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
1576 * terminfo.c: Include tparam.h, to check interfaces.
1577 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
1578 (tparam): Adjust signature to match interface in tparam.h;
1579 this removes some undefined behavior. Check that outstring and len
1580 are zero, which they always are with Emacs.
1581 * tparam.h (PC, BC, UP): New extern decls.
1582
1583 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
1584 (xftfont_open): Rename locals to avoid shadowing.
1585
1586 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
1587 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
1588 (OTF_TAG_SYM): Omit macro if not needed.
1589 (ftfont_list): Remove unused local.
1590 (get_adstyle_property, ftfont_pattern_entity):
1591 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
1592 Rename locals to avoid shadowing.
1593
1594 * xfont.c (xfont_list_family): Mark var as initialized.
1595
1596 * xml.c (make_dom): Now static.
1597
1598 * composite.c (composition_compute_stop_pos): Rename local to
1599 avoid shadowing.
1600 (composition_reseat_it): Remove unused locals.
1601 (find_automatic_composition, composition_adjust_point): Likewise.
1602 (composition_update_it): Mark var as initialized.
1603 (find_automatic_composition): Mark vars as initialized,
1604 with a FIXME (Bug#8290).
1605
1606 character.h: Rename locals to avoid shadowing.
1607 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
1608 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
1609 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
1610 (BUF_DEC_POS): Be more systematic about renaming local temporaries
1611 to avoid shadowing.
1612
1613 * textprop.c (property_change_between_p): Remove; unused.
1614
1615 * intervals.c (interval_start_pos): Now static.
1616
1617 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
1618
1619 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
1620 Rename locals to avoid shadowing.
1621
1622 * sound.c (wav_play, au_play, Fplay_sound_internal):
1623 Fix pointer signedness.
1624 (alsa_choose_format): Remove unused local var.
1625 (wav_play): Initialize a variable to 0, to prevent undefined
1626 behavior (Bug#8278).
1627
1628 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
1629
1630 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
1631
1632 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
1633 clobbering (Bug#8298).
1634 * sysdep.c (sys_subshell): Likewise.
1635 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
1636
1637 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
1638 This should get cleaned up, so that child_setup has the
1639 same signature on all platforms.
1640
1641 * callproc.c (call_process_cleanup): Now static.
1642 (relocate_fd): Rename locals to avoid shadowing.
1643
1644 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
1645
1646 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
1647 not to be necessary, and produces flickering.
1648
1649 2011-03-20 Glenn Morris <rgm@gnu.org>
1650
1651 * config.in: Remove file.
1652
1653 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
1654
1655 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
1656 are now in src/globals.h.
1657 (syms_of_minibuf): Remove spurious & from previous change.
1658
1659 2011-03-20 Leo <sdl.web@gmail.com>
1660
1661 * minibuf.c (completing-read-function): New variable.
1662 (completing-read-default): Rename from completing-read.
1663 (completing-read): Call completing-read-function.
1664
1665 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
1666
1667 * xfaces.c (Fx_load_color_file):
1668 Read color file from absolute filename (bug#8250).
1669
1670 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
1671
1672 * makefile.w32-in: Update dependencies.
1673
1674 2011-03-17 Eli Zaretskii <eliz@gnu.org>
1675
1676 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
1677
1678 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
1679
1680 Fix more problems found by GCC 4.5.2's static checks.
1681
1682 * process.c (make_serial_process_unwind, send_process_trap):
1683 (sigchld_handler): Now static.
1684
1685 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
1686 That way, the code declares only the vars that it needs.
1687 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
1688 * s/cygwin.h (PTY_ITERATION): Likewise.
1689 * s/darwin.h (PTY_ITERATION): Likewise.
1690 * s/gnu-linux.h (PTY_ITERATION): Likewise.
1691
1692 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
1693 * process.c (allocate_pty): Don't declare stb unless it's needed.
1694
1695 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
1696 (CONSTANTLIM): Remove; unused.
1697 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
1698 Define only if needed.
1699
1700 * unexelf.c (unexec): Name an expression,
1701 to avoid gcc -Wbad-function-cast warning.
1702 Use a different way to cause a compilation error if anyone uses
1703 n rather than nn, a way that does not involve shadowing.
1704 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
1705
1706 * deps.mk (unexalpha.o): Remove; unused.
1707
1708 New file unexec.h, the (simple) interface for unexec (Bug#8267).
1709 * unexec.h: New file.
1710 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
1711 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
1712 Depend on unexec.h.
1713 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
1714 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
1715 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
1716 Change as necessary to match prototype in unexec.h.
1717
1718 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
1719 shadowing.
1720 (back_comment, skip_chars): Mark vars as initialized.
1721
1722 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
1723 Rename locals to avoid shadowing.
1724
1725 * lread.c (read1): Rewrite so as not to use empty "else".
1726 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
1727
1728 * print.c (Fredirect_debugging_output): Fix pointer signedess.
1729
1730 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
1731 warning when compiling print.c.
1732
1733 * font.c (font_unparse_fcname): Abort in an "impossible" situation
1734 instead of using an uninitialized var.
1735 (font_sort_entities): Mark var as initialized.
1736
1737 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
1738
1739 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
1740 pointers to constants.
1741 (font_parse_fcname): Remove unused vars.
1742 (font_delete_unmatched): Now static.
1743 (font_get_spec): Remove; unused.
1744 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
1745 (font_update_drivers, Ffont_get_glyphs, font_add_log):
1746 Rename or move locals to avoid shadowing.
1747
1748 * fns.c (require_nesting_list, require_unwind): Now static.
1749 (Ffillarray): Rename locals to avoid shadowing.
1750
1751 * floatfns.c (domain_error2): Define only if needed.
1752 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1753
1754 * alloc.c (mark_backtrace): Move decl from here ...
1755 * lisp.h: ... to here, so that it can be checked.
1756
1757 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
1758 (Fdefvar): Rewrite so as not to use empty "else".
1759 (lisp_indirect_variable): Name an expression,
1760 to avoid gcc -Wbad-function-cast warning.
1761 (Fdefvar): Rename locals to avoid shadowing.
1762
1763 * callint.c (quotify_arg, quotify_args): Now static.
1764 (Fcall_interactively): Rename locals to avoid shadowing.
1765 Use const pointer when appropriate.
1766
1767 * lisp.h (get_system_name, get_operating_system_release):
1768 Move decls here, to check interfaces.
1769 * process.c (get_operating_system_release): Move decl to lisp.h.
1770 * xrdb.c (get_system_name): Likewise.
1771 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
1772 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
1773 some of which prompt warnings from gcc -Wbad-function-cast.
1774 (Fformat_time_string, Fencode_time, Finsert_char):
1775 (Ftranslate_region_internal, Fformat):
1776 Rename or remove local vars to avoid shadowing.
1777 (Ftranslate_region_internal): Mark var as initialized.
1778
1779 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
1780 avoid shadowing.
1781
1782 * lisp.h (eassert): Check that the argument compiles, even if
1783 ENABLE_CHECKING is not defined.
1784
1785 * data.c (Findirect_variable): Name an expression, to avoid
1786 gcc -Wbad-function-cast warning.
1787 (default_value, arithcompare, arith_driver, arith_error): Now static.
1788 (store_symval_forwarding): Rename local to avoid shadowing.
1789 (Fmake_variable_buffer_local, Fmake_local_variable):
1790 Mark variables as initialized.
1791 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
1792
1793 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
1794 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
1795 Rename locals to avoid shadowing.
1796 (mark_stack): Move local variables into the #ifdef region where
1797 they're used.
1798 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
1799 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
1800 needed otherwise.
1801 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
1802 (GC_STRING_CHARS): Remove; not used.
1803 (Fmemory_limit): Cast sbrk's returned value to char *.
1804
1805 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
1806 avoids undefined behavior in theory.
1807
1808 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
1809
1810 Use functions, not macros, for up- and down-casing (Bug#8254).
1811 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
1812 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
1813 to use the following functions instead of these macros.
1814 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
1815 EMACS_INT, since callers assume the returned value fits in int.
1816 (upcase1): Likewise, for UPCASE_TABLE.
1817 (uppercasep, lowercasep, upcase): New static inline functions.
1818 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
1819 the race-condition problem in the old DOWNCASE.
1820
1821 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
1822 Rename locals to avoid shadowing.
1823 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
1824 (regex_compile, re_search_2, re_match_2_internal):
1825 Remove unused local vars.
1826 (FREE_VAR): Rewrite so as not to use empty "else",
1827 which gcc can warn about.
1828 (regex_compile, re_match_2_internal): Mark locals as initialized.
1829 (RETALLOC_IF): Define only if needed.
1830 (WORDCHAR_P): Likewise. This one is never needed, but is used
1831 only in a comment talking about a compiler bug, so put inside
1832 the #if 0 of that comment.
1833 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
1834 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
1835 Remove; unused.
1836
1837 * search.c (boyer_moore): Rename locals to avoid shadowing.
1838 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
1839 (PREV_CHAR_BOUNDARY): Likewise.
1840
1841 * search.c (simple_search): Remove unused var.
1842
1843 * dired.c (compile_pattern): Move decl from here ...
1844 * lisp.h: ... to here, so that it can be checked.
1845 (struct re_registers): New forward decl.
1846
1847 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
1848
1849 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
1850 All uses changed.
1851 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
1852 Rename locals to avoid shadowing.
1853 (Fvertical_motion): Mark locals as initialized.
1854
1855 * casefiddle.c (casify_object, casify_region): Now static.
1856 (casify_region): Mark local as initialized.
1857
1858 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
1859
1860 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
1861 New macros, so that the caller can use some names other than
1862 gcpro1, gcpro2, etc.
1863 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
1864 of the new macros.
1865 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
1866 argument, for consistency with GCPRO2_VAR, etc: it is now the
1867 prefix of the variable, not the variable itself. All uses
1868 changed.
1869 * dired.c (directory_files_internal, file_name_completion):
1870 Rename locals to avoid shadowing.
1871
1872 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
1873 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
1874 dired.c's scmp function, had undefined behavior.
1875 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
1876 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
1877 * buffer.h: ... to here, because these macros use current_buffer,
1878 and the new implementation with inline functions needs to have
1879 current_buffer in scope now, rather than later when the macros
1880 are used.
1881 (downcase, upcase1): New static inline functions.
1882 (DOWNCASE, UPCASE1): Reimplement using these functions.
1883 This avoids undefined behavior in expressions like
1884 DOWNCASE (x) == DOWNCASE (y), which previously suffered
1885 from race conditions in accessing the global variables
1886 case_temp1 and case_temp2.
1887 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
1888 * lisp.h (case_temp1, case_temp2): Remove their decls.
1889 * character.h (ASCII_CHAR_P): Move from here ...
1890 * lisp.h: ... to here, so that the inline functions mentioned
1891 above can use them.
1892
1893 * dired.c (directory_files_internal_unwind): Now static.
1894
1895 * fileio.c (file_name_as_directory, directory_file_name):
1896 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
1897 Now static.
1898 (file_name_as_directory): Use const pointers when appropriate.
1899 (Fexpand_file_name): Likewise. In particular, newdir might
1900 point at constant storage, so make it a const pointer.
1901 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
1902 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
1903 signedness issues.
1904 (Fset_file_times, Finsert_file_contents, auto_save_error):
1905 Rename locals to avoid shadowing.
1906
1907 * minibuf.c (choose_minibuf_frame_1): Now static.
1908 (Ftry_completion, Fall_completions): Rename or remove locals
1909 to avoid shadowing.
1910
1911 * marker.c (bytepos_to_charpos): Remove; unused.
1912
1913 * lisp.h (verify_bytepos, count_markers): New decls,
1914 so that gcc does not warn that these functions aren't declared.
1915
1916 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
1917 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
1918 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
1919 (copy_text): Remove unused local var.
1920
1921 * filelock.c (within_one_second): Now static.
1922 (lock_file_1): Rename local to avoid shadowing.
1923
1924 * buffer.c (fix_overlays_before): Mark locals as initialized.
1925 (fix_start_end_in_overlays): Likewise. This function should be
1926 simplified by using pointers-to-pointers, but that's a different
1927 matter.
1928 (switch_to_buffer_1): Now static.
1929 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
1930 (report_overlay_modification): Rename locals to avoid shadowing.
1931
1932 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
1933 Fix pointer signedness issue.
1934 (sys_subshell): Mark local as volatile if checking for lint,
1935 to suppress a gcc -Wclobbered warning that does not seem to be right.
1936 (MAXPATHLEN): Define only if needed.
1937
1938 * process.c (serial_open, serial_configure): Move decls from here ...
1939 * systty.h: ... to here, so that they can be checked.
1940
1941 * fns.c (get_random, seed_random): Move extern decls from here ...
1942 * lisp.h: ... to here, so that they can be checked.
1943
1944 * sysdep.c (reset_io): Now static.
1945 (wait_for_termination_signal): Remove; unused.
1946
1947 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
1948 (copy_keymap_item, append_key, push_text_char_description):
1949 Now static.
1950 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
1951 (DENSE_TABLE_SIZE): Remove; unused.
1952 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
1953 (describe_map_tree):
1954 Rename locals to avoid shadowing.
1955
1956 * keyboard.c: Declare functions static if they are not used elsewhere.
1957 (echo_char, echo_dash, cmd_error, top_level_2):
1958 (poll_for_input, handle_async_input): Now static.
1959 (read_char, kbd_buffer_get_event, make_lispy_position):
1960 (make_lispy_event, make_lispy_movement, apply_modifiers):
1961 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
1962 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
1963 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
1964 (read_key_sequence, read_char): Mark locals as initialized.
1965 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
1966
1967 * keyboard.h (make_ctrl_char): New decl.
1968 (mark_kboards): Move decl here ...
1969 * alloc.c (mark_kboards): ... from here.
1970
1971 * lisp.h (force_auto_save_soon): New decl.
1972
1973 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
1974 (DEFINE_DUMMY_FUNCTION): New macro.
1975 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
1976 Use it.
1977 (main): Add casts to avoid warnings
1978 if GCC considers string literals to be constants.
1979
1980 * lisp.h (fatal_error_signal): Add decl, since it's exported.
1981
1982 * dbusbind.c: Pointer signedness fixes.
1983 (xd_signature, xd_append_arg, xd_initialize):
1984 (Fdbus_call_method, Fdbus_call_method_asynchronously):
1985 (Fdbus_method_return_internal, Fdbus_method_error_internal):
1986 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
1987 (Fdbus_register_signal): Use SSDATA when the context wants char *.
1988
1989 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
1990 if GCC considers string literals to be constants.
1991 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
1992
1993 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
1994
1995 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
1996 (print_preprocess, print_object): New macro to fix last change.
1997
1998 * print.c (print_preprocess): Don't forget font objects.
1999
2000 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
2001
2002 * emacs.c (USAGE3): Doc fixes.
2003
2004 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
2005
2006 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
2007 structure.
2008
2009 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
2010
2011 * lisp.h (VWindow_system, Qfile_name_history):
2012 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
2013 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
2014 (w32_system_caret_x, w32_system_caret_y): Declare extern.
2015
2016 * w32select.c: Don't #include "keyboard.h".
2017 (run_protected): Add extern declaration for waiting_for_input.
2018
2019 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
2020 * w32console.c (detect_input_pending, read_input_pending)
2021 (encode_terminal_code):
2022 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
2023 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
2024 (w32_system_caret_y, Qfile_name_history):
2025 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
2026 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
2027 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
2028 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
2029 * w32proc.c (Qlocal, report_file_error):
2030 * w32term.c (Vwindow_system, updating_frame):
2031 * w32uniscribe.c (initialized, uniscribe_font_driver):
2032 Remove unneeded extern declarations.
2033
2034 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
2035
2036 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2037
2038 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
2039
2040 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
2041 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
2042 These macros can no longer be used for assignment.
2043
2044 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2045 Assign struct members directly, instead of using BUF_BEGV etc.
2046 (record_buffer_markers, fetch_buffer_markers): New functions for
2047 recording and fetching special buffer markers.
2048 (set_buffer_internal_1, set_buffer_temp): Use them.
2049
2050 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
2051
2052 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
2053
2054 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
2055 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
2056
2057 * xdisp.c (hscroll_window_tree):
2058 (reconsider_clip_changes): Use PT instead of BUF_PT.
2059
2060 2011-03-13 Eli Zaretskii <eliz@gnu.org>
2061
2062 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
2063 $(EMACS_ROOT)/lib/intprops.h.
2064
2065 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
2066
2067 Fix more problems found by GCC 4.5.2's static checks.
2068
2069 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
2070 to unsigned char * to avoid compiler diagnostic.
2071 (xg_free_frame_widgets): Make it clear that a local variable is
2072 needed only if USE_GTK_TOOLTIP.
2073 (gdk_window_get_screen): Make it clear that this macro is needed
2074 only if USE_GTK_TOOLTIP.
2075 (int_gtk_range_get_value): New function, which avoids a diagnostic
2076 from gcc -Wbad-function-cast.
2077 (xg_set_toolkit_scroll_bar_thumb): Use it.
2078 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
2079 diagnostic from gcc -Wbad-function-cast.
2080 (get_utf8_string, xg_get_file_with_chooser):
2081 Rename locals to avoid shadowing.
2082 (create_dialog): Move locals to avoid shadowing.
2083
2084 * xgselect.c (xg_select): Remove unused var.
2085
2086 * image.c (four_corners_best): Mark locals as initialized.
2087 (gif_load): Initialize transparent_p to zero (Bug#8238).
2088 Mark another local as initialized.
2089 (my_png_error, my_error_exit): Mark with NO_RETURN.
2090
2091 * image.c (clear_image_cache): Now static.
2092 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
2093 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
2094 (x_edge_detection): Remove unnecessary cast that
2095 gcc -Wbad-function-cast diagnoses.
2096 (gif_load): Fix pointer signedness.
2097 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
2098 (jpeg_load, gif_load): Rename locals to avoid shadowing.
2099
2100 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
2101
2102 Improve quality of tests for time stamp overflow.
2103 For example, without this patch (encode-time 0 0 0 1 1
2104 1152921504606846976) returns the obviously-bogus value (-948597
2105 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
2106 reports time overflow. See
2107 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
2108 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
2109 * editfns.c: Include limits.h and intprops.h.
2110 (TIME_T_MIN, TIME_T_MAX): New macros.
2111 (time_overflow): Move earlier, to before first use.
2112 (hi_time, lo_time): New functions, for an accurate test for
2113 out-of-range times.
2114 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
2115 (Fget_internal_run_time): Don't assume time_t fits in int.
2116 (make_time): Use list2 instead of Fcons twice.
2117 (Fdecode_time): More accurate test for out-of-range times.
2118 (check_tm_member): New function.
2119 (Fencode_time): Use it, to test for out-of-range times.
2120 (lisp_time_argument): Don't rely on undefined left-shift and
2121 right-shift behavior when checking for time stamp overflow.
2122
2123 * editfns.c (time_overflow): New function, refactoring common code.
2124 (Fformat_time_string, Fdecode_time, Fencode_time):
2125 (Fcurrent_time_string): Use it.
2126
2127 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
2128 * dired.c (make_time): Move to ...
2129 * editfns.c (make_time): ... here.
2130 * systime.h: Note the move.
2131
2132 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2133
2134 * fringe.c (update_window_fringes): Remove unused variables.
2135
2136 * unexmacosx.c (copy_data_segment): Also copy __got section.
2137 (Bug#8223)
2138
2139 2011-03-12 Eli Zaretskii <eliz@gnu.org>
2140
2141 * termcap.c [MSDOS]: Include "msdos.h".
2142 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
2143 Constify `char *' arguments and their references according to
2144 prototypes in tparam.h.
2145
2146 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
2147
2148 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
2149 Adapt all references accordingly.
2150
2151 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
2152
2153 2011-03-11 Tom Tromey <tromey@redhat.com>
2154
2155 * buffer.c (syms_of_buffer): Remove obsolete comment.
2156
2157 2011-03-11 Eli Zaretskii <eliz@gnu.org>
2158
2159 * termhooks.h (encode_terminal_code): Declare prototype.
2160
2161 * msdos.c (encode_terminal_code): Don't declare prototype.
2162
2163 * term.c (encode_terminal_code): Now external again, used by
2164 w32console.c and msdos.c.
2165
2166 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
2167 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
2168
2169 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
2170
2171 Fix some minor problems found by GCC 4.5.2's static checks.
2172
2173 * fringe.c (update_window_fringes): Mark locals as initialized
2174 (Bug#8227).
2175 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
2176
2177 * alloc.c (mark_fringe_data): Move decl from here ...
2178 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
2179 to check its interface.
2180 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
2181
2182 * fontset.c (free_realized_fontset): Now static.
2183 (Fset_fontset_font): Rename local to avoid shadowing.
2184 (fontset_font): Mark local as initialized.
2185 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
2186
2187 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
2188
2189 * xselect.c (x_disown_buffer_selections): Remove; not used.
2190 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
2191 (x_own_selection, Fx_disown_selection_internal): Rename locals
2192 to avoid shadowing.
2193 (x_handle_dnd_message): Remove local to avoid shadowing.
2194
2195 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
2196 so that the caller can use some name other than gcpro1.
2197 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
2198 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
2199 (Fx_backspace_delete_keys_p):
2200 Use them to avoid shadowing, and rename vars to avoid shadowing.
2201 (x_decode_color, x_set_name, x_window): Now static.
2202 (Fx_create_frame): Add braces to silence GCC warning.
2203 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
2204 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
2205 Remove unused locals.
2206 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
2207 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
2208 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
2209 macros.
2210
2211 * xterm.h (x_mouse_leave): New decl.
2212
2213 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
2214 Remove unused functions.
2215 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
2216 (x_calc_absolute_position): Now static.
2217 (XTread_socket): Don't define label "out" unless it's used.
2218 Don't declare local "event" unless it's used.
2219 (x_iconify_frame, x_free_frame_resources): Don't declare locals
2220 unless they are used.
2221 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
2222 (x_fatal_error_signal): Remove; not used.
2223 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
2224 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
2225 (x_error_catcher, x_connection_closed, x_error_handler):
2226 (x_error_quitter, xembed_send_message, x_iconify_frame):
2227 (my_log_handler): Rename locals to avoid shadowing.
2228 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2229 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
2230
2231 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
2232 Rename or move locals to avoid shadowing.
2233 (tty_defined_color, merge_face_heights): Now static.
2234 (free_realized_faces_for_fontset): Remove; not used.
2235 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
2236 does not deduce is never used uninitialized.
2237 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
2238 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
2239
2240 * terminal.c (store_terminal_param): Now static.
2241
2242 * xmenu.c (menu_highlight_callback): Now static.
2243 (set_frame_menubar): Remove unused local.
2244 (xmenu_show): Rename parameter to avoid shadowing.
2245 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
2246 since they might point to immutable storage.
2247 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
2248 since it's unused otherwise.
2249
2250 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
2251 Add a FIXME, since the code still doesn't look right. (Bug#8215)
2252 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
2253 avoids a gcc -Wuninitialized diagnostic.
2254 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
2255 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
2256 does not deduce are never used uninitialized.
2257
2258 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
2259
2260 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
2261 * window.c (window_loop, size_window):
2262 (run_window_configuration_change_hook, enlarge_window): Likewise.
2263
2264 * window.c (display_buffer): Now static.
2265 (size_window): Mark variables that gcc -Wuninitialized
2266 does not deduce are never used uninitialized.
2267 * window.h (check_all_windows): New decl, to forestall
2268 gcc -Wmissing-prototypes diagnostic.
2269 * dispextern.h (bidi_dump_cached_states): Likewise.
2270
2271 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
2272 shadowing.
2273 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
2274 Include <limits.h>.
2275 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
2276 and to avoid gcc -Wuninitialized warning.
2277 (load_charset_map): Mark variables that gcc -Wuninitialized
2278 does not deduce are never used uninitialized.
2279 (load_charset): Abort instead of using uninitialized var (Bug#8229).
2280
2281 * coding.c (coding_set_source, coding_set_destination):
2282 Use "else { /* comment */ }" rather than "else /* comment */;"
2283 for clarity, and to avoid gcc -Wempty-body warning.
2284 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
2285 a block, when the outer 'i' will do.
2286 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
2287 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
2288 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
2289 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
2290 (Fdecode_sjis_char, Fdefine_coding_system_internal):
2291 Rename locals to avoid shadowing.
2292 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
2293 * coding.c (emacs_mule_char, encode_invocation_designation):
2294 Now static, since they're not used elsewhere.
2295 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
2296 (decode_coding_object, encode_coding_object, detect_coding_system):
2297 (decode_coding_emacs_mule): Mark variables that gcc
2298 -Wuninitialized does not deduce are never used uninitialized.
2299 (detect_coding_iso_2022): Initialize a local variable that might
2300 be used uninitialized. Leave a FIXME because it's not clear that
2301 this initialization is needed. (Bug#8211)
2302 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
2303 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
2304 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
2305 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
2306 Remove unused macros.
2307
2308 * category.c (hash_get_category_set): Remove unused local var.
2309 (copy_category_table): Now static, since it's not used elsewhere.
2310 * character.c (string_count_byte8): Likewise.
2311
2312 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
2313 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
2314
2315 * chartab.c (copy_sub_char_table): Now static, since it's not used
2316 elsewhere.
2317 (sub_char_table_ref_and_range, char_table_ref_and_range):
2318 Rename locals to avoid shadowing.
2319 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
2320
2321 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
2322 (BIDI_BOB): Remove unused macro.
2323
2324 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
2325 deduce are never used uninitialized.
2326 * term.c (encode_terminal_code): Likewise.
2327
2328 * term.c (encode_terminal_code): Now static. Remove unused local.
2329
2330 * tparam.h: New file.
2331 * term.c, tparam.h: Include it.
2332 * deps.mk (term.o, tparam.o): Depend on tparam.h.
2333 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
2334 Move these decls to tparam.h, and make them agree with what
2335 is actually in tparam.c. The previous trick of using incompatible
2336 decls in different modules does not conform to the C standard.
2337 All callers of tparam changed to use tparam's actual API.
2338 * tparam.c (tparam1, tparam, tgoto):
2339 Use const pointers where appropriate.
2340
2341 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
2342 * cm.h (struct cm): Likewise.
2343 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
2344 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
2345 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
2346 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
2347 (turn_on_face, init_tty): Likewise.
2348 * termchar.h (struct tty_display_info): Likewise.
2349
2350 * term.c (term_mouse_position): Rename local to avoid shadowing.
2351
2352 * alloc.c (mark_ttys): Move decl from here ...
2353 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
2354
2355 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
2356
2357 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
2358
2359 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
2360
2361 * search.c (compile_pattern_1): Remove argument regp, unused since
2362 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
2363 (compile_pattern): Don't pass it.
2364
2365 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
2366
2367 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
2368 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
2369 for ! HAVE_GTK3.
2370 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
2371
2372 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
2373
2374 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
2375 gdk_window_get_screen, gdk_window_get_geometry,
2376 gdk_x11_window_lookup_for_display and GDK_KEY_g.
2377 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
2378 (xg_get_pixbuf_from_pixmap): New function.
2379 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
2380 to Pixmap, take frame as parameter, remove GdkColormap parameter.
2381 Call xg_get_pixbuf_from_pixmap instead of
2382 gdk_pixbuf_get_from_drawable.
2383 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
2384 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
2385 (xg_check_special_colors): Use GtkStyleContext and its functions
2386 for HAVE_GTK3.
2387 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
2388 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
2389 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
2390 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
2391 Call gtk_widget_get_preferred_size.
2392 (xg_frame_resized): gdk_window_get_geometry only takes 5
2393 parameters.
2394 (xg_win_to_widget, xg_event_is_for_menubar):
2395 Call gdk_x11_window_lookup_for_display.
2396 (xg_set_widget_bg): New function.
2397 (delete_cb): New function.
2398 (xg_create_frame_widgets): connect delete-event to delete_cb.
2399 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
2400 (xg_set_background_color): Call xg_set_widget_bg.
2401 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
2402 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
2403 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
2404 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
2405 if ! HAVE_GTK3.
2406 (update_frame_tool_bar): Call gtk_widget_hide.
2407 (xg_initialize): Use GDK_KEY_g.
2408
2409 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
2410 if ! HAVE_GTK3
2411 (x_session_initialize): Call gdk_x11_set_sm_client_id.
2412
2413 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
2414 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
2415 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
2416
2417 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
2418
2419 * w32xfns.c (select_palette): Check success of RealizePalette against
2420 GDI_ERROR, not zero.
2421
2422 See ChangeLog.11 for earlier changes.
2423
2424 ;; Local Variables:
2425 ;; coding: utf-8
2426 ;; End:
2427
2428 Copyright (C) 2011 Free Software Foundation, Inc.
2429
2430 This file is part of GNU Emacs.
2431
2432 GNU Emacs is free software: you can redistribute it and/or modify
2433 it under the terms of the GNU General Public License as published by
2434 the Free Software Foundation, either version 3 of the License, or
2435 (at your option) any later version.
2436
2437 GNU Emacs is distributed in the hope that it will be useful,
2438 but WITHOUT ANY WARRANTY; without even the implied warranty of
2439 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2440 GNU General Public License for more details.
2441
2442 You should have received a copy of the GNU General Public License
2443 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.