emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109208: Use typedef for EMACS_INT, E


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109208: Use typedef for EMACS_INT, EMACS_UINT.
Date: Wed, 25 Jul 2012 15:47:42 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109208
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2012-07-25 15:47:42 -0700
message:
  Use typedef for EMACS_INT, EMACS_UINT.
  
  * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
  than macros.  This simplifies debugging in the usual case, since
  it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
  and it allows expressions involving EMACS_INT casts.
  * .gdbinit (xreload): Simplify by using EMACS_INT cast.
modified:
  src/.gdbinit
  src/ChangeLog
  src/lisp.h
  src/s/ms-w32.h
=== modified file 'src/.gdbinit'
--- a/src/.gdbinit      2012-06-14 04:02:35 +0000
+++ b/src/.gdbinit      2012-07-25 22:47:42 +0000
@@ -1190,9 +1190,7 @@
 
 define xreload
   set $tagmask = ((1 << gdb_gctypebits) - 1)
-  # The consing_since_gc business widens the 1 to EMACS_INT,
-  # a symbol not directly visible to GDB.
-  set $valmask = gdb_use_lsb ? ~($tagmask) : ((consing_since_gc - 
consing_since_gc + 1) << gdb_valbits) - 1
+  set $valmask = gdb_use_lsb ? ~($tagmask) : ((EMACS_INT) 1 << gdb_valbits) - 1
 end
 document xreload
   When starting Emacs a second time in the same gdb session under

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-07-25 17:31:34 +0000
+++ b/src/ChangeLog     2012-07-25 22:47:42 +0000
@@ -1,3 +1,12 @@
+2012-07-25  Paul Eggert  <address@hidden>
+
+       Use typedef for EMACS_INT, EMACS_UINT.
+       * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
+       than macros.  This simplifies debugging in the usual case, since
+       it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
+       and it allows expressions involving EMACS_INT casts.
+       * .gdbinit (xreload): Simplify by using EMACS_INT cast.
+
 2012-07-25  Jan Djärv  <address@hidden>
 
        * nsterm.m (ns_read_socket): Return early if there is a modal

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2012-07-24 06:45:44 +0000
+++ b/src/lisp.h        2012-07-25 22:47:42 +0000
@@ -45,22 +45,24 @@
    EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if
    pI - printf length modifier for EMACS_INT
    EMACS_UINT - unsigned variant of EMACS_INT */
-#ifndef EMACS_INT
+#ifndef EMACS_INT_MAX
 # if LONG_MAX < LLONG_MAX && defined WIDE_EMACS_INT
-#  define EMACS_INT long long
+typedef long long int EMACS_INT;
+typedef unsigned long long int EMACS_UINT;
 #  define EMACS_INT_MAX LLONG_MAX
 #  define pI "ll"
 # elif INT_MAX < LONG_MAX
-#  define EMACS_INT long
+typedef long int EMACS_INT;
+typedef unsigned long int EMACS_UINT;
 #  define EMACS_INT_MAX LONG_MAX
 #  define pI "l"
 # else
-#  define EMACS_INT int
+typedef int EMACS_INT;
+typedef unsigned int EMACS_UINT;
 #  define EMACS_INT_MAX INT_MAX
 #  define pI ""
 # endif
 #endif
-#define EMACS_UINT unsigned EMACS_INT
 
 /* Number of bits in some machine integer types.  */
 enum

=== modified file 'src/s/ms-w32.h'
--- a/src/s/ms-w32.h    2012-07-14 02:26:31 +0000
+++ b/src/s/ms-w32.h    2012-07-25 22:47:42 +0000
@@ -388,7 +388,8 @@
 # ifdef WIDE_EMACS_INT
 
 /* Use pre-C99-style 64-bit integers.  */
-# define EMACS_INT __int64
+typedef __int64 EMACS_INT;
+typedef unsigned __int64 EMACS_UINT;
 # define EMACS_INT_MAX _I64_MAX
 # define pI "I64"
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]