User: ben
Date: 05/11/13 11:48:06
Modified: xemacs/src ChangeLog alloc.c events.c lisp.h lrecord.h
print.c text.h
Log:
further error-checking, etc.
alloc.c, lrecord.h: Move around the handling of setting of lheader->uid so it's
in
set_lheader_implementation() -- that way, even non-MC-ALLOC builds
get useful uid's in their bare lrecords. Redo related code for
strings so the non-ascii count that is stored in the uid isn't hosed.
events.c: Save and restore the uid around event zeroing/deadbeefing.
lisp.h: Set the correct value of MAX_STRING_ASCII_BEGIN under MC_ALLOC.
lisp.h: rearrange the basic code handling ints and chars. basic int stuff goes
first, followed by basic char stuff, followed in turn by stuff that
mixes ints and chars. this is required since some basic defn's have
become inline functions.
XCHAR and CHARP have additional error-checking in that they check to make
sure that the value in question is not just a character but a valid
character (i.e. its numeric value is valid).
print.c: debug_p4 now has a useful UID in all cases and uses it; but it also prints
the raw header address (previously, you just got one of them).
text.h: some basic char defn's that belonged in lisp.h have been moved there.
valid_ichar_p() is moved too since the inline functions need it.
Revision Changes Path
1.884 +51 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.883
retrieving revision 1.884
diff -u -p -r1.883 -r1.884
--- ChangeLog 2005/11/13 10:39:35 1.883
+++ ChangeLog 2005/11/13 10:48:01 1.884
@@ -1,5 +1,56 @@
2005-11-13 Ben Wing <ben(a)xemacs.org>
+ * alloc.c:
+ * alloc.c (alloc_lrecord):
+ * alloc.c (noseeum_alloc_lrecord):
+ * alloc.c (make_uninit_string):
+ * alloc.c (Fmake_string):
+ * alloc.c (make_string_nocopy):
+ * lrecord.h:
+ * lrecord.h (struct lrecord_header):
+ * lrecord.h (set_lheader_implementation):
+ Move around the handling of setting of lheader->uid so it's in
+ set_lheader_implementation() -- that way, even non-MC-ALLOC builds
+ get useful uid's in their bare lrecords. Redo related code for
+ strings so the non-ascii count that is stored in the uid isn't hosed.
+
+ * events.c:
+ * events.c (deinitialize_event):
+ * events.c (zero_event):
+ Save and restore the uid around event zeroing/deadbeefing.
+
+ * lisp.h:
+ Set the correct value of MAX_STRING_ASCII_BEGIN under MC_ALLOC.
+
+ * lisp.h (ZEROP):
+ * lisp.h (XINT):
+ * lisp.h (CHECK_INT):
+ * lisp.h (CONCHECK_INT):
+ * lisp.h (NATNUMP):
+ * lisp.h (CHECK_NATNUM):
+ * lisp.h (CONCHECK_NATNUM):
+ * lisp.h (XCHAR):
+ * lisp.h (XCHAR_OR_INT):
+ * lisp.h (CHAR_INTP):
+ rearrange the basic code handling ints and chars. basic int stuff goes
+ first, followed by basic char stuff, followed in turn by stuff that
+ mixes ints and chars. this is required since some basic defn's have
+ become inline functions.
+
+ XCHAR and CHARP have additional error-checking in that they check to make
+ sure that the value in question is not just a character but a valid
+ character (i.e. its numeric value is valid).
+
+ * print.c:
+ * print.c (debug_p4):
+ debug_p4 now has a useful UID in all cases and uses it; but it also prints
+ the raw header address (previously, you just got one of them).
+ * text.h:
+ some basic char defn's that belonged in lisp.h have been moved there.
+ valid_ichar_p() is moved too since the inline functions need it.
+
+2005-11-13 Ben Wing <ben(a)xemacs.org>
+
* Makefile.in.in (distclean-noconfig):
Add targets distclean-noconfig, realclean-noconfig, extraclean-noconfig.
Do some refactoring for cleanliness.
1.119 +7 -13 XEmacs/xemacs/src/alloc.c
Index: alloc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/alloc.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -p -r1.118 -r1.119
--- alloc.c 2005/10/25 08:32:46 1.118
+++ alloc.c 2005/11/13 10:48:02 1.119
@@ -185,7 +185,7 @@ int garbage_collection_messages;
EMACS_INT gc_generation_number[1];
/* This is just for use by the printer, to allow things to print uniquely */
-static int lrecord_uid_counter;
+int lrecord_uid_counter;
/* Nonzero when calling certain hooks or doing other things where
a GC would be bad */
@@ -606,7 +606,6 @@ alloc_lrecord (Bytecount size,
lheader = (struct lrecord_header *) mc_alloc (size);
gc_checking_assert (LRECORD_FREE_P (lheader));
set_lheader_implementation (lheader, implementation);
- lheader->uid = lrecord_uid_counter++;
#ifdef ALLOC_TYPE_STATS
inc_lrecord_stats (size, lheader);
#endif /* ALLOC_TYPE_STATS */
@@ -628,7 +627,6 @@ noseeum_alloc_lrecord (Bytecount size,
lheader = (struct lrecord_header *) mc_alloc (size);
gc_checking_assert (LRECORD_FREE_P (lheader));
set_lheader_implementation (lheader, implementation);
- lheader->uid = lrecord_uid_counter++;
#ifdef ALLOC_TYPE_STATS
inc_lrecord_stats (size, lheader);
#endif /* ALLOC_TYPE_STATS */
@@ -2484,6 +2482,10 @@ make_uninit_string (Bytecount length)
set_lheader_implementation (&s->u.lheader, &lrecord_string);
#endif /* not MC_ALLOC */
+ /* The above allocations set the UID field, which overlaps with the
+ ascii-length field, to some non-zero value. We need to zero it. */
+ XSET_STRING_ASCII_BEGIN (wrap_string (s), 0);
+
set_lispstringp_data (s, BIG_STRING_FULLSIZE_P (fullsize)
? allocate_big_string_chars (length + 1)
: allocate_string_chars_struct (wrap_string (s),
@@ -2712,16 +2714,6 @@ LENGTH must be a non-negative integer.
EMACS_INT i;
Ibyte *ptr = XSTRING_DATA (val);
-#ifdef MC_ALLOC
- /* Need this for the new allocator: strings are using the uid
- field for ascii_begin. The uid field is set for debugging,
- but the string code assumes here that ascii_begin is always
- zero, when not touched. This assumption is not true with
- the new allocator, so ascii_begin has to be set to zero
- here. */
- XSET_STRING_ASCII_BEGIN (val, 0);
-#endif /* not MC_ALLOC */
-
for (i = XINT (length); i; i--)
{
Ibyte *init_ptr = init_str;
@@ -2872,6 +2864,8 @@ make_string_nocopy (const Ibyte *content
set_lheader_implementation (&s->u.lheader, &lrecord_string);
SET_C_READONLY_RECORD_HEADER (&s->u.lheader);
#endif /* not MC_ALLOC */
+ /* Don't need to XSET_STRING_ASCII_BEGIN() here because it happens in
+ init_string_ascii_begin(). */
s->plist = Qnil;
set_lispstringp_data (s, (Ibyte *) contents);
set_lispstringp_length (s, length);
1.70 +9 -2 XEmacs/xemacs/src/events.c
Index: events.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/events.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -p -r1.69 -r1.70
--- events.c 2005/10/25 11:16:23 1.69
+++ events.c 2005/11/13 10:48:03 1.70
@@ -1,7 +1,7 @@
/* Events: printing them, converting them to and from characters.
Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
- Copyright (C) 2001, 2002 Ben Wing.
+ Copyright (C) 2001, 2002, 2005 Ben Wing.
This file is part of XEmacs.
@@ -86,11 +86,14 @@ static void
deinitialize_event (Lisp_Object ev)
{
Lisp_Event *event = XEVENT (ev);
-
int i;
+ /* Preserve the old UID for this event, for tracking it */
+ unsigned int old_uid = event->lheader.uid;
+
for (i = 0; i < (int) (sizeof (Lisp_Event) / sizeof (int)); i++)
((int *) event) [i] = 0xdeadbeef; /* -559038737 base 10 */
set_lheader_implementation (&event->lheader, &lrecord_event);
+ event->lheader.uid = old_uid;
set_event_type (event, dead_event);
SET_EVENT_CHANNEL (event, Qnil);
XSET_EVENT_NEXT (ev, Qnil);
@@ -100,8 +103,12 @@ deinitialize_event (Lisp_Object ev)
void
zero_event (Lisp_Event *e)
{
+ /* Preserve the old UID for this event, for tracking it */
+ unsigned int old_uid = e->lheader.uid;
+
xzero (*e);
set_lheader_implementation (&e->lheader, &lrecord_event);
+ e->lheader.uid = old_uid;
set_event_type (e, empty_event);
SET_EVENT_CHANNEL (e, Qnil);
SET_EVENT_NEXT (e, Qnil);
1.133 +171 -65 XEmacs/xemacs/src/lisp.h
Index: lisp.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -p -r1.132 -r1.133
--- lisp.h 2005/10/24 10:07:38 1.132
+++ lisp.h 2005/11/13 10:48:03 1.133
@@ -2314,7 +2314,11 @@ struct Lisp_String
};
typedef struct Lisp_String Lisp_String;
+#ifdef MC_ALLOC
+#define MAX_STRING_ASCII_BEGIN ((1 << 22) - 1)
+#else
#define MAX_STRING_ASCII_BEGIN ((1 << 21) - 1)
+#endif
DECLARE_MODULE_API_LRECORD (string, Lisp_String);
#define XSTRING(x) XRECORD (x, string, Lisp_String)
@@ -2559,89 +2563,146 @@ DECLARE_MODULE_API_LRECORD (marker, Lisp
#define marker_next(m) ((m)->next)
#define marker_prev(m) ((m)->prev)
-/*------------------------------- char ---------------------------------*/
+/*-------------------basic int (no connection to char)------------------*/
-#define CHARP(x) (XTYPE (x) == Lisp_Type_Char)
+#define ZEROP(x) EQ (x, Qzero)
#ifdef ERROR_CHECK_TYPES
+#define XINT(x) XINT_1 (x, __FILE__, __LINE__)
+
DECLARE_INLINE_HEADER (
-Ichar
-XCHAR_1 (Lisp_Object obj, const Ascbyte *file, int line)
+EMACS_INT
+XINT_1 (Lisp_Object obj, const Ascbyte *file, int line)
)
{
- assert_at_line (CHARP (obj), file, line);
- return XCHARVAL (obj);
+ assert_at_line (INTP (obj), file, line);
+ return XREALINT (obj);
}
-#define XCHAR(x) XCHAR_1 (x, __FILE__, __LINE__)
-
#else /* no error checking */
-#define XCHAR(x) ((Ichar) XCHARVAL (x))
+#define XINT(obj) XREALINT (obj)
#endif /* no error checking */
-#define CHECK_CHAR(x) CHECK_NONRECORD (x, Lisp_Type_Char, Qcharacterp)
-#define CONCHECK_CHAR(x) CONCHECK_NONRECORD (x, Lisp_Type_Char, Qcharacterp)
+#define CHECK_INT(x) do { \
+ if (!INTP (x)) \
+ dead_wrong_type_argument (Qintegerp, x); \
+} while (0)
+#define CONCHECK_INT(x) do { \
+ if (!INTP (x)) \
+ x = wrong_type_argument (Qintegerp, x); \
+} while (0)
-/*------------------------------ float ---------------------------------*/
+#define NATNUMP(x) (INTP (x) && XINT (x) >= 0)
-/* Note: the 'unused_next_' field exists only to ensure that the
- `next' pointer fits within the structure, for the purposes of the
- free list. This makes a difference in the unlikely case of
- sizeof(double) being smaller than sizeof(void *). */
+#define CHECK_NATNUM(x) do { \
+ if (!NATNUMP (x)) \
+ dead_wrong_type_argument (Qnatnump, x); \
+} while (0)
-struct Lisp_Float
-{
- struct lrecord_header lheader;
- union { double d; struct Lisp_Float *unused_next_; } data;
-};
-typedef struct Lisp_Float Lisp_Float;
+#define CONCHECK_NATNUM(x) do { \
+ if (!NATNUMP (x)) \
+ x = wrong_type_argument (Qnatnump, x); \
+} while (0)
-DECLARE_LRECORD (float, Lisp_Float);
-#define XFLOAT(x) XRECORD (x, float, Lisp_Float)
-#define wrap_float(p) wrap_record (p, float)
-#define FLOATP(x) RECORDP (x, float)
-#define CHECK_FLOAT(x) CHECK_RECORD (x, float)
-#define CONCHECK_FLOAT(x) CONCHECK_RECORD (x, float)
+/*------------------------------- char ---------------------------------*/
-#define float_data(f) ((f)->data.d)
-#define XFLOAT_DATA(x) float_data (XFLOAT (x))
+/* NOTE: There are basic functions for converting between a character and
+ the string representation of a character in text.h, as well as lots of
+ other character-related stuff. There are other functions/macros for
+ working with Ichars in charset.h, for retrieving the charset of an
+ Ichar, the length of an Ichar when converted to text, etc.
+*/
-#define XFLOATINT(n) extract_float (n)
+#ifdef MULE
-#define CHECK_INT_OR_FLOAT(x) do { \
- if (!INT_OR_FLOATP (x)) \
- dead_wrong_type_argument (Qnumberp, x); \
-} while (0)
+MODULE_API int non_ascii_valid_ichar_p (Ichar ch);
-#define CONCHECK_INT_OR_FLOAT(x) do { \
- if (!INT_OR_FLOATP (x)) \
- x = wrong_type_argument (Qnumberp, x); \
-} while (0)
+/* Return whether the given Ichar is valid.
+ */
-# define INT_OR_FLOATP(x) (INTP (x) || FLOATP (x))
+DECLARE_INLINE_HEADER (
+int
+valid_ichar_p (Ichar ch)
+)
+{
+ return (! (ch & ~0xFF)) || non_ascii_valid_ichar_p (ch);
+}
-/*-------------------------------- int ---------------------------------*/
+#else /* not MULE */
-#define ZEROP(x) EQ (x, Qzero)
+/* This works when CH is negative, and correctly returns non-zero only when CH
+ is in the range [0, 255], inclusive. */
+#define valid_ichar_p(ch) (! (ch & ~0xFF))
+#endif /* not MULE */
+
#ifdef ERROR_CHECK_TYPES
-#define XCHAR_OR_INT(x) XCHAR_OR_INT_1 (x, __FILE__, __LINE__)
-#define XINT(x) XINT_1 (x, __FILE__, __LINE__)
+DECLARE_INLINE_HEADER (
+int
+CHARP_1 (Lisp_Object obj, const Ascbyte *file, int line)
+)
+{
+ if (XTYPE (obj) != Lisp_Type_Char)
+ return 0;
+ assert_at_line (valid_ichar_p (XCHARVAL (obj)), file, line);
+ return 1;
+}
+
+#define CHARP(x) CHARP_1 (x, __FILE__, __LINE__)
DECLARE_INLINE_HEADER (
-EMACS_INT
-XINT_1 (Lisp_Object obj, const Ascbyte *file, int line)
+Ichar
+XCHAR_1 (Lisp_Object obj, const Ascbyte *file, int line)
)
{
- assert_at_line (INTP (obj), file, line);
- return XREALINT (obj);
+ Ichar ch;
+ assert_at_line (CHARP (obj), file, line);
+ ch = XCHARVAL (obj);
+ assert_at_line (valid_ichar_p (ch), file, line);
+ return ch;
}
+#define XCHAR(x) XCHAR_1 (x, __FILE__, __LINE__)
+
+#else /* not ERROR_CHECK_TYPES */
+
+#define CHARP(x) (XTYPE (x) == Lisp_Type_Char)
+#define XCHAR(x) ((Ichar) XCHARVAL (x))
+
+#endif /* (else) not ERROR_CHECK_TYPES */
+
+#define CONCHECK_CHAR(x) do { \
+ if (!CHARP (x)) \
+ x = wrong_type_argument (Qcharacterp, x); \
+ } while (0)
+
+#define CHECK_CHAR(x) do { \
+ if (!CHARP (x)) \
+ dead_wrong_type_argument (Qcharacterp, x); \
+ } while (0)
+
+
+DECLARE_INLINE_HEADER (
+Lisp_Object
+make_char (Ichar val)
+)
+{
+ type_checking_assert (valid_ichar_p (val));
+ /* This is defined in lisp-union.h or lisp-disunion.h */
+ return make_char_1 (val);
+}
+
+/*------------------------- int-char connection ------------------------*/
+
+#ifdef ERROR_CHECK_TYPES
+
+#define XCHAR_OR_INT(x) XCHAR_OR_INT_1 (x, __FILE__, __LINE__)
+
DECLARE_INLINE_HEADER (
EMACS_INT
XCHAR_OR_INT_1 (Lisp_Object obj, const Ascbyte *file, int line)
@@ -2653,31 +2714,39 @@ XCHAR_OR_INT_1 (Lisp_Object obj, const A
#else /* no error checking */
-#define XINT(obj) XREALINT (obj)
#define XCHAR_OR_INT(obj) (CHARP (obj) ? XCHAR (obj) : XINT (obj))
#endif /* no error checking */
-#define CHECK_INT(x) do { \
- if (!INTP (x)) \
- dead_wrong_type_argument (Qintegerp, x); \
-} while (0)
+/* True of X is an integer whose value is the valid integral equivalent of a
+ character. */
-#define CONCHECK_INT(x) do { \
- if (!INTP (x)) \
- x = wrong_type_argument (Qintegerp, x); \
-} while (0)
+#define CHAR_INTP(x) (INTP (x) && valid_ichar_p (XINT (x)))
-#define NATNUMP(x) (INTP (x) && XINT (x) >= 0)
+/* True of X is a character or an integral value that can be converted into a
+ character. */
+#define CHAR_OR_CHAR_INTP(x) (CHARP (x) || CHAR_INTP (x))
-#define CHECK_NATNUM(x) do { \
- if (!NATNUMP (x)) \
- dead_wrong_type_argument (Qnatnump, x); \
-} while (0)
+DECLARE_INLINE_HEADER (
+Ichar
+XCHAR_OR_CHAR_INT (Lisp_Object obj)
+)
+{
+ return CHARP (obj) ? XCHAR (obj) : XINT (obj);
+}
-#define CONCHECK_NATNUM(x) do { \
- if (!NATNUMP (x)) \
- x = wrong_type_argument (Qnatnump, x); \
+/* Signal an error if CH is not a valid character or integer Lisp_Object.
+ If CH is an integer Lisp_Object, convert it to a character Lisp_Object,
+ but merely by repackaging, without performing tests for char validity.
+ */
+
+#define CHECK_CHAR_COERCE_INT(x) do { \
+ if (CHARP (x)) \
+ ; \
+ else if (CHAR_INTP (x)) \
+ x = make_char (XINT (x)); \
+ else \
+ x = wrong_type_argument (Qcharacterp, x); \
} while (0)
/* next three always continuable because they coerce their arguments. */
@@ -2710,6 +2779,43 @@ XCHAR_OR_INT_1 (Lisp_Object obj, const A
x = wrong_type_argument (Qinteger_char_or_marker_p, x); \
} while (0)
+/*------------------------------ float ---------------------------------*/
+
+/* Note: the 'unused_next_' field exists only to ensure that the
+ `next' pointer fits within the structure, for the purposes of the
+ free list. This makes a difference in the unlikely case of
+ sizeof(double) being smaller than sizeof(void *). */
+
+struct Lisp_Float
+{
+ struct lrecord_header lheader;
+ union { double d; struct Lisp_Float *unused_next_; } data;
+};
+typedef struct Lisp_Float Lisp_Float;
+
+DECLARE_LRECORD (float, Lisp_Float);
+#define XFLOAT(x) XRECORD (x, float, Lisp_Float)
+#define wrap_float(p) wrap_record (p, float)
+#define FLOATP(x) RECORDP (x, float)
+#define CHECK_FLOAT(x) CHECK_RECORD (x, float)
+#define CONCHECK_FLOAT(x) CONCHECK_RECORD (x, float)
+
+#define float_data(f) ((f)->data.d)
+#define XFLOAT_DATA(x) float_data (XFLOAT (x))
+
+#define XFLOATINT(n) extract_float (n)
+
+#define CHECK_INT_OR_FLOAT(x) do { \
+ if (!INT_OR_FLOATP (x)) \
+ dead_wrong_type_argument (Qnumberp, x); \
+} while (0)
+
+#define CONCHECK_INT_OR_FLOAT(x) do { \
+ if (!INT_OR_FLOATP (x)) \
+ x = wrong_type_argument (Qnumberp, x); \
+} while (0)
+
+# define INT_OR_FLOATP(x) (INTP (x) || FLOATP (x))
/*--------------------------- readonly objects -------------------------*/
1.43 +10 -4 XEmacs/xemacs/src/lrecord.h
Index: lrecord.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lrecord.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -p -r1.42 -r1.43
--- lrecord.h 2005/10/26 13:01:42 1.42
+++ lrecord.h 2005/11/13 10:48:03 1.43
@@ -120,9 +120,9 @@ struct lrecord_header
debugging. */
unsigned int free :1;
- /* The `uid' field is just for debugging/printing convenience.
- Having this slot doesn't hurt us much spacewise, since the
- bits are unused anyway. */
+ /* The `uid' field is just for debugging/printing convenience. Having
+ this slot doesn't hurt us spacewise, since the bits are unused
+ anyway. (The bits are used for strings, though.) */
unsigned int uid :22;
#else /* not MC_ALLOC */
@@ -140,13 +140,17 @@ struct lrecord_header
/* 1 if the object is readonly from lisp */
unsigned int lisp_readonly :1;
- unsigned int unused :21;
+ /* The `uid' field is just for debugging/printing convenience. Having
+ this slot doesn't hurt us spacewise, since the bits are unused
+ anyway. (The bits are used for strings, though.) */
+ unsigned int uid :21;
#endif /* not MC_ALLOC */
};
struct lrecord_implementation;
int lrecord_type_index (const struct lrecord_implementation *implementation);
+extern int lrecord_uid_counter;
#ifdef MC_ALLOC
#define set_lheader_implementation(header,imp) do { \
@@ -154,6 +158,7 @@ int lrecord_type_index (const struct lre
SLI_header->type = (imp)->lrecord_type_index; \
SLI_header->lisp_readonly = 0; \
SLI_header->free = 0; \
+ SLI_header->uid = lrecord_uid_counter++; \
} while (0)
#else /* not MC_ALLOC */
#define set_lheader_implementation(header,imp) do { \
@@ -162,6 +167,7 @@ int lrecord_type_index (const struct lre
SLI_header->mark = 0; \
SLI_header->c_readonly = 0; \
SLI_header->lisp_readonly = 0; \
+ SLI_header->uid = lrecord_uid_counter++; \
} while (0)
#endif /* not MC_ALLOC */
1.57 +6 -4 XEmacs/xemacs/src/print.c
Index: print.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/print.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -p -r1.56 -r1.57
--- print.c 2005/10/25 08:32:48 1.56
+++ print.c 2005/11/13 10:48:03 1.57
@@ -1,6 +1,6 @@
/* Lisp object printing and output streams.
Copyright (C) 1985, 1986, 1988, 1992-1995 Free Software Foundation, Inc.
- Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing.
+ Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2005 Ben Wing.
This file is part of XEmacs.
@@ -2211,14 +2211,16 @@ debug_p4 (Lisp_Object obj)
(EMACS_INT) header);
else
#ifdef MC_ALLOC
- debug_out ("#<%s 0x%lx>",
+ debug_out ("#<%s addr=0x%lx uid=0x%lx>",
LHEADER_IMPLEMENTATION (header)->name,
+ (EMACS_INT) header,
(EMACS_INT) ((struct lrecord_header *) header)->uid);
#else /* not MC_ALLOC */
- debug_out ("#<%s 0x%lx>",
+ debug_out ("#<%s addr=0x%lx uid=0x%lx>",
LHEADER_IMPLEMENTATION (header)->name,
+ (EMACS_INT) header,
LHEADER_IMPLEMENTATION (header)->basic_p ?
- (EMACS_INT) header :
+ ((struct lrecord_header *) header)->uid :
((struct old_lcrecord_header *) header)->uid);
#endif /* not MC_ALLOC */
}
1.29 +1 -68 XEmacs/xemacs/src/text.h
Index: text.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/text.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -p -r1.28 -r1.29
--- text.h 2005/01/28 02:36:27 1.28
+++ text.h 2005/11/13 10:48:04 1.29
@@ -1,7 +1,7 @@
/* Header file for text manipulation primitives and macros.
Copyright (C) 1985-1995 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Ben Wing.
This file is part of XEmacs.
@@ -1005,73 +1005,6 @@ itext_copy_ichar (const Ibyte *src, Ibyt
#define itext_ichar_n(ptr, offset) \
itext_ichar (itext_n_addr (ptr, offset))
-
-
-/* ---------------------------- */
-/* Working with Ichars */
-/* ---------------------------- */
-
-/* NOTE: There are other functions/macros for working with Ichars in
- charset.h, for retrieving the charset of an Ichar, the length of an
- Ichar when converted to text, etc.
-*/
-
-#ifdef MULE
-
-MODULE_API int non_ascii_valid_ichar_p (Ichar ch);
-
-/* Return whether the given Ichar is valid.
- */
-
-DECLARE_INLINE_HEADER (
-int
-valid_ichar_p (Ichar ch)
-)
-{
- return (! (ch & ~0xFF)) || non_ascii_valid_ichar_p (ch);
-}
-
-#else /* not MULE */
-
-#define valid_ichar_p(ch) (! (ch & ~0xFF))
-
-#endif /* not MULE */
-
-DECLARE_INLINE_HEADER (
-Lisp_Object
-make_char (Ichar val)
-)
-{
- type_checking_assert (valid_ichar_p (val));
- return make_char_1 (val);
-}
-
-#define CHAR_INTP(x) (INTP (x) && valid_ichar_p (XINT (x)))
-
-#define CHAR_OR_CHAR_INTP(x) (CHARP (x) || CHAR_INTP (x))
-
-DECLARE_INLINE_HEADER (
-Ichar
-XCHAR_OR_CHAR_INT (Lisp_Object obj)
-)
-{
- return CHARP (obj) ? XCHAR (obj) : XINT (obj);
-}
-
-/* Signal an error if CH is not a valid character or integer Lisp_Object.
- If CH is an integer Lisp_Object, convert it to a character Lisp_Object,
- but merely by repackaging, without performing tests for char validity.
- */
-
-#define CHECK_CHAR_COERCE_INT(x) do { \
- if (CHARP (x)) \
- ; \
- else if (CHAR_INTP (x)) \
- x = make_char (XINT (x)); \
- else \
- x = wrong_type_argument (Qcharacterp, x); \
-} while (0)
-
/************************************************************************/