From: tomo Date: Sat, 31 Jul 2004 09:37:04 +0000 (+0000) Subject: (make_int): Cast the argument into . X-Git-Tag: r21-4-15-chise-0_21-31^2~144 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7153a8d84ffcc9dfde1a317a96e28c5945a3354f;p=chise%2Fxemacs-chise.git.1 (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 . --- 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)