diff options
| author | Karl Heuer | 1994-09-27 04:10:43 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-09-27 04:10:43 +0000 |
| commit | cfff016d4c62e864dfc9be4f92bca3edb01d5da2 (patch) | |
| tree | 33c9cffacf56c97fcf705704db3df2ed4dabc488 /src | |
| parent | 90165123fc58546a8dcdbafed638fcf72ba50cb8 (diff) | |
| download | emacs-cfff016d4c62e864dfc9be4f92bca3edb01d5da2.tar.gz emacs-cfff016d4c62e864dfc9be4f92bca3edb01d5da2.zip | |
(readchar, readchar, unreadchar, read_filtered_event, Fread, read0, read1,
read_list, check_obarray, intern, Fintern, Fintern_soft, oblookup,
init_lread): Use type test macros.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/lread.c b/src/lread.c index 4ae0fcbf21b..ac0fed9022e 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -113,7 +113,7 @@ readchar (readcharfun) | |||
| 113 | register struct buffer *inbuffer; | 113 | register struct buffer *inbuffer; |
| 114 | register int c, mpos; | 114 | register int c, mpos; |
| 115 | 115 | ||
| 116 | if (XTYPE (readcharfun) == Lisp_Buffer) | 116 | if (BUFFERP (readcharfun)) |
| 117 | { | 117 | { |
| 118 | inbuffer = XBUFFER (readcharfun); | 118 | inbuffer = XBUFFER (readcharfun); |
| 119 | 119 | ||
| @@ -124,7 +124,7 @@ readchar (readcharfun) | |||
| 124 | 124 | ||
| 125 | return c; | 125 | return c; |
| 126 | } | 126 | } |
| 127 | if (XTYPE (readcharfun) == Lisp_Marker) | 127 | if (MARKERP (readcharfun)) |
| 128 | { | 128 | { |
| 129 | inbuffer = XMARKER (readcharfun)->buffer; | 129 | inbuffer = XMARKER (readcharfun)->buffer; |
| 130 | 130 | ||
| @@ -154,7 +154,7 @@ readchar (readcharfun) | |||
| 154 | return c; | 154 | return c; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | if (XTYPE (readcharfun) == Lisp_String) | 157 | if (STRINGP (readcharfun)) |
| 158 | { | 158 | { |
| 159 | register int c; | 159 | register int c; |
| 160 | /* This used to be return of a conditional expression, | 160 | /* This used to be return of a conditional expression, |
| @@ -185,16 +185,16 @@ unreadchar (readcharfun, c) | |||
| 185 | /* Don't back up the pointer if we're unreading the end-of-input mark, | 185 | /* Don't back up the pointer if we're unreading the end-of-input mark, |
| 186 | since readchar didn't advance it when we read it. */ | 186 | since readchar didn't advance it when we read it. */ |
| 187 | ; | 187 | ; |
| 188 | else if (XTYPE (readcharfun) == Lisp_Buffer) | 188 | else if (BUFFERP (readcharfun)) |
| 189 | { | 189 | { |
| 190 | if (XBUFFER (readcharfun) == current_buffer) | 190 | if (XBUFFER (readcharfun) == current_buffer) |
| 191 | SET_PT (point - 1); | 191 | SET_PT (point - 1); |
| 192 | else | 192 | else |
| 193 | SET_BUF_PT (XBUFFER (readcharfun), BUF_PT (XBUFFER (readcharfun)) - 1); | 193 | SET_BUF_PT (XBUFFER (readcharfun), BUF_PT (XBUFFER (readcharfun)) - 1); |
| 194 | } | 194 | } |
| 195 | else if (XTYPE (readcharfun) == Lisp_Marker) | 195 | else if (MARKERP (readcharfun)) |
| 196 | XMARKER (readcharfun)->bufpos--; | 196 | XMARKER (readcharfun)->bufpos--; |
| 197 | else if (XTYPE (readcharfun) == Lisp_String) | 197 | else if (STRINGP (readcharfun)) |
| 198 | read_from_string_index--; | 198 | read_from_string_index--; |
| 199 | else if (EQ (readcharfun, Qget_file_char)) | 199 | else if (EQ (readcharfun, Qget_file_char)) |
| 200 | ungetc (c, instream); | 200 | ungetc (c, instream); |
| @@ -237,7 +237,7 @@ read_filtered_event (no_switch_frame, ascii_required, error_nonascii) | |||
| 237 | retry: | 237 | retry: |
| 238 | val = read_char (0, 0, 0, Qnil, 0); | 238 | val = read_char (0, 0, 0, Qnil, 0); |
| 239 | 239 | ||
| 240 | if (XTYPE (val) == Lisp_Buffer) | 240 | if (BUFFERP (val)) |
| 241 | goto retry; | 241 | goto retry; |
| 242 | 242 | ||
| 243 | /* switch-frame events are put off until after the next ASCII | 243 | /* switch-frame events are put off until after the next ASCII |
| @@ -256,7 +256,7 @@ read_filtered_event (no_switch_frame, ascii_required, error_nonascii) | |||
| 256 | if (ascii_required) | 256 | if (ascii_required) |
| 257 | { | 257 | { |
| 258 | /* Convert certain symbols to their ASCII equivalents. */ | 258 | /* Convert certain symbols to their ASCII equivalents. */ |
| 259 | if (XTYPE (val) == Lisp_Symbol) | 259 | if (SYMBOLP (val)) |
| 260 | { | 260 | { |
| 261 | Lisp_Object tem, tem1, tem2; | 261 | Lisp_Object tem, tem1, tem2; |
| 262 | tem = Fget (val, Qevent_symbol_element_mask); | 262 | tem = Fget (val, Qevent_symbol_element_mask); |
| @@ -271,7 +271,7 @@ read_filtered_event (no_switch_frame, ascii_required, error_nonascii) | |||
| 271 | } | 271 | } |
| 272 | 272 | ||
| 273 | /* If we don't have a character now, deal with it appropriately. */ | 273 | /* If we don't have a character now, deal with it appropriately. */ |
| 274 | if (XTYPE (val) != Lisp_Int) | 274 | if (!INTEGERP (val)) |
| 275 | { | 275 | { |
| 276 | if (error_nonascii) | 276 | if (error_nonascii) |
| 277 | { | 277 | { |
| @@ -885,7 +885,7 @@ STREAM or the value of `standard-input' may be:\n\ | |||
| 885 | return Fread_minibuffer (build_string ("Lisp expression: "), Qnil); | 885 | return Fread_minibuffer (build_string ("Lisp expression: "), Qnil); |
| 886 | #endif | 886 | #endif |
| 887 | 887 | ||
| 888 | if (XTYPE (readcharfun) == Lisp_String) | 888 | if (STRINGP (readcharfun)) |
| 889 | return Fcar (Fread_from_string (readcharfun, Qnil, Qnil)); | 889 | return Fcar (Fread_from_string (readcharfun, Qnil, Qnil)); |
| 890 | 890 | ||
| 891 | return read0 (readcharfun); | 891 | return read0 (readcharfun); |
| @@ -939,7 +939,7 @@ read0 (readcharfun) | |||
| 939 | char c; | 939 | char c; |
| 940 | 940 | ||
| 941 | val = read1 (readcharfun); | 941 | val = read1 (readcharfun); |
| 942 | if (XTYPE (val) == Lisp_Internal) | 942 | if (INTERNALP (val)) |
| 943 | { | 943 | { |
| 944 | c = XINT (val); | 944 | c = XINT (val); |
| 945 | return Fsignal (Qinvalid_read_syntax, Fcons (make_string (&c, 1), Qnil)); | 945 | return Fsignal (Qinvalid_read_syntax, Fcons (make_string (&c, 1), Qnil)); |
| @@ -1152,7 +1152,7 @@ read1 (readcharfun) | |||
| 1152 | 1152 | ||
| 1153 | /* Read the string itself. */ | 1153 | /* Read the string itself. */ |
| 1154 | tmp = read1 (readcharfun); | 1154 | tmp = read1 (readcharfun); |
| 1155 | if (XTYPE (tmp) != Lisp_String) | 1155 | if (!STRINGP (tmp)) |
| 1156 | Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#", 1), Qnil)); | 1156 | Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#", 1), Qnil)); |
| 1157 | GCPRO1 (tmp); | 1157 | GCPRO1 (tmp); |
| 1158 | /* Read the intervals and their properties. */ | 1158 | /* Read the intervals and their properties. */ |
| @@ -1161,19 +1161,19 @@ read1 (readcharfun) | |||
| 1161 | Lisp_Object beg, end, plist; | 1161 | Lisp_Object beg, end, plist; |
| 1162 | 1162 | ||
| 1163 | beg = read1 (readcharfun); | 1163 | beg = read1 (readcharfun); |
| 1164 | if (XTYPE (beg) == Lisp_Internal) | 1164 | if (INTERNALP (beg)) |
| 1165 | { | 1165 | { |
| 1166 | if (XINT (beg) == ')') | 1166 | if (XINT (beg) == ')') |
| 1167 | break; | 1167 | break; |
| 1168 | Fsignal (Qinvalid_read_syntax, Fcons (make_string ("invalid string property list", 28), Qnil)); | 1168 | Fsignal (Qinvalid_read_syntax, Fcons (make_string ("invalid string property list", 28), Qnil)); |
| 1169 | } | 1169 | } |
| 1170 | end = read1 (readcharfun); | 1170 | end = read1 (readcharfun); |
| 1171 | if (XTYPE (end) == Lisp_Internal) | 1171 | if (INTERNALP (end)) |
| 1172 | Fsignal (Qinvalid_read_syntax, | 1172 | Fsignal (Qinvalid_read_syntax, |
| 1173 | Fcons (make_string ("invalid string property list", 28), Qnil)); | 1173 | Fcons (make_string ("invalid string property list", 28), Qnil)); |
| 1174 | 1174 | ||
| 1175 | plist = read1 (readcharfun); | 1175 | plist = read1 (readcharfun); |
| 1176 | if (XTYPE (plist) == Lisp_Internal) | 1176 | if (INTERNALP (plist)) |
| 1177 | Fsignal (Qinvalid_read_syntax, | 1177 | Fsignal (Qinvalid_read_syntax, |
| 1178 | Fcons (make_string ("invalid string property list", 28), Qnil)); | 1178 | Fcons (make_string ("invalid string property list", 28), Qnil)); |
| 1179 | Fset_text_properties (beg, end, plist, tmp); | 1179 | Fset_text_properties (beg, end, plist, tmp); |
| @@ -1480,7 +1480,7 @@ read_list (flag, readcharfun) | |||
| 1480 | GCPRO2 (val, tail); | 1480 | GCPRO2 (val, tail); |
| 1481 | elt = read1 (readcharfun); | 1481 | elt = read1 (readcharfun); |
| 1482 | UNGCPRO; | 1482 | UNGCPRO; |
| 1483 | if (XTYPE (elt) == Lisp_Internal) | 1483 | if (INTERNALP (elt)) |
| 1484 | { | 1484 | { |
| 1485 | if (flag > 0) | 1485 | if (flag > 0) |
| 1486 | { | 1486 | { |
| @@ -1499,7 +1499,7 @@ read_list (flag, readcharfun) | |||
| 1499 | val = read0 (readcharfun); | 1499 | val = read0 (readcharfun); |
| 1500 | elt = read1 (readcharfun); | 1500 | elt = read1 (readcharfun); |
| 1501 | UNGCPRO; | 1501 | UNGCPRO; |
| 1502 | if (XTYPE (elt) == Lisp_Internal && XINT (elt) == ')') | 1502 | if (INTERNALP (elt) && XINT (elt) == ')') |
| 1503 | return val; | 1503 | return val; |
| 1504 | return Fsignal (Qinvalid_read_syntax, Fcons (make_string (". in wrong context", 18), Qnil)); | 1504 | return Fsignal (Qinvalid_read_syntax, Fcons (make_string (". in wrong context", 18), Qnil)); |
| 1505 | } | 1505 | } |
| @@ -1527,7 +1527,7 @@ Lisp_Object | |||
| 1527 | check_obarray (obarray) | 1527 | check_obarray (obarray) |
| 1528 | Lisp_Object obarray; | 1528 | Lisp_Object obarray; |
| 1529 | { | 1529 | { |
| 1530 | while (XTYPE (obarray) != Lisp_Vector || XVECTOR (obarray)->size == 0) | 1530 | while (!VECTORP (obarray) || XVECTOR (obarray)->size == 0) |
| 1531 | { | 1531 | { |
| 1532 | /* If Vobarray is now invalid, force it to be valid. */ | 1532 | /* If Vobarray is now invalid, force it to be valid. */ |
| 1533 | if (EQ (Vobarray, obarray)) Vobarray = initial_obarray; | 1533 | if (EQ (Vobarray, obarray)) Vobarray = initial_obarray; |
| @@ -1549,10 +1549,10 @@ intern (str) | |||
| 1549 | Lisp_Object obarray; | 1549 | Lisp_Object obarray; |
| 1550 | 1550 | ||
| 1551 | obarray = Vobarray; | 1551 | obarray = Vobarray; |
| 1552 | if (XTYPE (obarray) != Lisp_Vector || XVECTOR (obarray)->size == 0) | 1552 | if (!VECTORP (obarray) || XVECTOR (obarray)->size == 0) |
| 1553 | obarray = check_obarray (obarray); | 1553 | obarray = check_obarray (obarray); |
| 1554 | tem = oblookup (obarray, str, len); | 1554 | tem = oblookup (obarray, str, len); |
| 1555 | if (XTYPE (tem) == Lisp_Symbol) | 1555 | if (SYMBOLP (tem)) |
| 1556 | return tem; | 1556 | return tem; |
| 1557 | return Fintern ((!NILP (Vpurify_flag) | 1557 | return Fintern ((!NILP (Vpurify_flag) |
| 1558 | ? make_pure_string (str, len) | 1558 | ? make_pure_string (str, len) |
| @@ -1576,7 +1576,7 @@ it defaults to the value of `obarray'.") | |||
| 1576 | CHECK_STRING (str, 0); | 1576 | CHECK_STRING (str, 0); |
| 1577 | 1577 | ||
| 1578 | tem = oblookup (obarray, XSTRING (str)->data, XSTRING (str)->size); | 1578 | tem = oblookup (obarray, XSTRING (str)->data, XSTRING (str)->size); |
| 1579 | if (XTYPE (tem) != Lisp_Int) | 1579 | if (!INTEGERP (tem)) |
| 1580 | return tem; | 1580 | return tem; |
| 1581 | 1581 | ||
| 1582 | if (!NILP (Vpurify_flag)) | 1582 | if (!NILP (Vpurify_flag)) |
| @@ -1584,7 +1584,7 @@ it defaults to the value of `obarray'.") | |||
| 1584 | sym = Fmake_symbol (str); | 1584 | sym = Fmake_symbol (str); |
| 1585 | 1585 | ||
| 1586 | ptr = &XVECTOR (obarray)->contents[XINT (tem)]; | 1586 | ptr = &XVECTOR (obarray)->contents[XINT (tem)]; |
| 1587 | if (XTYPE (*ptr) == Lisp_Symbol) | 1587 | if (SYMBOLP (*ptr)) |
| 1588 | XSYMBOL (sym)->next = XSYMBOL (*ptr); | 1588 | XSYMBOL (sym)->next = XSYMBOL (*ptr); |
| 1589 | else | 1589 | else |
| 1590 | XSYMBOL (sym)->next = 0; | 1590 | XSYMBOL (sym)->next = 0; |
| @@ -1607,7 +1607,7 @@ it defaults to the value of `obarray'.") | |||
| 1607 | CHECK_STRING (str, 0); | 1607 | CHECK_STRING (str, 0); |
| 1608 | 1608 | ||
| 1609 | tem = oblookup (obarray, XSTRING (str)->data, XSTRING (str)->size); | 1609 | tem = oblookup (obarray, XSTRING (str)->data, XSTRING (str)->size); |
| 1610 | if (XTYPE (tem) != Lisp_Int) | 1610 | if (!INTEGERP (tem)) |
| 1611 | return tem; | 1611 | return tem; |
| 1612 | return Qnil; | 1612 | return Qnil; |
| 1613 | } | 1613 | } |
| @@ -1623,7 +1623,7 @@ oblookup (obarray, ptr, size) | |||
| 1623 | register Lisp_Object tail; | 1623 | register Lisp_Object tail; |
| 1624 | Lisp_Object bucket, tem; | 1624 | Lisp_Object bucket, tem; |
| 1625 | 1625 | ||
| 1626 | if (XTYPE (obarray) != Lisp_Vector | 1626 | if (!VECTORP (obarray) |
| 1627 | || (obsize = XVECTOR (obarray)->size) == 0) | 1627 | || (obsize = XVECTOR (obarray)->size) == 0) |
| 1628 | { | 1628 | { |
| 1629 | obarray = check_obarray (obarray); | 1629 | obarray = check_obarray (obarray); |
| @@ -1635,7 +1635,7 @@ oblookup (obarray, ptr, size) | |||
| 1635 | bucket = XVECTOR (obarray)->contents[hash]; | 1635 | bucket = XVECTOR (obarray)->contents[hash]; |
| 1636 | if (XFASTINT (bucket) == 0) | 1636 | if (XFASTINT (bucket) == 0) |
| 1637 | ; | 1637 | ; |
| 1638 | else if (XTYPE (bucket) != Lisp_Symbol) | 1638 | else if (!SYMBOLP (bucket)) |
| 1639 | error ("Bad data in guts of obarray"); /* Like CADR error message */ | 1639 | error ("Bad data in guts of obarray"); /* Like CADR error message */ |
| 1640 | else for (tail = bucket; ; XSET (tail, Lisp_Symbol, XSYMBOL (tail)->next)) | 1640 | else for (tail = bucket; ; XSET (tail, Lisp_Symbol, XSYMBOL (tail)->next)) |
| 1641 | { | 1641 | { |
| @@ -1921,7 +1921,7 @@ init_lread () | |||
| 1921 | { | 1921 | { |
| 1922 | Lisp_Object dirfile; | 1922 | Lisp_Object dirfile; |
| 1923 | dirfile = Fcar (path_tail); | 1923 | dirfile = Fcar (path_tail); |
| 1924 | if (XTYPE (dirfile) == Lisp_String) | 1924 | if (STRINGP (dirfile)) |
| 1925 | { | 1925 | { |
| 1926 | dirfile = Fdirectory_file_name (dirfile); | 1926 | dirfile = Fdirectory_file_name (dirfile); |
| 1927 | if (access (XSTRING (dirfile)->data, 0) < 0) | 1927 | if (access (XSTRING (dirfile)->data, 0) < 0) |