comparison src/alloc.c @ 9144:0e29f6a4fe7c

(Fmake_list, Fmake_vector, Fmake_string, make_event_array): Use type test macros.
author Karl Heuer <kwzh@gnu.org>
date Tue, 27 Sep 1994 03:16:02 +0000
parents 18b0314420d5
children e5ba7993d378
comparison
equal deleted inserted replaced
9143:069f8b6cdfe6 9144:0e29f6a4fe7c
568 register Lisp_Object length, init; 568 register Lisp_Object length, init;
569 { 569 {
570 register Lisp_Object val; 570 register Lisp_Object val;
571 register int size; 571 register int size;
572 572
573 if (XTYPE (length) != Lisp_Int || XINT (length) < 0) 573 if (!INTEGERP (length) || XINT (length) < 0)
574 length = wrong_type_argument (Qnatnump, length); 574 length = wrong_type_argument (Qnatnump, length);
575 size = XINT (length); 575 size = XINT (length);
576 576
577 val = Qnil; 577 val = Qnil;
578 while (size-- > 0) 578 while (size-- > 0)
592 { 592 {
593 register int sizei, index; 593 register int sizei, index;
594 register Lisp_Object vector; 594 register Lisp_Object vector;
595 register struct Lisp_Vector *p; 595 register struct Lisp_Vector *p;
596 596
597 if (XTYPE (length) != Lisp_Int || XINT (length) < 0) 597 if (!INTEGERP (length) || XINT (length) < 0)
598 length = wrong_type_argument (Qnatnump, length); 598 length = wrong_type_argument (Qnatnump, length);
599 sizei = XINT (length); 599 sizei = XINT (length);
600 600
601 p = (struct Lisp_Vector *) xmalloc (sizeof (struct Lisp_Vector) + (sizei - 1) * sizeof (Lisp_Object)); 601 p = (struct Lisp_Vector *) xmalloc (sizeof (struct Lisp_Vector) + (sizei - 1) * sizeof (Lisp_Object));
602 VALIDATE_LISP_STORAGE (p, 0); 602 VALIDATE_LISP_STORAGE (p, 0);
873 Lisp_Object length, init; 873 Lisp_Object length, init;
874 { 874 {
875 register Lisp_Object val; 875 register Lisp_Object val;
876 register unsigned char *p, *end, c; 876 register unsigned char *p, *end, c;
877 877
878 if (XTYPE (length) != Lisp_Int || XINT (length) < 0) 878 if (!INTEGERP (length) || XINT (length) < 0)
879 length = wrong_type_argument (Qnatnump, length); 879 length = wrong_type_argument (Qnatnump, length);
880 CHECK_NUMBER (init, 1); 880 CHECK_NUMBER (init, 1);
881 val = make_uninit_string (XINT (length)); 881 val = make_uninit_string (XINT (length));
882 c = XINT (init); 882 c = XINT (init);
883 p = XSTRING (val)->data; 883 p = XSTRING (val)->data;
973 973
974 for (i = 0; i < nargs; i++) 974 for (i = 0; i < nargs; i++)
975 /* The things that fit in a string 975 /* The things that fit in a string
976 are characters that are in 0...127, 976 are characters that are in 0...127,
977 after discarding the meta bit and all the bits above it. */ 977 after discarding the meta bit and all the bits above it. */
978 if (XTYPE (args[i]) != Lisp_Int 978 if (!INTEGERP (args[i])
979 || (XUINT (args[i]) & ~(-CHAR_META)) >= 0200) 979 || (XUINT (args[i]) & ~(-CHAR_META)) >= 0200)
980 return Fvector (nargs, args); 980 return Fvector (nargs, args);
981 981
982 /* Since the loop exited, we know that all the things in it are 982 /* Since the loop exited, we know that all the things in it are
983 characters, so we can make a string. */ 983 characters, so we can make a string. */