aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorKarl Heuer1994-10-12 05:14:30 +0000
committerKarl Heuer1994-10-12 05:14:30 +0000
commit54dfdeb04f8dacacc3810d90503b4cfa63298948 (patch)
tree39b6181fcf3ec61d00165585e1cb6c97b1b1e8cd /src/buffer.c
parentc86160562afe6df205a3a5824003caa4229b091a (diff)
downloademacs-54dfdeb04f8dacacc3810d90503b4cfa63298948.tar.gz
emacs-54dfdeb04f8dacacc3810d90503b4cfa63298948.zip
(buffer_slot_type_mismatch): Take just the offset as argument. Only check
against types that are actually used.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/buffer.c b/src/buffer.c
index ccc0e1acf8b..0fd2e61f63e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2424,32 +2424,26 @@ evaporate_overlays (pos)
2424 Fdelete_overlay (XCONS (hit_list)->car); 2424 Fdelete_overlay (XCONS (hit_list)->car);
2425} 2425}
2426 2426
2427/* Somebody has tried to store NEWVAL into the buffer-local slot with 2427/* Somebody has tried to store a value with an unacceptable type
2428 offset XUINT (valcontents), and NEWVAL has an unacceptable type. */ 2428 into the buffer-local slot with offset OFFSET. */
2429void 2429void
2430buffer_slot_type_mismatch (valcontents, newval) 2430buffer_slot_type_mismatch (offset)
2431 Lisp_Object valcontents, newval; 2431 int offset;
2432{ 2432{
2433 unsigned int offset = XUINT (valcontents); 2433 Lisp_Object sym;
2434 unsigned char *symbol_name =
2435 (XSYMBOL (*(Lisp_Object *)(offset + (char *)&buffer_local_symbols))
2436 ->name->data);
2437 char *type_name; 2434 char *type_name;
2438 2435 sym = *(Lisp_Object *)(offset + (char *)&buffer_local_symbols);
2439 switch (XINT (*(Lisp_Object *)(offset + (char *)&buffer_local_types))) 2436 switch (XINT (*(Lisp_Object *)(offset + (char *)&buffer_local_types)))
2440 { 2437 {
2441 case Lisp_Int: type_name = "integers"; break; 2438 case Lisp_Int: type_name = "integers"; break;
2442 case Lisp_String: type_name = "strings"; break; 2439 case Lisp_String: type_name = "strings"; break;
2443 case Lisp_Misc: type_name = "markers"; break;
2444 case Lisp_Symbol: type_name = "symbols"; break; 2440 case Lisp_Symbol: type_name = "symbols"; break;
2445 case Lisp_Cons: type_name = "lists"; break;
2446 case Lisp_Vector: type_name = "vectors"; break;
2447 default: 2441 default:
2448 abort (); 2442 abort ();
2449 } 2443 }
2450 2444
2451 error ("only %s should be stored in the buffer-local variable %s", 2445 error ("only %s should be stored in the buffer-local variable %s",
2452 type_name, symbol_name); 2446 type_name, XSYMBOL (sym)->name->data);
2453} 2447}
2454 2448
2455init_buffer_once () 2449init_buffer_once ()