#include "syssignal.h"
-#ifdef MSDOS
-/* These are redefined (correctly, but differently) in values.h. */
-#undef INTBITS
-#undef LONGBITS
-#undef SHORTBITS
-#endif
-
#ifdef LISP_FLOAT_TYPE
#ifdef STDC_HEADERS
static Lisp_Object Qinteger, Qsymbol, Qstring, Qcons, Qmarker, Qoverlay;
static Lisp_Object Qfloat, Qwindow_configuration, Qprocess, Qwindow;
static Lisp_Object Qcompiled_function, Qbuffer, Qframe, Qvector;
+static Lisp_Object Qchar_table, Qbool_vector;
static Lisp_Object swap_in_symval_forwarding ();
return Qcompiled_function;
if (GC_BUFFERP (object))
return Qbuffer;
+ if (GC_CHAR_TABLE_P (object))
+ return Qchar_table;
+ if (GC_BOOL_VECTOR_P (object))
+ return Qbool_vector;
#ifdef MULTI_FRAME
if (GC_FRAMEP (object))
\f
/* Find the value of a symbol, returning Qunbound if it's not bound.
This is helpful for code which just wants to get a variable's value
- if it has one, without signalling an error.
+ if it has one, without signaling an error.
Note that it must not be possible to quit
within this function. Great care is required for this. */
tem = Fassq (sym, current_buffer->local_var_alist);
if (NILP (tem))
{
+ /* Swap out any local binding for some other buffer, and make
+ sure the current value is permanently recorded, if it's the
+ default value. */
+ find_symbol_value (sym);
+
current_buffer->local_var_alist
= Fcons (Fcons (sym, XCONS (XCONS (XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->cdr)->cdr)->cdr),
current_buffer->local_var_alist);
force it to look once again for this buffer's value */
{
Lisp_Object *pvalbuf;
+
valcontents = XSYMBOL (sym)->value;
+
pvalbuf = &XCONS (XBUFFER_LOCAL_VALUE (valcontents)->cdr)->car;
if (current_buffer == XBUFFER (*pvalbuf))
*pvalbuf = Qnil;
else if (BOOL_VECTOR_P (array))
{
int val;
- int bits_per_char = INTBITS / sizeof (int);
if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size)
args_out_of_range (array, idx);
- val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / bits_per_char];
- return (val & (1 << (idxval % bits_per_char)) ? Qt : Qnil);
+ val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR];
+ return (val & (1 << (idxval % BITS_PER_CHAR)) ? Qt : Qnil);
}
else if (CHAR_TABLE_P (array))
{
else if (BOOL_VECTOR_P (array))
{
int val;
- int bits_per_char = INTBITS / sizeof (int);
if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size)
args_out_of_range (array, idx);
- val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / bits_per_char];
+ val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR];
if (! NILP (newelt))
- val |= 1 << (idxval % bits_per_char);
+ val |= 1 << (idxval % BITS_PER_CHAR);
else
- val &= ~(1 << (idxval % bits_per_char));
- XBOOL_VECTOR (array)->data[idxval / bits_per_char] = val;
+ val &= ~(1 << (idxval % BITS_PER_CHAR));
+ XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR] = val;
}
else if (CHAR_TABLE_P (array))
{
fmod (f1, f2)
double f1, f2;
{
-#ifdef HAVE_DREM /* Some systems use this non-standard name. */
- return (drem (f1, f2));
-#else /* Other systems don't seem to have it at all. */
+ if (f2 < 0.0)
+ f2 = -f2;
return (f1 - f2 * floor (f1/f2));
-#endif
}
#endif /* ! HAVE_FMOD */
Qbuffer = intern ("buffer");
Qframe = intern ("frame");
Qvector = intern ("vector");
+ Qchar_table = intern ("char-table");
+ Qbool_vector = intern ("bool-vector");
staticpro (&Qinteger);
staticpro (&Qsymbol);
staticpro (&Qbuffer);
staticpro (&Qframe);
staticpro (&Qvector);
+ staticpro (&Qchar_table);
+ staticpro (&Qbool_vector);
defsubr (&Seq);
defsubr (&Snull);