+2014-01-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ Port to C89.
+ * data.c (arithcompare_driver):
+ * fileio.c (Fcar_less_than_car):
+ * fns.c (internal_equal):
+ * frame.c (delete_frame):
+ * lisp.h (enum More_Lisp_Bits):
+ * lread.c (read1):
+ Avoid C99 constructs that don't work in C89.
+ * data.c (ULL_MAX, count_trailing_zeros_ll): New macros,
+ to port to C89, which doesn't have 'long long'.
+ (count_trailing_zero_bits): Use them.
+
2014-01-03 Chong Yidong <cyd@gnu.org>
* doc.c (Fdocumentation): Remove dynamic-docstring-function.
arithcompare_driver (ptrdiff_t nargs, Lisp_Object *args,
enum Arith_Comparison comparison)
{
- for (ptrdiff_t argnum = 1; argnum < nargs; ++argnum)
+ ptrdiff_t argnum;
+ for (argnum = 1; argnum < nargs; ++argnum)
{
if (EQ (Qnil, arithcompare (args[argnum-1], args[argnum], comparison)))
return Qnil;
#if HAVE_UNSIGNED_LONG_LONG_INT
enum { BITS_PER_ULL = CHAR_BIT * sizeof (unsigned long long) };
+# define ULL_MAX ULLONG_MAX
#else
enum { BITS_PER_ULL = CHAR_BIT * sizeof (unsigned long) };
-# define ULLONG_MAX ULONG_MAX
+# define ULL_MAX ULONG_MAX
# define count_one_bits_ll count_one_bits_l
+# define count_trailing_zeros_ll count_trailing_zeros_l
#endif
/* Shift VAL right by the width of an unsigned long long.
return count_trailing_zeros (val);
if (BITS_WORD_MAX == ULONG_MAX)
return count_trailing_zeros_l (val);
- if (BITS_WORD_MAX == ULLONG_MAX)
+ if (BITS_WORD_MAX == ULL_MAX)
return count_trailing_zeros_ll (val);
/* The rest of this code is for the unlikely platform where bits_word differs
count < BITS_PER_BITS_WORD - BITS_PER_ULL;
count += BITS_PER_ULL)
{
- if (val & ULLONG_MAX)
+ if (val & ULL_MAX)
return count + count_trailing_zeros_ll (val);
val = shift_right_ull (val);
}
doc: /* Return t if (car A) is numerically less than (car B). */)
(Lisp_Object a, Lisp_Object b)
{
- Lisp_Object args[2] = { Fcar (a), Fcar (b), };
+ Lisp_Object args[2];
+ args[0] = Fcar (a);
+ args[1] = Fcar (b);
return Flss (2, args);
}
error ("Stack overflow in equal");
if (NILP (ht))
{
- Lisp_Object args[2] = { QCtest, Qeq };
+ Lisp_Object args[2];
+ args[0] = QCtest;
+ args[1] = Qeq;
ht = Fmake_hash_table (2, args);
}
switch (XTYPE (o1))
{
+ struct terminal *terminal;
block_input ();
if (FRAME_TERMINAL (f)->delete_frame_hook)
(*FRAME_TERMINAL (f)->delete_frame_hook) (f);
- struct terminal *terminal = FRAME_TERMINAL (f);
+ terminal = FRAME_TERMINAL (f);
f->output_data.nothing = 0;
f->terminal = 0; /* Now the frame is dead. */
unblock_input ();
/* Used to extract pseudovector subtype information. */
PSEUDOVECTOR_AREA_BITS = PSEUDOVECTOR_SIZE_BITS + PSEUDOVECTOR_REST_BITS,
- PVEC_TYPE_MASK = 0x3f << PSEUDOVECTOR_AREA_BITS,
+ PVEC_TYPE_MASK = 0x3f << PSEUDOVECTOR_AREA_BITS
};
\f
/* These functions extract various sorts of values from a Lisp_Object.
/* Accept compiled functions at read-time so that we don't have to
build them using function calls. */
Lisp_Object tmp;
+ struct Lisp_Vector *vec;
tmp = read_vector (readcharfun, 1);
- struct Lisp_Vector* vec = XVECTOR (tmp);
- if (vec->header.size==0)
+ vec = XVECTOR (tmp);
+ if (vec->header.size == 0)
invalid_syntax ("Empty byte-code object");
make_byte_code (vec);
return tmp;