]> code.delx.au - gnu-emacs/blobdiff - src/syntax.c
Don't say Fnext_read_file_uses_dialog_p is const
[gnu-emacs] / src / syntax.c
index df8800e90befc94d443fd4dc0319040329dfb759..2f821564294d61de1aff426db3d9a9d6dfaf325c 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU Emacs routines to deal with syntax tables; also word and list parsing.
-   Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2014 Free
+   Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2015 Free
    Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -137,9 +137,6 @@ enum
     ST_STRING_STYLE = 256 + 2
   };
 
-static Lisp_Object Qsyntax_table_p;
-static Lisp_Object Qsyntax_table, Qscan_error;
-
 /* This is the internal form of the parse state used in parse-partial-sexp.  */
 
 struct lisp_parse_state
@@ -825,7 +822,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
     {
       from = comment_end;
       from_byte = comment_end_byte;
-      UPDATE_SYNTAX_TABLE_FORWARD (comment_end - 1);
+      UPDATE_SYNTAX_TABLE_FORWARD (comment_end);
     }
   /* If comstart_pos is set and we get here (ie. didn't jump to `lossage'
      or `done'), then we've found the beginning of the non-nested comment.  */
@@ -1231,7 +1228,7 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
   syntax_code = XINT (first) & INT_MAX;
   code = syntax_code & 0377;
   start1 = SYNTAX_FLAGS_COMSTART_FIRST (syntax_code);
-  start2 = SYNTAX_FLAGS_COMSTART_SECOND (syntax_code);;
+  start2 = SYNTAX_FLAGS_COMSTART_SECOND (syntax_code);
   end1 = SYNTAX_FLAGS_COMEND_FIRST (syntax_code);
   end2 = SYNTAX_FLAGS_COMEND_SECOND (syntax_code);
   prefix = SYNTAX_FLAGS_PREFIX (syntax_code);
@@ -1567,6 +1564,7 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
   const unsigned char *str;
   int len;
   Lisp_Object iso_classes;
+  USE_SAFE_ALLOCA;
 
   CHECK_STRING (string);
   iso_classes = Qnil;
@@ -1699,7 +1697,7 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
          memcpy (himap, fastmap + 0200, 0200);
          himap[0200] = 0;
          memset (fastmap + 0200, 0, 0200);
-         char_ranges = alloca (sizeof *char_ranges * 128 * 2);
+         SAFE_NALLOCA (char_ranges, 2, 128);
          i = 0;
 
          while ((p1 = memchr (himap + i, 1, 0200 - i)))
@@ -1723,7 +1721,7 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
     }
   else                         /* STRING is multibyte */
     {
-      char_ranges = alloca (sizeof *char_ranges * SCHARS (string) * 2);
+      SAFE_NALLOCA (char_ranges, 2, SCHARS (string));
 
       while (i_byte < size_byte)
        {
@@ -2032,6 +2030,7 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
     SET_PT_BOTH (pos, pos_byte);
     immediate_quit = 0;
 
+    SAFE_FREE ();
     return make_number (PT - start_point);
   }
 }
@@ -3498,11 +3497,6 @@ init_syntax_once (void)
   /* This has to be done here, before we call Fmake_char_table.  */
   DEFSYM (Qsyntax_table, "syntax-table");
 
-  /* This variable is DEFSYMed in alloc.c and not initialized yet, so
-     intern it here.  NOTE: you must guarantee that init_syntax_once
-     is called before all other users of this variable.  */
-  Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots");
-
   /* Create objects which can be shared among syntax tables.  */
   Vsyntax_code_object = make_uninit_vector (Smax);
   for (i = 0; i < Smax; i++)