- 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
++2011-06-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
+ not to EMACS_INT, to avoid GCC warning.
+
+ * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
+
+ * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
+ The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
+ isn't needed on 32-bit machines.
+
+ * buffer.c (Fgenerate_new_buffer_name): Use EMACS_INT for count, not int.
+ (advance_to_char_boundary): Return EMACS_INT, not int.
+
+ * data.c (Qcompiled_function): Now static.
+
+ * window.c (window_body_lines): Now static.
+
+ * image.c (gif_load): Rename local to avoid shadowing.
+
+ * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
+ (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
+ * alloc.c (make_save_value): Integer argument is now of type
+ ptrdiff_t, not int.
+ (mark_object): Use ptrdiff_t, not int.
+ * lisp.h (pD): New macro.
+ * print.c (print_object): Use it.
+
+ * alloc.c: Use EMACS_INT, not int, to count objects.
+ (total_conses, total_markers, total_symbols, total_vector_size)
+ (total_free_conses, total_free_markers, total_free_symbols)
+ (total_free_floats, total_floats, total_free_intervals, total_intervals)
+ (total_strings, total_free_strings):
+ Now EMACS_INT, not int. All uses changed.
+ (Fgarbage_collect): Compute overall total using a double, so that
+ integer overflow is less likely to be a problem. Check for overflow
+ when converting back to an integer.
+ (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
+ (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
+ These were 'int' variables that could overflow on 64-bit hosts;
+ they were never used, so remove them instead of repairing them.
+ (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
+ (inhibit_garbage_collection): Set gc_cons_threshold to max value.
+ Previously, this ceilinged at INT_MAX, but that doesn't work on
+ 64-bit machines.
+ (allocate_pseudovector): Don't use EMACS_INT when int would do.
+
+ * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
+ (allocate_vectorlike): Check for ptrdiff_t overflow.
+ (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
+ when a (possibly-narrower) signed value would do just as well.
+ We prefer using signed arithmetic, to avoid comparison confusion.
+
+ * alloc.c: Catch some string size overflows that we were missing.
+ (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
+ for convenience in STRING_BYTES_MAX.
+ (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
+ The definition here is exact; the one in lisp.h was approximate.
+ (allocate_string_data): Check for string overflow. This catches
+ some instances we weren't catching before. Also, it catches
+ size_t overflow on (unusual) hosts where SIZE_MAX <= min
+ (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
+ and ptrdiff_t and EMACS_INT are both 64 bits.
+
+ * character.c, coding.c, doprnt.c, editfns.c, eval.c:
+ All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
+ * lisp.h (STRING_BYTES_BOUND): Renamed from STRING_BYTES_MAX.
+
+ * character.c (string_escape_byte8): Fix nbytes/nchars typo.
+
+ * alloc.c (Fmake_string): Check for out-of-range init.
+
+ 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ * buffer.h: Include <time.h>, for time_t.
+ Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
+
+ Fix minor problems found by static checking.
+
+ * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
+
+ Make identifiers static if they are not used in other modules.
+ * data.c (Qcompiled_function, Qframe, Qvector):
+ * image.c (QimageMagick, Qsvg):
+ * minibuf.c (Qmetadata):
+ * window.c (resize_window_check, resize_root_window): Now static.
+ * window.h (resize_window_check, resize_root_window): Remove decls.
+
+ * window.c (window_deletion_count, delete_deletable_window):
+ Remove; unused.
+ (window_body_lines): Now static.
+ (Fdelete_other_windows_internal): Mark vars as initialized.
+ Make sure 'resize_failed' is initialized.
+ (run_window_configuration_change_hook): Rename local to avoid shadowing.
+ (resize_window_apply): Remove unused local.
+ * window.h (delete_deletable_window): Remove decl.
+
+ * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
+ (imagemagick_load_image): Fix pointer signedness problem by changing
+ last arg from unsigned char * to char *. All uses changed.
+ Also, fix a local for similar reasons.
+ Remove unused locals. Remove locals to avoid shadowing.
+ (fn_rsvg_handle_free): Remove; unused.
+ (svg_load, svg_load_image): Fix pointer signedness problem.
+ (imagemagick_load_image): Don't use garbage pointer image_wand.
+
+ * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
+
2011-06-10 Chong Yidong <cyd@stupidchicken.com>
* image.c (gif_load): Fix omitted cast error introduced by