comparison src/lisp-union.h @ 5581:56144c8593a8

Mechanically change INT to FIXNUM in our sources. src/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT (where it refers to non-bignum Lisp integers) to FIXNUM in our sources. Done for the following functions, enums, and macros: Lisp_Type_Int_Even, Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(), XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(), EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT. The EMACS_INT typedef was not changed, it does not describe non-bignum Lisp integers. Script that did the change available in http://mid.gmane.org/20067.17650.181273.12014@parhasard.net . modules/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers. See the src/ChangeLog entry for more details. man/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> * internals/internals.texi (How Lisp Objects Are Represented in C): * internals/internals.texi (Integers and Characters): Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Oct 2011 09:51:57 +0100
parents 308d34e9f07d
children
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
36 enum_field (Lisp_Type) type : GCTYPEBITS; 36 enum_field (Lisp_Type) type : GCTYPEBITS;
37 } gu; 37 } gu;
38 38
39 struct 39 struct
40 { 40 {
41 signed EMACS_INT val : INT_VALBITS; 41 signed EMACS_INT val : FIXNUM_VALBITS;
42 unsigned int bits : INT_GCBITS; 42 unsigned int bits : FIXNUM_GCBITS;
43 } s; 43 } s;
44 44
45 struct 45 struct
46 { 46 {
47 EMACS_UINT val : INT_VALBITS; 47 EMACS_UINT val : FIXNUM_VALBITS;
48 unsigned int bits : INT_GCBITS; 48 unsigned int bits : FIXNUM_GCBITS;
49 } u; 49 } u;
50 #else /* non-valbits are at higher addresses */ 50 #else /* non-valbits are at higher addresses */
51 struct 51 struct
52 { 52 {
53 enum_field (Lisp_Type) type : GCTYPEBITS; 53 enum_field (Lisp_Type) type : GCTYPEBITS;
54 EMACS_UINT val : VALBITS; 54 EMACS_UINT val : VALBITS;
55 } gu; 55 } gu;
56 56
57 struct 57 struct
58 { 58 {
59 unsigned int bits : INT_GCBITS; 59 unsigned int bits : FIXNUM_GCBITS;
60 signed EMACS_INT val : INT_VALBITS; 60 signed EMACS_INT val : FIXNUM_VALBITS;
61 } s; 61 } s;
62 62
63 struct 63 struct
64 { 64 {
65 unsigned int bits : INT_GCBITS; 65 unsigned int bits : FIXNUM_GCBITS;
66 EMACS_UINT val : INT_VALBITS; 66 EMACS_UINT val : FIXNUM_VALBITS;
67 } u; 67 } u;
68 68
69 #endif /* non-valbits are at higher addresses */ 69 #endif /* non-valbits are at higher addresses */
70 70
71 EMACS_UINT ui; 71 EMACS_UINT ui;
79 Lisp_Object; 79 Lisp_Object;
80 80
81 #define XCHARVAL(x) ((EMACS_INT)(x).gu.val) 81 #define XCHARVAL(x) ((EMACS_INT)(x).gu.val)
82 #define XPNTRVAL(x) ((x).ui) 82 #define XPNTRVAL(x) ((x).ui)
83 83
84 #define XREALINT(x) ((EMACS_INT)(x).s.val) 84 #define XREALFIXNUM(x) ((EMACS_INT)(x).s.val)
85 #define XUINT(x) ((EMACS_UINT)(x).u.val) 85 #define XUINT(x) ((EMACS_UINT)(x).u.val)
86 #define XTYPE(x) ((x).gu.type) 86 #define XTYPE(x) ((x).gu.type)
87 #define EQ(x,y) ((x).v == (y).v) 87 #define EQ(x,y) ((x).v == (y).v)
88 88
89 DECLARE_INLINE_HEADER ( 89 DECLARE_INLINE_HEADER (
90 Lisp_Object 90 Lisp_Object
91 make_int_verify (EMACS_INT val) 91 make_fixnum_verify (EMACS_INT val)
92 ) 92 )
93 { 93 {
94 Lisp_Object obj; 94 Lisp_Object obj;
95 obj.s.bits = 1; 95 obj.s.bits = 1;
96 obj.s.val = val; 96 obj.s.val = val;
97 type_checking_assert (XREALINT (obj) == val); 97 type_checking_assert (XREALFIXNUM (obj) == val);
98 return obj; 98 return obj;
99 } 99 }
100 100
101 DECLARE_INLINE_HEADER ( 101 DECLARE_INLINE_HEADER (
102 Lisp_Object 102 Lisp_Object
103 make_int (EMACS_INT val) 103 make_fixnum (EMACS_INT val)
104 ) 104 )
105 { 105 {
106 Lisp_Object obj; 106 Lisp_Object obj;
107 obj.s.bits = 1; 107 obj.s.bits = 1;
108 obj.s.val = val; 108 obj.s.val = val;
130 return obj; 130 return obj;
131 } 131 }
132 132
133 extern MODULE_API Lisp_Object Qnull_pointer, Qzero; 133 extern MODULE_API Lisp_Object Qnull_pointer, Qzero;
134 134
135 #define INTP(x) ((x).s.bits) 135 #define FIXNUMP(x) ((x).s.bits)
136 #define INT_PLUS(x,y) make_int (XINT (x) + XINT (y)) 136 #define FIXNUM_PLUS(x,y) make_fixnum (XFIXNUM (x) + XFIXNUM (y))
137 #define INT_MINUS(x,y) make_int (XINT (x) - XINT (y)) 137 #define FIXNUM_MINUS(x,y) make_fixnum (XFIXNUM (x) - XFIXNUM (y))
138 #define INT_PLUS1(x) make_int (XINT (x) + 1) 138 #define FIXNUM_PLUS1(x) make_fixnum (XFIXNUM (x) + 1)
139 #define INT_MINUS1(x) make_int (XINT (x) - 1) 139 #define FIXNUM_MINUS1(x) make_fixnum (XFIXNUM (x) - 1)
140 140
141 /* WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 141 /* WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
142 142
143 You can only GET_LISP_FROM_VOID something that had previously been 143 You can only GET_LISP_FROM_VOID something that had previously been
144 STORE_LISP_IN_VOID'd. If you want to go the other way, use 144 STORE_LISP_IN_VOID'd. If you want to go the other way, use