Mercurial > hg > xemacs-beta
changeset 5935:d5eb0914ca1f cygwin
trial of E1 and UE1
author | Henry Thompson <ht@markup.co.uk> |
---|---|
date | Sat, 12 Dec 2015 21:49:31 +0000 |
parents | e2fae7783046 |
children | 574f0cded429 |
files | notes.txt src/alloc.c src/events.c src/fns.c src/hash.c src/lisp.h src/number.c src/sysdep.c |
diffstat | 8 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/notes.txt Sat Dec 12 19:08:46 2015 +0000 +++ b/notes.txt Sat Dec 12 21:49:31 2015 +0000 @@ -362,3 +362,6 @@ Using various means to locate and attempt to correct warnings. Have now eliminated all pointer truncation warnings. 1254 remain, of which 1246 are conversion from [64 bits] to [32 bits], possible loss of data + +Defined macros for (EMACS_INT)1 and (EMACS_UINT)1 to replace 1L and 1UL + E1 UE1
--- a/src/alloc.c Sat Dec 12 19:08:46 2015 +0000 +++ b/src/alloc.c Sat Dec 12 21:49:31 2015 +0000 @@ -889,8 +889,8 @@ about expressions in src/.gdbinit. See src/.gdbinit or src/.dbxrc to see how this is used. */ -EMACS_UINT dbg_valmask = (((EMACS_UINT)1 << VALBITS) - 1) << GCBITS; -EMACS_UINT dbg_typemask = ((EMACS_UINT)1 << GCTYPEBITS) - 1; +EMACS_UINT dbg_valmask = ((UE1 << VALBITS) - 1) << GCBITS; +EMACS_UINT dbg_typemask = (UE1 << GCTYPEBITS) - 1; #ifdef USE_UNION_TYPE unsigned char dbg_USE_UNION_TYPE = 1;
--- a/src/events.c Sat Dec 12 19:08:46 2015 +0000 +++ b/src/events.c Sat Dec 12 21:49:31 2015 +0000 @@ -1766,7 +1766,7 @@ return make_fixnum (MOST_POSITIVE_FIXNUM & XEVENT_TIMESTAMP (event)); } -#define TIMESTAMP_HALFSPACE ((EMACS_INT)1 << (FIXNUM_VALBITS - 2)) +#define TIMESTAMP_HALFSPACE (E1 << (FIXNUM_VALBITS - 2)) DEFUN ("event-timestamp<", Fevent_timestamp_lessp, 2, 2, 0, /* Return true if timestamp TIME1 is earlier than timestamp TIME2.
--- a/src/fns.c Sat Dec 12 19:08:46 2015 +0000 +++ b/src/fns.c Sat Dec 12 21:49:31 2015 +0000 @@ -98,7 +98,7 @@ it's possible to get a quotient larger than limit; discarding these values eliminates the bias that would otherwise appear when using a large limit. */ - denominator = ((EMACS_UINT)1 << FIXNUM_VALBITS) / XFIXNUM (limit); + denominator = (UE1 << FIXNUM_VALBITS) / XFIXNUM (limit); do val = get_random () / denominator; while (val >= XFIXNUM (limit));
--- a/src/hash.c Sat Dec 12 19:08:46 2015 +0000 +++ b/src/hash.c Sat Dec 12 21:49:31 2015 +0000 @@ -240,7 +240,7 @@ if (!key) { hash_table->zero_entry = contents; - hash_table->zero_set = (EMACS_INT)1; + hash_table->zero_set = E1; } else {
--- a/src/lisp.h Sat Dec 12 19:08:46 2015 +0000 +++ b/src/lisp.h Sat Dec 12 21:49:31 2015 +0000 @@ -487,6 +487,10 @@ # define EMACS_UINT unsigned EMACS_INT #endif +/* HST added to save space/typing/be more transparent, I hope */ +#define E1 ((EMACS_INT)1) +#define UE1 ((EMACS_UINT)1) + #define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR) /* -------------------------- basic byte typedefs --------------------- */ @@ -1750,7 +1754,7 @@ { EMACS_UINT p = (EMACS_UINT) ptr; - type_checking_assert ((p & (EMACS_UINT)1) == 0); + type_checking_assert ((p & UE1) == 0); return make_fixnum (p >> 1); }
--- a/src/number.c Sat Dec 12 19:08:46 2015 +0000 +++ b/src/number.c Sat Dec 12 21:49:31 2015 +0000 @@ -351,7 +351,7 @@ CHECK_BIGFLOAT (f); if (FIXNUMP (precision)) { - prec = (XFIXNUM (precision) <= 0) ? (EMACS_UINT)1 : (unsigned long) XFIXNUM (precision); + prec = (XFIXNUM (precision) <= 0) ? UE1 : (EMACS_UINT) XFIXNUM (precision); } #ifdef HAVE_BIGNUM else if (BIGNUMP (precision)) @@ -519,7 +519,7 @@ #endif /* HAVE_BIGNUM */ case RATIO_T: #ifdef HAVE_RATIO - return make_ratio (XREALFIXNUM (number), (EMACS_UINT)1); + return make_ratio (XREALFIXNUM (number), UE1); #else ABORT (); #endif /* HAVE_RATIO */
--- a/src/sysdep.c Sat Dec 12 19:08:46 2015 +0000 +++ b/src/sysdep.c Sat Dec 12 21:49:31 2015 +0000 @@ -3509,7 +3509,7 @@ #endif /* need at least 4 */ #endif /* need at least 3 */ #endif /* need at least 2 */ - return val & (((EMACS_UINT)1 << FIXNUM_VALBITS) - 1); + return val & ((UE1 << FIXNUM_VALBITS) - 1); }