changeset 9149:fe6b30db719d

(readchar, readchar, unreadchar, read_filtered_event, Fread, read0, read1, read_list, check_obarray, intern, Fintern, Fintern_soft, oblookup, init_lread): Use type test macros.
author Karl Heuer <kwzh@gnu.org>
date Tue, 27 Sep 1994 04:10:43 +0000
parents e7ab930bb7eb
children 642bbaf7c3fc
files src/lread.c
diffstat 1 files changed, 26 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/src/lread.c	Tue Sep 27 04:03:15 1994 +0000
+++ b/src/lread.c	Tue Sep 27 04:10:43 1994 +0000
@@ -113,7 +113,7 @@
   register struct buffer *inbuffer;
   register int c, mpos;
 
-  if (XTYPE (readcharfun) == Lisp_Buffer)
+  if (BUFFERP (readcharfun))
     {
       inbuffer = XBUFFER (readcharfun);
 
@@ -124,7 +124,7 @@
 
       return c;
     }
-  if (XTYPE (readcharfun) == Lisp_Marker)
+  if (MARKERP (readcharfun))
     {
       inbuffer = XMARKER (readcharfun)->buffer;
 
@@ -154,7 +154,7 @@
       return c;
     }
 
-  if (XTYPE (readcharfun) == Lisp_String)
+  if (STRINGP (readcharfun))
     {
       register int c;
       /* This used to be return of a conditional expression,
@@ -185,16 +185,16 @@
     /* Don't back up the pointer if we're unreading the end-of-input mark,
        since readchar didn't advance it when we read it.  */
     ;
-  else if (XTYPE (readcharfun) == Lisp_Buffer)
+  else if (BUFFERP (readcharfun))
     {
       if (XBUFFER (readcharfun) == current_buffer)
 	SET_PT (point - 1);
       else
 	SET_BUF_PT (XBUFFER (readcharfun), BUF_PT (XBUFFER (readcharfun)) - 1);
     }
-  else if (XTYPE (readcharfun) == Lisp_Marker)
+  else if (MARKERP (readcharfun))
     XMARKER (readcharfun)->bufpos--;
-  else if (XTYPE (readcharfun) == Lisp_String)
+  else if (STRINGP (readcharfun))
     read_from_string_index--;
   else if (EQ (readcharfun, Qget_file_char))
     ungetc (c, instream);
@@ -237,7 +237,7 @@
  retry:
   val = read_char (0, 0, 0, Qnil, 0);
 
-  if (XTYPE (val) == Lisp_Buffer)
+  if (BUFFERP (val))
     goto retry;
 
   /* switch-frame events are put off until after the next ASCII
@@ -256,7 +256,7 @@
   if (ascii_required)
     {
       /* Convert certain symbols to their ASCII equivalents.  */
-      if (XTYPE (val) == Lisp_Symbol)
+      if (SYMBOLP (val))
 	{
 	  Lisp_Object tem, tem1, tem2;
 	  tem = Fget (val, Qevent_symbol_element_mask);
@@ -271,7 +271,7 @@
 	}
 	  
       /* If we don't have a character now, deal with it appropriately.  */
-      if (XTYPE (val) != Lisp_Int)
+      if (!INTEGERP (val))
 	{
 	  if (error_nonascii)
 	    {
@@ -885,7 +885,7 @@
     return Fread_minibuffer (build_string ("Lisp expression: "), Qnil);
 #endif
 
-  if (XTYPE (readcharfun) == Lisp_String)
+  if (STRINGP (readcharfun))
     return Fcar (Fread_from_string (readcharfun, Qnil, Qnil));
 
   return read0 (readcharfun);
@@ -939,7 +939,7 @@
   char c;
 
   val = read1 (readcharfun);
-  if (XTYPE (val) == Lisp_Internal)
+  if (INTERNALP (val))
     {
       c = XINT (val);
       return Fsignal (Qinvalid_read_syntax, Fcons (make_string (&c, 1), Qnil));
@@ -1152,7 +1152,7 @@
 
 	  /* Read the string itself.  */
 	  tmp = read1 (readcharfun);
-	  if (XTYPE (tmp) != Lisp_String)
+	  if (!STRINGP (tmp))
 	    Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#", 1), Qnil));
 	  GCPRO1 (tmp);
 	  /* Read the intervals and their properties.  */
@@ -1161,19 +1161,19 @@
 	      Lisp_Object beg, end, plist;
 
 	      beg = read1 (readcharfun);
-	      if (XTYPE (beg) == Lisp_Internal)
+	      if (INTERNALP (beg))
 		{
 		  if (XINT (beg) == ')')
 		    break;
 		  Fsignal (Qinvalid_read_syntax, Fcons (make_string ("invalid string property list", 28), Qnil));
 		}
 	      end = read1 (readcharfun);
-	      if (XTYPE (end) == Lisp_Internal)
+	      if (INTERNALP (end))
 		Fsignal (Qinvalid_read_syntax,
 			 Fcons (make_string ("invalid string property list", 28), Qnil));
 		
 	      plist = read1 (readcharfun);
-	      if (XTYPE (plist) == Lisp_Internal)
+	      if (INTERNALP (plist))
 		Fsignal (Qinvalid_read_syntax,
 			 Fcons (make_string ("invalid string property list", 28), Qnil));
 	      Fset_text_properties (beg, end, plist, tmp);
@@ -1480,7 +1480,7 @@
       GCPRO2 (val, tail);
       elt = read1 (readcharfun);
       UNGCPRO;
-      if (XTYPE (elt) == Lisp_Internal)
+      if (INTERNALP (elt))
 	{
 	  if (flag > 0)
 	    {
@@ -1499,7 +1499,7 @@
 		val = read0 (readcharfun);
 	      elt = read1 (readcharfun);
 	      UNGCPRO;
-	      if (XTYPE (elt) == Lisp_Internal && XINT (elt) == ')')
+	      if (INTERNALP (elt) && XINT (elt) == ')')
 		return val;
 	      return Fsignal (Qinvalid_read_syntax, Fcons (make_string (". in wrong context", 18), Qnil));
 	    }
@@ -1527,7 +1527,7 @@
 check_obarray (obarray)
      Lisp_Object obarray;
 {
-  while (XTYPE (obarray) != Lisp_Vector || XVECTOR (obarray)->size == 0)
+  while (!VECTORP (obarray) || XVECTOR (obarray)->size == 0)
     {
       /* If Vobarray is now invalid, force it to be valid.  */
       if (EQ (Vobarray, obarray)) Vobarray = initial_obarray;
@@ -1549,10 +1549,10 @@
   Lisp_Object obarray;
 
   obarray = Vobarray;
-  if (XTYPE (obarray) != Lisp_Vector || XVECTOR (obarray)->size == 0)
+  if (!VECTORP (obarray) || XVECTOR (obarray)->size == 0)
     obarray = check_obarray (obarray);
   tem = oblookup (obarray, str, len);
-  if (XTYPE (tem) == Lisp_Symbol)
+  if (SYMBOLP (tem))
     return tem;
   return Fintern ((!NILP (Vpurify_flag)
 		   ? make_pure_string (str, len)
@@ -1576,7 +1576,7 @@
   CHECK_STRING (str, 0);
 
   tem = oblookup (obarray, XSTRING (str)->data, XSTRING (str)->size);
-  if (XTYPE (tem) != Lisp_Int)
+  if (!INTEGERP (tem))
     return tem;
 
   if (!NILP (Vpurify_flag))
@@ -1584,7 +1584,7 @@
   sym = Fmake_symbol (str);
 
   ptr = &XVECTOR (obarray)->contents[XINT (tem)];
-  if (XTYPE (*ptr) == Lisp_Symbol)
+  if (SYMBOLP (*ptr))
     XSYMBOL (sym)->next = XSYMBOL (*ptr);
   else
     XSYMBOL (sym)->next = 0;
@@ -1607,7 +1607,7 @@
   CHECK_STRING (str, 0);
 
   tem = oblookup (obarray, XSTRING (str)->data, XSTRING (str)->size);
-  if (XTYPE (tem) != Lisp_Int)
+  if (!INTEGERP (tem))
     return tem;
   return Qnil;
 }
@@ -1623,7 +1623,7 @@
   register Lisp_Object tail;
   Lisp_Object bucket, tem;
 
-  if (XTYPE (obarray) != Lisp_Vector
+  if (!VECTORP (obarray)
       || (obsize = XVECTOR (obarray)->size) == 0)
     {
       obarray = check_obarray (obarray);
@@ -1635,7 +1635,7 @@
   bucket = XVECTOR (obarray)->contents[hash];
   if (XFASTINT (bucket) == 0)
     ;
-  else if (XTYPE (bucket) != Lisp_Symbol)
+  else if (!SYMBOLP (bucket))
     error ("Bad data in guts of obarray"); /* Like CADR error message */
   else for (tail = bucket; ; XSET (tail, Lisp_Symbol, XSYMBOL (tail)->next))
       {
@@ -1921,7 +1921,7 @@
       {
 	Lisp_Object dirfile;
 	dirfile = Fcar (path_tail);
-	if (XTYPE (dirfile) == Lisp_String)
+	if (STRINGP (dirfile))
 	  {
 	    dirfile = Fdirectory_file_name (dirfile);
 	    if (access (XSTRING (dirfile)->data, 0) < 0)