XEmacs 21.2.30 "Hygeia".
[chise/xemacs-chise.git-] / src / lread.c
index 08c6c79..a1f9ec9 100644 (file)
@@ -218,14 +218,14 @@ EXFUN (Fread_from_string, 3);
 \f
 
 static DOESNT_RETURN
-syntax_error (CONST char *string)
+syntax_error (const char *string)
 {
   signal_error (Qinvalid_read_syntax,
                list1 (build_translated_string (string)));
 }
 
 static Lisp_Object
-continuable_syntax_error (CONST char *string)
+continuable_syntax_error (const char *string)
 {
   return Fsignal (Qinvalid_read_syntax,
                  list1 (build_translated_string (string)));
@@ -676,7 +676,7 @@ encoding detection or end-of-line detection.
   {
     /* Lisp_Object's must be malloc'ed, not stack-allocated */
     Lisp_Object lispstream = Qnil;
-    CONST int block_size = 8192;
+    const int block_size = 8192;
     struct gcpro ngcpro1;
 
     NGCPRO1 (lispstream);
@@ -903,17 +903,18 @@ locate_file_find_directory_hash_table (Lisp_Object directory)
    nil, a list, or a string (for backward compatibility), with the
    following semantics:
 
-   a) nil    - no suffix, just search for file name intact (semantically
-               different from "empty suffix list")
+   a) nil    - no suffix, just search for file name intact
+               (semantically different from "empty suffix list", which
+               would be meaningless.)
    b) list   - list of suffixes to append to file name.  Each of these
                must be a string.
    c) string - colon-separated suffixes to append to file name (backward
                compatibility).
 
-   All of this got hairy, so I decided to use write a mapper.  Calling
-   a function for each suffix shouldn't slow things down, since
-   locate_file is rarely call with enough suffixes for it to make a
-   difference.  */
+   All of this got hairy, so I decided to use a mapper.  Calling a
+   function for each suffix shouldn't slow things down, since
+   locate_file is rarely called with enough suffixes for funcalls to
+   make any difference.  */
 
 /* Map FUN over SUFFIXES, as described above.  FUN will be called with a
    char * containing the current file name, and ARG.  Mapping stops when
@@ -977,12 +978,12 @@ locate_file_map_suffixes (Lisp_Object filename, Lisp_Object suffixes,
   else
     {
       /* Case c) */
-      CONST char *nsuffix = (CONST char *) XSTRING_DATA (suffixes);
+      const char *nsuffix = (const char *) XSTRING_DATA (suffixes);
 
       while (1)
        {
          char *esuffix = (char *) strchr (nsuffix, ':');
-         int lsuffix = ((esuffix) ? (esuffix - nsuffix) : strlen (nsuffix));
+         int lsuffix = esuffix ? esuffix - nsuffix : strlen (nsuffix);
 
          /* Concatenate path element/specified name with the suffix.  */
          strncpy (fn + fn_len, nsuffix, lsuffix);
@@ -1869,7 +1870,7 @@ read_atom_0 (Lisp_Object readcharfun, Emchar firstchar, int *saw_a_backslash)
   return Lstream_byte_count (XLSTREAM (Vread_buffer_stream)) - 1;
 }
 
-static Lisp_Object parse_integer (CONST Bufbyte *buf, Bytecount len, int base);
+static Lisp_Object parse_integer (const Bufbyte *buf, Bytecount len, int base);
 
 static Lisp_Object
 read_atom (Lisp_Object readcharfun,
@@ -1949,10 +1950,10 @@ read_atom (Lisp_Object readcharfun,
 
 
 static Lisp_Object
-parse_integer (CONST Bufbyte *buf, Bytecount len, int base)
+parse_integer (const Bufbyte *buf, Bytecount len, int base)
 {
-  CONST Bufbyte *lim = buf + len;
-  CONST Bufbyte *p = buf;
+  const Bufbyte *lim = buf + len;
+  const Bufbyte *p = buf;
   EMACS_UINT num = 0;
   int negativland = 0;
 
@@ -2035,6 +2036,7 @@ read_bit_vector (Lisp_Object readcharfun)
 {
   unsigned_char_dynarr *dyn = Dynarr_new (unsigned_char);
   Emchar c;
+  Lisp_Object val;
 
   while (1)
     {
@@ -2047,8 +2049,12 @@ read_bit_vector (Lisp_Object readcharfun)
   if (c >= 0)
     unreadchar (readcharfun, c);
 
-  return make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0),
-                                          Dynarr_length (dyn));
+  val = make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0),
+                                         Dynarr_length (dyn));
+
+  Dynarr_free (dyn);
+
+  return val;
 }
 
 \f
@@ -2690,10 +2696,10 @@ retry:
 #define EXP_INT 16
 
 int
-isfloat_string (CONST char *cp)
+isfloat_string (const char *cp)
 {
   int state = 0;
-  CONST Bufbyte *ucp = (CONST Bufbyte *) cp;
+  const Bufbyte *ucp = (const Bufbyte *) cp;
 
   if (*ucp == '+' || *ucp == '-')
     ucp++;
@@ -2996,7 +3002,7 @@ read_vector (Lisp_Object readcharfun,
        i < len;
        i++, p++)
   {
-    struct Lisp_Cons *otem = XCONS (tem);
+    Lisp_Cons *otem = XCONS (tem);
     tem = Fcar (tem);
     *p = tem;
     tem = otem->cdr;
@@ -3028,7 +3034,7 @@ read_compiled_function (Lisp_Object readcharfun, Emchar terminator)
 
   for (iii = 0; CONSP (stuff); iii++)
     {
-      struct Lisp_Cons *victim = XCONS (stuff);
+      Lisp_Cons *victim = XCONS (stuff);
       make_byte_code_args[iii] = Fcar (stuff);
       if ((purify_flag || load_force_doc_strings)
           && CONSP (make_byte_code_args[iii])