aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-07-25 15:47:42 -0700
committerPaul Eggert2012-07-25 15:47:42 -0700
commit71f88e00a23bc38dc6a15bd65bc1e64981546313 (patch)
treec8442f88e3f3c702a9d5bb214aa51fe6a6e19d45
parent71f32295cef7d059e22d9e3685d11c4c53d5c328 (diff)
downloademacs-71f88e00a23bc38dc6a15bd65bc1e64981546313.tar.gz
emacs-71f88e00a23bc38dc6a15bd65bc1e64981546313.zip
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.
-rw-r--r--src/.gdbinit4
-rw-r--r--src/ChangeLog9
-rw-r--r--src/lisp.h12
-rw-r--r--src/s/ms-w32.h3
4 files changed, 19 insertions, 9 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index 1db25324ea0..379a14b2ea5 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -1190,9 +1190,7 @@ end
1190 1190
1191define xreload 1191define xreload
1192 set $tagmask = ((1 << gdb_gctypebits) - 1) 1192 set $tagmask = ((1 << gdb_gctypebits) - 1)
1193 # The consing_since_gc business widens the 1 to EMACS_INT, 1193 set $valmask = gdb_use_lsb ? ~($tagmask) : ((EMACS_INT) 1 << gdb_valbits) - 1
1194 # a symbol not directly visible to GDB.
1195 set $valmask = gdb_use_lsb ? ~($tagmask) : ((consing_since_gc - consing_since_gc + 1) << gdb_valbits) - 1
1196end 1194end
1197document xreload 1195document xreload
1198 When starting Emacs a second time in the same gdb session under 1196 When starting Emacs a second time in the same gdb session under
diff --git a/src/ChangeLog b/src/ChangeLog
index 700ff294c83..88c90dd84d8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use typedef for EMACS_INT, EMACS_UINT.
4 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5 than macros. This simplifies debugging in the usual case, since
6 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
7 and it allows expressions involving EMACS_INT casts.
8 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9
12012-07-25 Jan Djärv <jan.h.d@swipnet.se> 102012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2 11
3 * nsterm.m (ns_read_socket): Return early if there is a modal 12 * nsterm.m (ns_read_socket): Return early if there is a modal
diff --git a/src/lisp.h b/src/lisp.h
index 7f6a2d72c89..e4eb8ce5084 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -45,22 +45,24 @@ extern void check_cons_list (void);
45 EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if 45 EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if
46 pI - printf length modifier for EMACS_INT 46 pI - printf length modifier for EMACS_INT
47 EMACS_UINT - unsigned variant of EMACS_INT */ 47 EMACS_UINT - unsigned variant of EMACS_INT */
48#ifndef EMACS_INT 48#ifndef EMACS_INT_MAX
49# if LONG_MAX < LLONG_MAX && defined WIDE_EMACS_INT 49# if LONG_MAX < LLONG_MAX && defined WIDE_EMACS_INT
50# define EMACS_INT long long 50typedef long long int EMACS_INT;
51typedef unsigned long long int EMACS_UINT;
51# define EMACS_INT_MAX LLONG_MAX 52# define EMACS_INT_MAX LLONG_MAX
52# define pI "ll" 53# define pI "ll"
53# elif INT_MAX < LONG_MAX 54# elif INT_MAX < LONG_MAX
54# define EMACS_INT long 55typedef long int EMACS_INT;
56typedef unsigned long int EMACS_UINT;
55# define EMACS_INT_MAX LONG_MAX 57# define EMACS_INT_MAX LONG_MAX
56# define pI "l" 58# define pI "l"
57# else 59# else
58# define EMACS_INT int 60typedef int EMACS_INT;
61typedef unsigned int EMACS_UINT;
59# define EMACS_INT_MAX INT_MAX 62# define EMACS_INT_MAX INT_MAX
60# define pI "" 63# define pI ""
61# endif 64# endif
62#endif 65#endif
63#define EMACS_UINT unsigned EMACS_INT
64 66
65/* Number of bits in some machine integer types. */ 67/* Number of bits in some machine integer types. */
66enum 68enum
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 7128d8a069d..bcc4c4235ee 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -388,7 +388,8 @@ extern int getloadavg (double *, int);
388# ifdef WIDE_EMACS_INT 388# ifdef WIDE_EMACS_INT
389 389
390/* Use pre-C99-style 64-bit integers. */ 390/* Use pre-C99-style 64-bit integers. */
391# define EMACS_INT __int64 391typedef __int64 EMACS_INT;
392typedef unsigned __int64 EMACS_UINT;
392# define EMACS_INT_MAX _I64_MAX 393# define EMACS_INT_MAX _I64_MAX
393# define pI "I64" 394# define pI "I64"
394 395