comparison src/eval.c @ 4025:f9a0570637f3

[xemacs-hg @ 2007-06-22 00:21:12 by aidan] #ifdef out problematic AMD64 code, eval.c, record_unwind_protect_restoring_int, restore_int.
author aidan
date Fri, 22 Jun 2007 00:21:17 +0000
parents 53260b0cd16b
children 23d7fde3d773
comparison
equal deleted inserted replaced
4024:f901409b074b 4025:f9a0570637f3
6007 Lisp_Object opaque = XCAR (cons); 6007 Lisp_Object opaque = XCAR (cons);
6008 Lisp_Object lval = XCDR (cons); 6008 Lisp_Object lval = XCDR (cons);
6009 int *addr = (int *) get_opaque_ptr (opaque); 6009 int *addr = (int *) get_opaque_ptr (opaque);
6010 int val; 6010 int val;
6011 6011
6012 /* In the event that a C integer will always fit in an Emacs int, we
6013 haven't ever stored a C integer as an opaque pointer. This #ifdef
6014 eliminates a warning on AMD 64, where EMACS_INT has 63 value bits and C
6015 integers have 32 value bits. */
6016 #if INT_VALBITS < INTBITS
6012 if (INTP (lval)) 6017 if (INTP (lval))
6013 val = XINT (lval); 6018 {
6019 val = XINT (lval);
6020 }
6014 else 6021 else
6015 { 6022 {
6016 val = (int) get_opaque_ptr (lval); 6023 val = (int) get_opaque_ptr (lval);
6017 free_opaque_ptr (lval); 6024 free_opaque_ptr (lval);
6018 } 6025 }
6026 #else /* !(INT_VALBITS < INTBITS) */
6027 val = XINT(lval);
6028 #endif /* INT_VALBITS < INTBITS */
6019 6029
6020 *addr = val; 6030 *addr = val;
6021 free_opaque_ptr (opaque); 6031 free_opaque_ptr (opaque);
6022 free_cons (cons); 6032 free_cons (cons);
6023 return Qnil; 6033 return Qnil;
6030 record_unwind_protect_restoring_int (int *addr, int val) 6040 record_unwind_protect_restoring_int (int *addr, int val)
6031 { 6041 {
6032 Lisp_Object opaque = make_opaque_ptr (addr); 6042 Lisp_Object opaque = make_opaque_ptr (addr);
6033 Lisp_Object lval; 6043 Lisp_Object lval;
6034 6044
6045 /* In the event that a C integer will always fit in an Emacs int, we don't
6046 ever want to store a C integer as an opaque pointer. This #ifdef
6047 eliminates a warning on AMD 64, where EMACS_INT has 63 value bits and C
6048 integers have 32 value bits. */
6049 #if INT_VALBITS <= INTBITS
6035 if (NUMBER_FITS_IN_AN_EMACS_INT (val)) 6050 if (NUMBER_FITS_IN_AN_EMACS_INT (val))
6036 lval = make_int (val); 6051 lval = make_int (val);
6037 else 6052 else
6038 lval = make_opaque_ptr ((void *) val); 6053 lval = make_opaque_ptr ((void *) val);
6054 #else /* !(INT_VALBITS < INTBITS) */
6055 lval = make_int (val);
6056 #endif /* INT_VALBITS <= INTBITS */
6057
6039 return record_unwind_protect (restore_int, noseeum_cons (opaque, lval)); 6058 return record_unwind_protect (restore_int, noseeum_cons (opaque, lval));
6040 } 6059 }
6041 6060
6042 /* Similar to specbind() but for any C variable whose value is an int. 6061 /* Similar to specbind() but for any C variable whose value is an int.
6043 Sets up an unwind-protect to restore the variable pointed to by 6062 Sets up an unwind-protect to restore the variable pointed to by