diff src/data.c @ 86285:59344cb482f3

* lisp.h (struct Lisp_Buffer_Objfwd): Add a `slottype' field. * data.c (store_symval_forwarding): Get type from buffer_objfwd. Update call to buffer_slot_type_mismatch. * buffer.h (buffer_local_types, PER_BUFFER_TYPE): Remove. (buffer_slot_type_mismatch): Update. * buffer.c (buffer_local_types): Remove. (buffer_slot_type_mismatch): Get the symbol and type as arguments. (defvar_per_buffer): Set the type in the buffer_objfwd.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 21 Nov 2007 20:59:47 +0000
parents 0ec5ce87b9e0
children eba0d96e791f
line wrap: on
line diff
--- a/src/data.c	Wed Nov 21 20:37:22 2007 +0000
+++ b/src/data.c	Wed Nov 21 20:59:47 2007 +0000
@@ -930,7 +930,7 @@
 	  break;
 
 	case Lisp_Misc_Boolfwd:
-	  *XBOOLFWD (valcontents)->boolvar = NILP (newval) ? 0 : 1;
+	  *XBOOLFWD (valcontents)->boolvar = !NILP (newval);
 	  break;
 
 	case Lisp_Misc_Objfwd:
@@ -970,12 +970,11 @@
 	case Lisp_Misc_Buffer_Objfwd:
 	  {
 	    int offset = XBUFFER_OBJFWD (valcontents)->offset;
-	    Lisp_Object type;
-
-	    type = PER_BUFFER_TYPE (offset);
+	    Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype;
+
 	    if (! NILP (type) && ! NILP (newval)
 		&& XTYPE (newval) != XINT (type))
-	      buffer_slot_type_mismatch (offset);
+	      buffer_slot_type_mismatch (symbol, XINT (type));
 
 	    if (buf == NULL)
 	      buf = current_buffer;