comparison src/buffer.c @ 9464:4bb620c9a075

(buffer_slot_type_mismatch): Take just the offset as argument. Only check against types that are actually used.
author Karl Heuer <kwzh@gnu.org>
date Wed, 12 Oct 1994 05:14:30 +0000
parents d9dc17134dde
children 833a19698ef3
comparison
equal deleted inserted replaced
9463:a40af805e036 9464:4bb620c9a075
2422 } 2422 }
2423 for (; CONSP (hit_list); hit_list = XCONS (hit_list)->cdr) 2423 for (; CONSP (hit_list); hit_list = XCONS (hit_list)->cdr)
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. */
2429 void 2429 void
2430 buffer_slot_type_mismatch (valcontents, newval) 2430 buffer_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
2455 init_buffer_once () 2449 init_buffer_once ()
2456 { 2450 {
2457 register Lisp_Object tem; 2451 register Lisp_Object tem;