+2011-05-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * alloc.c (string_overflow): New function.
+ (Fmake_string): Use it. This doesn't change behavior, but saves
+ a few bytes and will simplify future changes.
+ * character.c (string_escape_byte8): Likewise.
+ * lisp.h (string_overflow): New decl.
+
2011-05-15 Paul Eggert <eggert@cs.ucla.edu>
Fixups, following up to the user-interface timestamp change.
current_sblock = tb;
}
+void
+string_overflow (void)
+{
+ error ("Maximum string size exceeded");
+}
DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0,
doc: /* Return a newly created string of length LENGTH, with INIT in each element.
EMACS_INT string_len = XINT (length);
if (string_len > MOST_POSITIVE_FIXNUM / len)
- error ("Maximum string size exceeded");
+ string_overflow ();
nbytes = len * string_len;
val = make_uninit_multibyte_string (string_len, nbytes);
p = SDATA (val);
{
if ((MOST_POSITIVE_FIXNUM - nchars) / 3 < byte8_count
|| (MOST_POSITIVE_FIXNUM - nbytes) / 2 < byte8_count)
- error ("Maximum string size exceeded");
+ string_overflow ();
/* Convert 2-byte sequence of byte8 chars to 4-byte octal. */
val = make_uninit_multibyte_string (nchars + byte8_count * 3,
else
{
if ((MOST_POSITIVE_FIXNUM - nchars) / 3 < byte8_count)
- error ("Maximum string size exceeded");
+ string_overflow ();
/* Convert 1-byte sequence of byte8 chars to 4-byte octal. */
val = make_uninit_string (nbytes + byte8_count * 3);
}
EXFUN (Fvector, MANY);
EXFUN (Fmake_symbol, 1);
EXFUN (Fmake_marker, 0);
+extern void string_overflow (void) NO_RETURN;
EXFUN (Fmake_string, 2);
extern Lisp_Object build_string (const char *);
extern Lisp_Object make_string (const char *, EMACS_INT);