comparison src/buffer.c @ 8818:0996472bb39d

(reset_buffer_local_variables, Fbuffer_local_variables) (init_buffer_once): Use EMACS_INT.
author Richard M. Stallman <rms@gnu.org>
date Sat, 17 Sep 1994 00:26:43 +0000
parents cf3233d70e94
children 41981db9ad8e
comparison
equal deleted inserted replaced
8817:48ff00bebef6 8818:0996472bb39d
349 /* For each slot that has a default value, 349 /* For each slot that has a default value,
350 copy that into the slot. */ 350 copy that into the slot. */
351 351
352 for (offset = (char *)&buffer_local_flags.name - (char *)&buffer_local_flags; 352 for (offset = (char *)&buffer_local_flags.name - (char *)&buffer_local_flags;
353 offset < sizeof (struct buffer); 353 offset < sizeof (struct buffer);
354 offset += sizeof (Lisp_Object)) /* sizeof int == sizeof Lisp_Object */ 354 offset += sizeof (Lisp_Object)) /* sizeof EMACS_INT == sizeof Lisp_Object */
355 if (*(int *)(offset + (char *) &buffer_local_flags) > 0 355 if (*(EMACS_INT *)(offset + (char *) &buffer_local_flags) > 0
356 || *(int *)(offset + (char *) &buffer_local_flags) == -2) 356 || *(EMACS_INT *)(offset + (char *) &buffer_local_flags) == -2)
357 *(Lisp_Object *)(offset + (char *)b) = 357 *(Lisp_Object *)(offset + (char *)b) =
358 *(Lisp_Object *)(offset + (char *)&buffer_defaults); 358 *(Lisp_Object *)(offset + (char *)&buffer_defaults);
359 } 359 }
360 360
361 /* We split this away from generate-new-buffer, because rename-buffer 361 /* We split this away from generate-new-buffer, because rename-buffer
477 { 477 {
478 register int offset, mask; 478 register int offset, mask;
479 479
480 for (offset = (char *)&buffer_local_symbols.name - (char *)&buffer_local_symbols; 480 for (offset = (char *)&buffer_local_symbols.name - (char *)&buffer_local_symbols;
481 offset < sizeof (struct buffer); 481 offset < sizeof (struct buffer);
482 offset += (sizeof (int))) /* sizeof int == sizeof Lisp_Object */ 482 offset += (sizeof (EMACS_INT))) /* sizeof EMACS_INT == sizeof Lisp_Object */
483 { 483 {
484 mask = *(int *)(offset + (char *) &buffer_local_flags); 484 mask = *(EMACS_INT *)(offset + (char *) &buffer_local_flags);
485 if (mask == -1 || (buf->local_var_flags & mask)) 485 if (mask == -1 || (buf->local_var_flags & mask))
486 if (XTYPE (*(Lisp_Object *)(offset + (char *)&buffer_local_symbols)) 486 if (XTYPE (*(Lisp_Object *)(offset + (char *)&buffer_local_symbols))
487 == Lisp_Symbol) 487 == Lisp_Symbol)
488 result = Fcons (Fcons (*(Lisp_Object *)(offset + (char *)&buffer_local_symbols), 488 result = Fcons (Fcons (*(Lisp_Object *)(offset + (char *)&buffer_local_symbols),
489 *(Lisp_Object *)(offset + (char *)buf)), 489 *(Lisp_Object *)(offset + (char *)buf)),
2370 The local flag is a bit that is used in the buffer 2370 The local flag is a bit that is used in the buffer
2371 to say that it has its own local value for the slot. 2371 to say that it has its own local value for the slot.
2372 The local flag bits are in the local_var_flags slot of the buffer. */ 2372 The local flag bits are in the local_var_flags slot of the buffer. */
2373 2373
2374 /* Nothing can work if this isn't true */ 2374 /* Nothing can work if this isn't true */
2375 if (sizeof (int) != sizeof (Lisp_Object)) abort (); 2375 if (sizeof (EMACS_INT) != sizeof (Lisp_Object)) abort ();
2376 2376
2377 /* 0 means not a lisp var, -1 means always local, else mask */ 2377 /* 0 means not a lisp var, -1 means always local, else mask */
2378 bzero (&buffer_local_flags, sizeof buffer_local_flags); 2378 bzero (&buffer_local_flags, sizeof buffer_local_flags);
2379 XFASTINT (buffer_local_flags.filename) = -1; 2379 XFASTINT (buffer_local_flags.filename) = -1;
2380 XFASTINT (buffer_local_flags.directory) = -1; 2380 XFASTINT (buffer_local_flags.directory) = -1;