changeset 9953:e0672d4cf470

(Fmake_list, Fmake_vector, Fmake_string): Use CHECK_NATNUM instead of its expansion.
author Karl Heuer <kwzh@gnu.org>
date Wed, 16 Nov 1994 00:30:25 +0000
parents 9daedd94a204
children 18b408b05189
files src/alloc.c
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Tue Nov 15 23:55:26 1994 +0000
+++ b/src/alloc.c	Wed Nov 16 00:30:25 1994 +0000
@@ -570,9 +570,8 @@
   register Lisp_Object val;
   register int size;
 
-  if (!INTEGERP (length) || XINT (length) < 0)
-    length = wrong_type_argument (Qnatnump, length);
-  size = XINT (length);
+  CHECK_NATNUM (length, 0);
+  size = XFASTINT (length);
 
   val = Qnil;
   while (size-- > 0)
@@ -594,9 +593,8 @@
   register Lisp_Object vector;
   register struct Lisp_Vector *p;
 
-  if (!INTEGERP (length) || XINT (length) < 0)
-    length = wrong_type_argument (Qnatnump, length);
-  sizei = XINT (length);
+  CHECK_NATNUM (length, 0);
+  sizei = XFASTINT (length);
 
   p = (struct Lisp_Vector *) xmalloc (sizeof (struct Lisp_Vector) + (sizei - 1) * sizeof (Lisp_Object));
   VALIDATE_LISP_STORAGE (p, 0);
@@ -885,10 +883,9 @@
   register Lisp_Object val;
   register unsigned char *p, *end, c;
 
-  if (!INTEGERP (length) || XINT (length) < 0)
-    length = wrong_type_argument (Qnatnump, length);
+  CHECK_NATNUM (length, 0);
   CHECK_NUMBER (init, 1);
-  val = make_uninit_string (XINT (length));
+  val = make_uninit_string (XFASTINT (length));
   c = XINT (init);
   p = XSTRING (val)->data;
   end = p + XSTRING (val)->size;