/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
- Copyright (C) 1985,86,88,93,94,95,97,98,99, 2000, 2001
+ Copyright (C) 1985,86,88,93,94,95,97,98,99, 2000, 2001, 2003
Free Software Foundation, Inc.
This file is part of GNU Emacs.
Lisp_Object type;
type = PER_BUFFER_TYPE (offset);
- if (XINT (type) == -1)
- error ("Variable %s is read-only", SDATA (SYMBOL_NAME (symbol)));
-
if (! NILP (type) && ! NILP (newval)
&& XTYPE (newval) != XINT (type))
buffer_slot_type_mismatch (offset);
let_shadows_buffer_binding_p (symbol)
Lisp_Object symbol;
{
- struct specbinding *p;
+ volatile struct specbinding *p;
for (p = specpdl_ptr - 1; p >= specpdl; p--)
if (p->func == NULL
loaded, recompute its value. We have to do it now, or else
forwarded objects won't work right. */
{
- Lisp_Object *pvalbuf;
+ Lisp_Object *pvalbuf, buf;
valcontents = SYMBOL_VALUE (variable);
pvalbuf = &XBUFFER_LOCAL_VALUE (valcontents)->buffer;
- if (current_buffer == XBUFFER (*pvalbuf))
+ XSETBUFFER (buf, current_buffer);
+ if (EQ (buf, *pvalbuf))
{
*pvalbuf = Qnil;
XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0;
}
else if (STRING_MULTIBYTE (array))
{
- int idxval_byte, prev_bytes, new_bytes;
+ int idxval_byte, prev_bytes, new_bytes, nbytes;
unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1;
if (idxval < 0 || idxval >= SCHARS (array))
args_out_of_range (array, idx);
CHECK_NUMBER (newelt);
+ nbytes = SBYTES (array);
+
idxval_byte = string_char_to_byte (array, idxval);
p1 = SDATA (array) + idxval_byte;
PARSE_MULTIBYTE_SEQ (p1, nbytes - idxval_byte, prev_bytes);
{
/* We must relocate the string data. */
int nchars = SCHARS (array);
- int nbytes = SBYTES (array);
unsigned char *str;
str = (nbytes <= MAX_ALLOCA
long_to_cons (i)
unsigned long i;
{
- unsigned int top = i >> 16;
+ unsigned long top = i >> 16;
unsigned int bot = i & 0xFFFF;
if (top == 0)
return make_number (bot);
}
DEFUN ("string-to-number", Fstring_to_number, Sstring_to_number, 1, 2, 0,
- doc: /* Return a number obtained by parsing STRING as a decimal number.
+ doc: /* Parse STRING as a decimal number and return the number.
This parses both integers and floating point numbers.
It ignores leading spaces and tabs.
}
DEFUN ("-", Fminus, Sminus, 0, MANY, 0,
- doc: /* Negate number or subtract numbers or markers, returns the result.
+ doc: /* Negate number or subtract numbers or markers and return the result.
With one arg, negates it. With more than one arg,
subtracts all but the first from the first.
usage: (- &optional NUMBER-OR-MARKER &rest MORE-NUMBERS-OR-MARKERS) */)