From: Paul Eggert Date: Sat, 30 Apr 2011 19:00:39 +0000 (-0700) Subject: Merge from mainline. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~92^2~26 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b5611f17a7bd64578fc43874a727a8f1081614e9;p=emacs.git Merge from mainline. --- b5611f17a7bd64578fc43874a727a8f1081614e9 diff --cc nt/ChangeLog index 4597478081b,660140f66cf..e24ff6cf3aa --- a/nt/ChangeLog +++ b/nt/ChangeLog @@@ -1,9 -1,7 +1,13 @@@ +2011-04-30 Paul Eggert + - * config.nt: Configure 64-bit integers. - (BITS_PER_LONG_LONG): Define if C99-style long long and "%lld" work. - (EMACS_INT, BITS_PER_EMACS_INT, pI): Otherwise, define these if - __int64 and "%I64d" work. ++ * config.nt: Configure 64-bit integers for older compilers. ++ (EMACS_INT, BITS_PER_EMACS_INT, pI): Define these if __int64 and ++ "%I64d" work but long long and "%lld" do not. ++ + 2011-04-30 Eli Zaretskii + + * config.nt (HAVE_LONG_LONG_INT, HAVE_UNSIGNED_LONG_LONG_INT): + Define to 1 for MinGW of MSVC versions >= 1400. 2011-04-28 Eli Zaretskii diff --cc nt/config.nt index 7765919638f,285f3944dd8..b595e298996 --- a/nt/config.nt +++ b/nt/config.nt @@@ -470,15 -470,15 +470,22 @@@ extern char *getenv () #define BITS_PER_LONG 32 #endif - #if defined __MINGW32__ || 1400 <= _MSC_VER - /* C99-style long long and "%lld" both work, so use them. */ - # define BITS_PER_LONG_LONG 64 - #elif 1200 <= _MSC_VER + #if defined(__MINGW32__) || _MSC_VER >= 1400 + + /* Define to 1 if the system has the type `long long int'. */ + # define HAVE_LONG_LONG_INT 1 + + /* Define to 1 if the system has the type `unsigned long long int'. */ + # define HAVE_UNSIGNED_LONG_LONG_INT 1 + -#endif /* __MINGW32__ || _MSC_VER >= 1400 */ ++#elif _MSC_VER >= 1200 ++ +/* Use pre-C99-style 64-bit integers. */ +# define EMACS_INT __int64 +# define BITS_PER_EMACS_INT 64 +# define pI "I64" ++ +#endif #ifndef POINTER_TYPE #define POINTER_TYPE void diff --cc src/ChangeLog index 0a9c3d88ca5,7b54b1e521c..310d32a6432 --- a/src/ChangeLog +++ b/src/ChangeLog @@@ -1,84 -1,39 +1,116 @@@ +2011-04-30 Paul Eggert + + * dispnew.c (scrolling_window): Return 1 if we scrolled, + to match comment at start of function. This also removes a + GCC warning about overflow in a 32+64-bit port. + + * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify. + + * dbusbind.c: Do not use XPNTR on a value that may be an integer. + Reported by Stefan Monnier in + . + (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): Use + SYMBOLP-guarded XSYMBOL, not XPNTR. + - 2011-04-29 Paul Eggert - + * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t. + (EMACS_UINTPTR): Likewise, with uintptr_t. + + * lisp.h: Prefer 64-bit EMACS_INT if available. + (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit + on 32-bit hosts that have 64-bit int, so that they can access + large files. + + * lread.c, process.c: Do not include ; lisp.h does it now. + + Prefer intptr_t/uintptr_t for integers the same widths as pointers. + This removes an assumption that EMACS_INT and long are the same + width as pointers. The assumption is true for Emacs porting targets + now, but we want to make other targets possible. + * lisp.h: Include , for INTPTR_MAX, UINTPTR_MAX. + (EMACS_INTPTR, EMACS_UINTPTR): New macros. + In the rest of the code, change types of integers that hold casted + pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically + replacing EMACS_INT, long, EMACS_UINT, and unsigned long. + (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed. + (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here. + No need to cast type when ORing. + (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR. + * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast. + * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to + assume EMACS_INT is the same width as char *. + * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb): + (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item): + Remove no-longer-needed casts. + (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback): + (xg_tool_bar_help_callback, xg_make_tool_item): + Use EMACS_INTPTR to hold an integer + that will be cast to void *; this can avoid a GCC warning + if EMACS_INT is not the same width as void *. + * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast. + * xdisp.c (display_echo_area_1, resize_mini_window_1): + (current_message_1, set_message_1): + Use a local to convert to proper width without a cast. + * xmenu.c (dialog_selection_callback): Likewise. + - 2011-04-28 Paul Eggert - + * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long. + Also, don't assume VALBITS / RAND_BITS is less than 5, + and don't rely on undefined behavior when shifting a 1 left into + the sign bit. + * lisp.h (get_random): Change signature to match. + + * lread.c (hash_string): Use size_t, not int, for hash computation. + Normally we prefer signed values; but hashing is special, because + it's better to use unsigned division on hash table sizes so that + the remainder is nonnegative. Also, size_t is the natural width + for hashing into memory. The previous code used 'int', which doesn't + retain enough info to hash well into very large tables. + (oblookup, oblookup_last_bucket_number, Funintern): Likewise. + + * dbusbind.c: Don't possibly lose pointer info when converting. + (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): + Use XPNTR rather than XHASH, so that the high-order bits of + the pointer aren't lost when converting through void *. + + * eval.c (Fautoload): Don't double-shift a pointer. + + * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long. + + 2011-04-30 Eli Zaretskii + + * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)' + rather than `XVECTOR (FOO)->size'. + + * process.c: Remove HAVE_INTTYPES_H condition from inclusion of + inttypes.h, as a gnulib replacement is used if it not available in + system headers. + + 2011-04-21 Eli Zaretskii + + Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files. + * fileio.c (Finsert_file_contents): Don't limit file size to 1/4 + of MOST_POSITIVE_FIXNUM. (Bug#8528) + + * coding.c (coding_alloc_by_realloc): Error out if destination + will grow beyond MOST_POSITIVE_FIXNUM. + (decode_coding_emacs_mule): Abort if there isn't enough place in + charbuf for the composition carryover bytes. Reserve an extra + space for up to 2 characters produced in a loop. + (decode_coding_iso_2022): Abort if there isn't enough place in + charbuf for the composition carryover bytes. + + 2011-04-21 Eli Zaretskii + + * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of + aborting when %lld or %lll format is passed. + [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when + %llo or %llx format is passed. (Bug#8545) + + * window.c (window_scroll_line_based): Use a marker instead of + simple variables to record original value of point. (Bug#7952) + + * doprnt.c (doprnt): Fix the case where a multibyte sequence + produced by %s or %c overflows available buffer space. (Bug#8545) + 2011-04-28 Paul Eggert * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).