diff options
| author | Ken Raeburn | 2000-04-05 17:29:31 +0000 |
|---|---|---|
| committer | Ken Raeburn | 2000-04-05 17:29:31 +0000 |
| commit | 7c752c8099915f10ec6e99d60ea20196111a94a1 (patch) | |
| tree | 088139e64875a53f21320d85709678589babf883 /src | |
| parent | c407c570006300c2a520c89aa118e798a5e3589b (diff) | |
| download | emacs-7c752c8099915f10ec6e99d60ea20196111a94a1.tar.gz emacs-7c752c8099915f10ec6e99d60ea20196111a94a1.zip | |
make_number/XINT/XUINT conversions; EQ/== fixes; ==Qnil -> NILP
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 17 | ||||
| -rw-r--r-- | src/dispnew.c | 6 | ||||
| -rw-r--r-- | src/fileio.c | 4 | ||||
| -rw-r--r-- | src/fns.c | 6 | ||||
| -rw-r--r-- | src/keyboard.c | 4 | ||||
| -rw-r--r-- | src/lread.c | 2 | ||||
| -rw-r--r-- | src/minibuf.c | 26 | ||||
| -rw-r--r-- | src/print.c | 6 | ||||
| -rw-r--r-- | src/search.c | 2 | ||||
| -rw-r--r-- | src/term.c | 2 |
10 files changed, 46 insertions, 29 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 19932e9d76c..4a7a96ee882 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2000-04-05 Ken Raeburn <raeburn@gnu.org> | ||
| 2 | |||
| 3 | * dispnew.c (allocate_matrices_for_frame_redisplay, | ||
| 4 | direct_output_forward_char): Use X(U)INT and make_number as needed | ||
| 5 | to convert between (unsigned) int values and lisp integers. | ||
| 6 | * keyboard.c (read_key_sequence): Likewise. | ||
| 7 | * lread.c (substitute_object_recurse): Likewise. | ||
| 8 | * fns.c (concat, hash_lookup, hash_remove): Likewise. | ||
| 9 | * minibuf.c (do_completion, Fminibuffer_complete_word, | ||
| 10 | Fminibuffer_completion_help): Likewise. | ||
| 11 | * term.c (produce_special_glyphs): Likewise. | ||
| 12 | |||
| 13 | * fileio.c (Fwrite_region): Use EQ when comparing lisp objects. | ||
| 14 | * print.c (print_preprocess, print_object): Likewise. | ||
| 15 | |||
| 16 | * search.c (compile_pattern): Use NILP when checking for nil. | ||
| 17 | |||
| 1 | 2000-04-04 Gerd Moellmann <gerd@gnu.org> | 18 | 2000-04-04 Gerd Moellmann <gerd@gnu.org> |
| 2 | 19 | ||
| 3 | * window.c (compare_window_configurations): Signal an error | 20 | * window.c (compare_window_configurations): Signal an error |
diff --git a/src/dispnew.c b/src/dispnew.c index 00590605af2..1936501d947 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -1756,8 +1756,8 @@ allocate_matrices_for_frame_redisplay (window, x, y, ch_dim, | |||
| 1756 | 1756 | ||
| 1757 | /* Width and height MUST be chosen so that there are no | 1757 | /* Width and height MUST be chosen so that there are no |
| 1758 | holes in the frame matrix. */ | 1758 | holes in the frame matrix. */ |
| 1759 | dim.width = w->width; | 1759 | dim.width = XINT (w->width); |
| 1760 | dim.height = w->height; | 1760 | dim.height = XINT (w->height); |
| 1761 | 1761 | ||
| 1762 | /* Will matrix be re-allocated? */ | 1762 | /* Will matrix be re-allocated? */ |
| 1763 | if (x != w->desired_matrix->matrix_x | 1763 | if (x != w->desired_matrix->matrix_x |
| @@ -3372,7 +3372,7 @@ direct_output_forward_char (n) | |||
| 3372 | struct glyph_row *row; | 3372 | struct glyph_row *row; |
| 3373 | 3373 | ||
| 3374 | /* Give up if point moved out of or into a composition. */ | 3374 | /* Give up if point moved out of or into a composition. */ |
| 3375 | if (check_point_in_composition (current_buffer, w->last_point, | 3375 | if (check_point_in_composition (current_buffer, XINT (w->last_point), |
| 3376 | current_buffer, PT)) | 3376 | current_buffer, PT)) |
| 3377 | return 0; | 3377 | return 0; |
| 3378 | 3378 | ||
diff --git a/src/fileio.c b/src/fileio.c index b68ebfc5b71..3af7816fd5c 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -4461,7 +4461,7 @@ This does code conversion according to the value of\n\ | |||
| 4461 | 4461 | ||
| 4462 | filename = Fexpand_file_name (filename, Qnil); | 4462 | filename = Fexpand_file_name (filename, Qnil); |
| 4463 | 4463 | ||
| 4464 | if (! NILP (mustbenew) && mustbenew != Qexcl) | 4464 | if (! NILP (mustbenew) && !EQ (mustbenew, Qexcl)) |
| 4465 | barf_or_query_if_file_exists (filename, "overwrite", 1, 0, 1); | 4465 | barf_or_query_if_file_exists (filename, "overwrite", 1, 0, 1); |
| 4466 | 4466 | ||
| 4467 | if (STRINGP (visit)) | 4467 | if (STRINGP (visit)) |
| @@ -4600,7 +4600,7 @@ This does code conversion according to the value of\n\ | |||
| 4600 | S_IREAD | S_IWRITE); | 4600 | S_IREAD | S_IWRITE); |
| 4601 | #else /* not DOS_NT */ | 4601 | #else /* not DOS_NT */ |
| 4602 | desc = emacs_open (fn, O_WRONLY | O_TRUNC | O_CREAT | 4602 | desc = emacs_open (fn, O_WRONLY | O_TRUNC | O_CREAT |
| 4603 | | (mustbenew == Qexcl ? O_EXCL : 0), | 4603 | | (EQ (mustbenew, Qexcl) ? O_EXCL : 0), |
| 4604 | auto_saving ? auto_save_mode_bits : 0666); | 4604 | auto_saving ? auto_save_mode_bits : 0666); |
| 4605 | #endif /* not DOS_NT */ | 4605 | #endif /* not DOS_NT */ |
| 4606 | #endif /* not VMS */ | 4606 | #endif /* not VMS */ |
| @@ -840,7 +840,7 @@ concat (nargs, args, target_type, last_special) | |||
| 840 | { | 840 | { |
| 841 | this = args[textprops[argnum].argnum]; | 841 | this = args[textprops[argnum].argnum]; |
| 842 | copy_text_properties (make_number (textprops[argnum].from), | 842 | copy_text_properties (make_number (textprops[argnum].from), |
| 843 | XSTRING (this)->size, this, | 843 | make_number (XSTRING (this)->size), this, |
| 844 | make_number (textprops[argnum].to), val, Qnil); | 844 | make_number (textprops[argnum].to), val, Qnil); |
| 845 | } | 845 | } |
| 846 | } | 846 | } |
| @@ -3950,7 +3950,7 @@ hash_lookup (h, key, hash) | |||
| 3950 | if (EQ (key, HASH_KEY (h, i)) | 3950 | if (EQ (key, HASH_KEY (h, i)) |
| 3951 | || (h->cmpfn | 3951 | || (h->cmpfn |
| 3952 | && h->cmpfn (h, key, hash_code, | 3952 | && h->cmpfn (h, key, hash_code, |
| 3953 | HASH_KEY (h, i), HASH_HASH (h, i)))) | 3953 | HASH_KEY (h, i), XUINT (HASH_HASH (h, i))))) |
| 3954 | break; | 3954 | break; |
| 3955 | idx = HASH_NEXT (h, i); | 3955 | idx = HASH_NEXT (h, i); |
| 3956 | } | 3956 | } |
| @@ -4017,7 +4017,7 @@ hash_remove (h, key) | |||
| 4017 | if (EQ (key, HASH_KEY (h, i)) | 4017 | if (EQ (key, HASH_KEY (h, i)) |
| 4018 | || (h->cmpfn | 4018 | || (h->cmpfn |
| 4019 | && h->cmpfn (h, key, hash_code, | 4019 | && h->cmpfn (h, key, hash_code, |
| 4020 | HASH_KEY (h, i), HASH_HASH (h, i)))) | 4020 | HASH_KEY (h, i), XUINT (HASH_HASH (h, i))))) |
| 4021 | { | 4021 | { |
| 4022 | /* Take entry out of collision chain. */ | 4022 | /* Take entry out of collision chain. */ |
| 4023 | if (NILP (prev)) | 4023 | if (NILP (prev)) |
diff --git a/src/keyboard.c b/src/keyboard.c index 1a9d751202e..9409b63242e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -7863,8 +7863,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 7863 | pos = XCDR (string); | 7863 | pos = XCDR (string); |
| 7864 | string = XCAR (string); | 7864 | string = XCAR (string); |
| 7865 | 7865 | ||
| 7866 | if (pos >= 0 | 7866 | if (XINT (pos) >= 0 |
| 7867 | && pos < XSTRING (string)->size | 7867 | && XINT (pos) < XSTRING (string)->size |
| 7868 | && (map = Fget_text_property (pos, Qlocal_map, | 7868 | && (map = Fget_text_property (pos, Qlocal_map, |
| 7869 | string), | 7869 | string), |
| 7870 | !NILP (map))) | 7870 | !NILP (map))) |
diff --git a/src/lread.c b/src/lread.c index 5554eac193f..4d2895ca2e6 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2334,7 +2334,7 @@ substitute_object_recurse (object, placeholder, subtree) | |||
| 2334 | case Lisp_Vectorlike: | 2334 | case Lisp_Vectorlike: |
| 2335 | { | 2335 | { |
| 2336 | int i; | 2336 | int i; |
| 2337 | int length = Flength(subtree); | 2337 | int length = XINT (Flength(subtree)); |
| 2338 | for (i = 0; i < length; i++) | 2338 | for (i = 0; i < length; i++) |
| 2339 | { | 2339 | { |
| 2340 | Lisp_Object idx = make_number (i); | 2340 | Lisp_Object idx = make_number (i); |
diff --git a/src/minibuf.c b/src/minibuf.c index 1d576812022..cbc856e62dc 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -1579,7 +1579,7 @@ do_completion () | |||
| 1579 | Lisp_Object last; | 1579 | Lisp_Object last; |
| 1580 | struct gcpro gcpro1, gcpro2; | 1580 | struct gcpro gcpro1, gcpro2; |
| 1581 | 1581 | ||
| 1582 | completion = Ftry_completion (Ffield_string (ZV), | 1582 | completion = Ftry_completion (Ffield_string (make_number (ZV)), |
| 1583 | Vminibuffer_completion_table, | 1583 | Vminibuffer_completion_table, |
| 1584 | Vminibuffer_completion_predicate); | 1584 | Vminibuffer_completion_predicate); |
| 1585 | last = last_exact_completion; | 1585 | last = last_exact_completion; |
| @@ -1602,7 +1602,7 @@ do_completion () | |||
| 1602 | } | 1602 | } |
| 1603 | 1603 | ||
| 1604 | /* compiler bug */ | 1604 | /* compiler bug */ |
| 1605 | tem = Fstring_equal (completion, Ffield_string(ZV)); | 1605 | tem = Fstring_equal (completion, Ffield_string(make_number (ZV))); |
| 1606 | completedp = NILP (tem); | 1606 | completedp = NILP (tem); |
| 1607 | if (completedp) | 1607 | if (completedp) |
| 1608 | { | 1608 | { |
| @@ -1611,7 +1611,7 @@ do_completion () | |||
| 1611 | } | 1611 | } |
| 1612 | 1612 | ||
| 1613 | /* It did find a match. Do we match some possibility exactly now? */ | 1613 | /* It did find a match. Do we match some possibility exactly now? */ |
| 1614 | tem = test_completion (Ffield_string(ZV)); | 1614 | tem = test_completion (Ffield_string (make_number (ZV))); |
| 1615 | if (NILP (tem)) | 1615 | if (NILP (tem)) |
| 1616 | { | 1616 | { |
| 1617 | /* not an exact match */ | 1617 | /* not an exact match */ |
| @@ -1635,7 +1635,7 @@ do_completion () | |||
| 1635 | last_exact_completion = completion; | 1635 | last_exact_completion = completion; |
| 1636 | if (!NILP (last)) | 1636 | if (!NILP (last)) |
| 1637 | { | 1637 | { |
| 1638 | tem = Ffield_string (ZV); | 1638 | tem = Ffield_string (make_number (ZV)); |
| 1639 | if (!NILP (Fequal (tem, last))) | 1639 | if (!NILP (Fequal (tem, last))) |
| 1640 | Fminibuffer_completion_help (); | 1640 | Fminibuffer_completion_help (); |
| 1641 | } | 1641 | } |
| @@ -1760,10 +1760,10 @@ a repetition of this command will exit.") | |||
| 1760 | Lisp_Object val; | 1760 | Lisp_Object val; |
| 1761 | 1761 | ||
| 1762 | /* Allow user to specify null string */ | 1762 | /* Allow user to specify null string */ |
| 1763 | if (Ffield_beginning (ZV, Qnil) == ZV) | 1763 | if (XINT (Ffield_beginning (make_number (ZV), Qnil)) == ZV) |
| 1764 | goto exit; | 1764 | goto exit; |
| 1765 | 1765 | ||
| 1766 | if (!NILP (test_completion (Ffield_string (ZV)))) | 1766 | if (!NILP (test_completion (Ffield_string (make_number (ZV))))) |
| 1767 | goto exit; | 1767 | goto exit; |
| 1768 | 1768 | ||
| 1769 | /* Call do_completion, but ignore errors. */ | 1769 | /* Call do_completion, but ignore errors. */ |
| @@ -1811,7 +1811,7 @@ Return nil if there is no valid completion, else t.") | |||
| 1811 | /* We keep calling Fbuffer_string rather than arrange for GC to | 1811 | /* We keep calling Fbuffer_string rather than arrange for GC to |
| 1812 | hold onto a pointer to one of the strings thus made. */ | 1812 | hold onto a pointer to one of the strings thus made. */ |
| 1813 | 1813 | ||
| 1814 | completion = Ftry_completion (Ffield_string (ZV), | 1814 | completion = Ftry_completion (Ffield_string (make_number (ZV)), |
| 1815 | Vminibuffer_completion_table, | 1815 | Vminibuffer_completion_table, |
| 1816 | Vminibuffer_completion_predicate); | 1816 | Vminibuffer_completion_predicate); |
| 1817 | if (NILP (completion)) | 1817 | if (NILP (completion)) |
| @@ -1824,7 +1824,7 @@ Return nil if there is no valid completion, else t.") | |||
| 1824 | return Qnil; | 1824 | return Qnil; |
| 1825 | 1825 | ||
| 1826 | #if 0 /* How the below code used to look, for reference. */ | 1826 | #if 0 /* How the below code used to look, for reference. */ |
| 1827 | tem = Ffield_string (ZV); | 1827 | tem = Ffield_string (make_number (ZV)); |
| 1828 | b = XSTRING (tem)->data; | 1828 | b = XSTRING (tem)->data; |
| 1829 | i = ZV - 1 - XSTRING (completion)->size; | 1829 | i = ZV - 1 - XSTRING (completion)->size; |
| 1830 | p = XSTRING (completion)->data; | 1830 | p = XSTRING (completion)->data; |
| @@ -1843,7 +1843,7 @@ Return nil if there is no valid completion, else t.") | |||
| 1843 | int buffer_nchars, completion_nchars; | 1843 | int buffer_nchars, completion_nchars; |
| 1844 | 1844 | ||
| 1845 | CHECK_STRING (completion, 0); | 1845 | CHECK_STRING (completion, 0); |
| 1846 | tem = Ffield_string (ZV); | 1846 | tem = Ffield_string (make_number (ZV)); |
| 1847 | GCPRO2 (completion, tem); | 1847 | GCPRO2 (completion, tem); |
| 1848 | /* If reading a file name, | 1848 | /* If reading a file name, |
| 1849 | expand any $ENVVAR refs in the buffer and in TEM. */ | 1849 | expand any $ENVVAR refs in the buffer and in TEM. */ |
| @@ -1896,7 +1896,7 @@ Return nil if there is no valid completion, else t.") | |||
| 1896 | } | 1896 | } |
| 1897 | #endif /* Rewritten code */ | 1897 | #endif /* Rewritten code */ |
| 1898 | 1898 | ||
| 1899 | prompt_end_charpos = Ffield_beginning (make_number (ZV), Qnil); | 1899 | prompt_end_charpos = XINT (Ffield_beginning (make_number (ZV), Qnil)); |
| 1900 | 1900 | ||
| 1901 | { | 1901 | { |
| 1902 | int prompt_end_bytepos; | 1902 | int prompt_end_bytepos; |
| @@ -1910,7 +1910,7 @@ Return nil if there is no valid completion, else t.") | |||
| 1910 | if (i == XSTRING (completion)->size) | 1910 | if (i == XSTRING (completion)->size) |
| 1911 | { | 1911 | { |
| 1912 | GCPRO1 (completion); | 1912 | GCPRO1 (completion); |
| 1913 | tem = Ftry_completion (concat2 (Ffield_string (ZV), build_string (" ")), | 1913 | tem = Ftry_completion (concat2 (Ffield_string (make_number (ZV)), build_string (" ")), |
| 1914 | Vminibuffer_completion_table, | 1914 | Vminibuffer_completion_table, |
| 1915 | Vminibuffer_completion_predicate); | 1915 | Vminibuffer_completion_predicate); |
| 1916 | UNGCPRO; | 1916 | UNGCPRO; |
| @@ -1921,7 +1921,7 @@ Return nil if there is no valid completion, else t.") | |||
| 1921 | { | 1921 | { |
| 1922 | GCPRO1 (completion); | 1922 | GCPRO1 (completion); |
| 1923 | tem = | 1923 | tem = |
| 1924 | Ftry_completion (concat2 (Ffield_string (ZV), build_string ("-")), | 1924 | Ftry_completion (concat2 (Ffield_string (make_number (ZV)), build_string ("-")), |
| 1925 | Vminibuffer_completion_table, | 1925 | Vminibuffer_completion_table, |
| 1926 | Vminibuffer_completion_predicate); | 1926 | Vminibuffer_completion_predicate); |
| 1927 | UNGCPRO; | 1927 | UNGCPRO; |
| @@ -2156,7 +2156,7 @@ DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_co | |||
| 2156 | Lisp_Object completions; | 2156 | Lisp_Object completions; |
| 2157 | 2157 | ||
| 2158 | message ("Making completion list..."); | 2158 | message ("Making completion list..."); |
| 2159 | completions = Fall_completions (Ffield_string (ZV), | 2159 | completions = Fall_completions (Ffield_string (make_number (ZV)), |
| 2160 | Vminibuffer_completion_table, | 2160 | Vminibuffer_completion_table, |
| 2161 | Vminibuffer_completion_predicate, | 2161 | Vminibuffer_completion_predicate, |
| 2162 | Qt); | 2162 | Qt); |
diff --git a/src/print.c b/src/print.c index d56dcafbd64..6603525d3d8 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -1118,7 +1118,7 @@ print_preprocess (obj) | |||
| 1118 | if (! NILP (Vprint_circle) || SYMBOLP (obj)) | 1118 | if (! NILP (Vprint_circle) || SYMBOLP (obj)) |
| 1119 | { | 1119 | { |
| 1120 | for (i = 0; i < print_number_index; i++) | 1120 | for (i = 0; i < print_number_index; i++) |
| 1121 | if (PRINT_NUMBER_OBJECT (Vprint_number_table, i) == obj) | 1121 | if (EQ (PRINT_NUMBER_OBJECT (Vprint_number_table, i), obj)) |
| 1122 | { | 1122 | { |
| 1123 | /* OBJ appears more than once. Let's remember that. */ | 1123 | /* OBJ appears more than once. Let's remember that. */ |
| 1124 | PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt; | 1124 | PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt; |
| @@ -1218,7 +1218,7 @@ print_object (obj, printcharfun, escapeflag) | |||
| 1218 | /* With the print-circle feature. */ | 1218 | /* With the print-circle feature. */ |
| 1219 | int i; | 1219 | int i; |
| 1220 | for (i = 0; i < print_number_index; i++) | 1220 | for (i = 0; i < print_number_index; i++) |
| 1221 | if (PRINT_NUMBER_OBJECT (Vprint_number_table, i) == obj) | 1221 | if (EQ (PRINT_NUMBER_OBJECT (Vprint_number_table, i), obj)) |
| 1222 | { | 1222 | { |
| 1223 | if (NILP (PRINT_NUMBER_STATUS (Vprint_number_table, i))) | 1223 | if (NILP (PRINT_NUMBER_STATUS (Vprint_number_table, i))) |
| 1224 | { | 1224 | { |
| @@ -1506,7 +1506,7 @@ print_object (obj, printcharfun, escapeflag) | |||
| 1506 | { | 1506 | { |
| 1507 | int i; | 1507 | int i; |
| 1508 | for (i = 0; i < print_number_index; i++) | 1508 | for (i = 0; i < print_number_index; i++) |
| 1509 | if (PRINT_NUMBER_OBJECT (Vprint_number_table, i) == obj) | 1509 | if (EQ (PRINT_NUMBER_OBJECT (Vprint_number_table, i), obj)) |
| 1510 | { | 1510 | { |
| 1511 | if (NILP (PRINT_NUMBER_STATUS (Vprint_number_table, i))) | 1511 | if (NILP (PRINT_NUMBER_STATUS (Vprint_number_table, i))) |
| 1512 | { | 1512 | { |
diff --git a/src/search.c b/src/search.c index eda4199915a..34dcc7e78a2 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -218,7 +218,7 @@ compile_pattern (pattern, regp, translate, posix, multibyte) | |||
| 218 | XSTRING in those cases. However, compile_pattern_1 is only | 218 | XSTRING in those cases. However, compile_pattern_1 is only |
| 219 | applied to the cache entry we pick here to reuse. So nil | 219 | applied to the cache entry we pick here to reuse. So nil |
| 220 | should never appear before a non-nil entry. */ | 220 | should never appear before a non-nil entry. */ |
| 221 | if (cp->regexp == Qnil) | 221 | if (NILP (cp->regexp)) |
| 222 | goto compile_it; | 222 | goto compile_it; |
| 223 | if (XSTRING (cp->regexp)->size == XSTRING (pattern)->size | 223 | if (XSTRING (cp->regexp)->size == XSTRING (pattern)->size |
| 224 | && !NILP (Fstring_equal (cp->regexp, pattern)) | 224 | && !NILP (Fstring_equal (cp->regexp, pattern)) |
diff --git a/src/term.c b/src/term.c index 5ee942895fb..eaac25c6819 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -1893,7 +1893,7 @@ produce_special_glyphs (it, what) | |||
| 1893 | temp_it.dp = NULL; | 1893 | temp_it.dp = NULL; |
| 1894 | temp_it.what = IT_CHARACTER; | 1894 | temp_it.what = IT_CHARACTER; |
| 1895 | temp_it.len = 1; | 1895 | temp_it.len = 1; |
| 1896 | temp_it.object = 0; | 1896 | temp_it.object = make_number (0); |
| 1897 | bzero (&temp_it.current, sizeof temp_it.current); | 1897 | bzero (&temp_it.current, sizeof temp_it.current); |
| 1898 | 1898 | ||
| 1899 | if (what == IT_CONTINUATION) | 1899 | if (what == IT_CONTINUATION) |