From 7153a8d84ffcc9dfde1a317a96e28c5945a3354f Mon Sep 17 00:00:00 2001 From: tomo Date: Sat, 31 Jul 2004 09:37:04 +0000 Subject: [PATCH] (make_int): Cast the argument into . (make_char): Likewise. (XCHARVAL): Don't use the inline function for UTF-2000 in 64 bit environment. (XCHARVAL[for UTF-2000 in 32 bit environment]): Use instead of as the type of return value; use instead of as the type of argument. (XCHARVAL[macro version]): Cast the result into . --- src/lisp-disunion.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lisp-disunion.h b/src/lisp-disunion.h index 30470d8..90d0b71 100644 --- a/src/lisp-disunion.h +++ b/src/lisp-disunion.h @@ -79,15 +79,15 @@ typedef EMACS_INT Lisp_Object; #define Lisp_Type_Int_Bit (Lisp_Type_Int_Even & Lisp_Type_Int_Odd) #define wrap_object(ptr) ((Lisp_Object) (ptr)) -#define make_int(x) ((Lisp_Object) (((x) << INT_GCBITS) | Lisp_Type_Int_Bit)) -#define make_char(x) ((Lisp_Object) (((x) << GCBITS) | Lisp_Type_Char)) +#define make_int(x) ((Lisp_Object) (((EMACS_INT)(x) << INT_GCBITS) | Lisp_Type_Int_Bit)) +#define make_char(x) ((Lisp_Object) (((EMACS_INT)(x) << GCBITS) | Lisp_Type_Char)) #define VALMASK (((1UL << VALBITS) - 1UL) << GCTYPEBITS) #define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) & ~VALMASK)) #define XPNTRVAL(x) (x) /* This depends on Lisp_Type_Record == 0 */ -#ifdef UTF2000 -INLINE_HEADER int XCHARVAL (Emchar chr); -INLINE_HEADER int -XCHARVAL (Emchar chr) +#if defined(UTF2000) && (SIZEOF_EMACS_INT == 32) +INLINE_HEADER Emchar XCHARVAL (Emchar chr); +INLINE_HEADER Emchar +XCHARVAL (Lisp_Object chr) { int code = (EMACS_UINT)(chr) >> GCBITS; @@ -97,7 +97,7 @@ XCHARVAL (Emchar chr) return code; } #else -#define XCHARVAL(x) ((EMACS_UINT)(x) >> GCBITS) +#define XCHARVAL(x) ((Emchar)((EMACS_UINT)(x) >> GCBITS)) #endif #define XREALINT(x) ((x) >> INT_GCBITS) #define XUINT(x) ((EMACS_UINT)(x) >> INT_GCBITS) -- 1.7.10.4