Commit 7c752c80 authored by Ken Raeburn's avatar Ken Raeburn

make_number/XINT/XUINT conversions; EQ/== fixes; ==Qnil -> NILP

parent c407c570
No preview for this file type
...@@ -1756,8 +1756,8 @@ allocate_matrices_for_frame_redisplay (window, x, y, ch_dim, ...@@ -1756,8 +1756,8 @@ allocate_matrices_for_frame_redisplay (window, x, y, ch_dim,
/* Width and height MUST be chosen so that there are no /* Width and height MUST be chosen so that there are no
holes in the frame matrix. */ holes in the frame matrix. */
dim.width = w->width; dim.width = XINT (w->width);
dim.height = w->height; dim.height = XINT (w->height);
/* Will matrix be re-allocated? */ /* Will matrix be re-allocated? */
if (x != w->desired_matrix->matrix_x if (x != w->desired_matrix->matrix_x
...@@ -3372,7 +3372,7 @@ direct_output_forward_char (n) ...@@ -3372,7 +3372,7 @@ direct_output_forward_char (n)
struct glyph_row *row; struct glyph_row *row;
/* Give up if point moved out of or into a composition. */ /* Give up if point moved out of or into a composition. */
if (check_point_in_composition (current_buffer, w->last_point, if (check_point_in_composition (current_buffer, XINT (w->last_point),
current_buffer, PT)) current_buffer, PT))
return 0; return 0;
......
...@@ -4461,7 +4461,7 @@ This does code conversion according to the value of\n\ ...@@ -4461,7 +4461,7 @@ This does code conversion according to the value of\n\
filename = Fexpand_file_name (filename, Qnil); filename = Fexpand_file_name (filename, Qnil);
if (! NILP (mustbenew) && mustbenew != Qexcl) if (! NILP (mustbenew) && !EQ (mustbenew, Qexcl))
barf_or_query_if_file_exists (filename, "overwrite", 1, 0, 1); barf_or_query_if_file_exists (filename, "overwrite", 1, 0, 1);
if (STRINGP (visit)) if (STRINGP (visit))
...@@ -4600,7 +4600,7 @@ This does code conversion according to the value of\n\ ...@@ -4600,7 +4600,7 @@ This does code conversion according to the value of\n\
S_IREAD | S_IWRITE); S_IREAD | S_IWRITE);
#else /* not DOS_NT */ #else /* not DOS_NT */
desc = emacs_open (fn, O_WRONLY | O_TRUNC | O_CREAT desc = emacs_open (fn, O_WRONLY | O_TRUNC | O_CREAT
| (mustbenew == Qexcl ? O_EXCL : 0), | (EQ (mustbenew, Qexcl) ? O_EXCL : 0),
auto_saving ? auto_save_mode_bits : 0666); auto_saving ? auto_save_mode_bits : 0666);
#endif /* not DOS_NT */ #endif /* not DOS_NT */
#endif /* not VMS */ #endif /* not VMS */
......
...@@ -840,7 +840,7 @@ concat (nargs, args, target_type, last_special) ...@@ -840,7 +840,7 @@ concat (nargs, args, target_type, last_special)
{ {
this = args[textprops[argnum].argnum]; this = args[textprops[argnum].argnum];
copy_text_properties (make_number (textprops[argnum].from), copy_text_properties (make_number (textprops[argnum].from),
XSTRING (this)->size, this, make_number (XSTRING (this)->size), this,
make_number (textprops[argnum].to), val, Qnil); make_number (textprops[argnum].to), val, Qnil);
} }
} }
...@@ -3950,7 +3950,7 @@ hash_lookup (h, key, hash) ...@@ -3950,7 +3950,7 @@ hash_lookup (h, key, hash)
if (EQ (key, HASH_KEY (h, i)) if (EQ (key, HASH_KEY (h, i))
|| (h->cmpfn || (h->cmpfn
&& h->cmpfn (h, key, hash_code, && h->cmpfn (h, key, hash_code,
HASH_KEY (h, i), HASH_HASH (h, i)))) HASH_KEY (h, i), XUINT (HASH_HASH (h, i)))))
break; break;
idx = HASH_NEXT (h, i); idx = HASH_NEXT (h, i);
} }
...@@ -4017,7 +4017,7 @@ hash_remove (h, key) ...@@ -4017,7 +4017,7 @@ hash_remove (h, key)
if (EQ (key, HASH_KEY (h, i)) if (EQ (key, HASH_KEY (h, i))
|| (h->cmpfn || (h->cmpfn
&& h->cmpfn (h, key, hash_code, && h->cmpfn (h, key, hash_code,
HASH_KEY (h, i), HASH_HASH (h, i)))) HASH_KEY (h, i), XUINT (HASH_HASH (h, i)))))
{ {
/* Take entry out of collision chain. */ /* Take entry out of collision chain. */
if (NILP (prev)) if (NILP (prev))
......
...@@ -7863,8 +7863,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, ...@@ -7863,8 +7863,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
pos = XCDR (string); pos = XCDR (string);
string = XCAR (string); string = XCAR (string);
if (pos >= 0 if (XINT (pos) >= 0
&& pos < XSTRING (string)->size && XINT (pos) < XSTRING (string)->size
&& (map = Fget_text_property (pos, Qlocal_map, && (map = Fget_text_property (pos, Qlocal_map,
string), string),
!NILP (map))) !NILP (map)))
......
...@@ -2334,7 +2334,7 @@ substitute_object_recurse (object, placeholder, subtree) ...@@ -2334,7 +2334,7 @@ substitute_object_recurse (object, placeholder, subtree)
case Lisp_Vectorlike: case Lisp_Vectorlike:
{ {
int i; int i;
int length = Flength(subtree); int length = XINT (Flength(subtree));
for (i = 0; i < length; i++) for (i = 0; i < length; i++)
{ {
Lisp_Object idx = make_number (i); Lisp_Object idx = make_number (i);
......
...@@ -1579,7 +1579,7 @@ do_completion () ...@@ -1579,7 +1579,7 @@ do_completion ()
Lisp_Object last; Lisp_Object last;
struct gcpro gcpro1, gcpro2; struct gcpro gcpro1, gcpro2;
completion = Ftry_completion (Ffield_string (ZV), completion = Ftry_completion (Ffield_string (make_number (ZV)),
Vminibuffer_completion_table, Vminibuffer_completion_table,
Vminibuffer_completion_predicate); Vminibuffer_completion_predicate);
last = last_exact_completion; last = last_exact_completion;
...@@ -1602,7 +1602,7 @@ do_completion () ...@@ -1602,7 +1602,7 @@ do_completion ()
} }
/* compiler bug */ /* compiler bug */
tem = Fstring_equal (completion, Ffield_string(ZV)); tem = Fstring_equal (completion, Ffield_string(make_number (ZV)));
completedp = NILP (tem); completedp = NILP (tem);
if (completedp) if (completedp)
{ {
...@@ -1611,7 +1611,7 @@ do_completion () ...@@ -1611,7 +1611,7 @@ do_completion ()
} }
/* It did find a match. Do we match some possibility exactly now? */ /* It did find a match. Do we match some possibility exactly now? */
tem = test_completion (Ffield_string(ZV)); tem = test_completion (Ffield_string (make_number (ZV)));
if (NILP (tem)) if (NILP (tem))
{ {
/* not an exact match */ /* not an exact match */
...@@ -1635,7 +1635,7 @@ do_completion () ...@@ -1635,7 +1635,7 @@ do_completion ()
last_exact_completion = completion; last_exact_completion = completion;
if (!NILP (last)) if (!NILP (last))
{ {
tem = Ffield_string (ZV); tem = Ffield_string (make_number (ZV));
if (!NILP (Fequal (tem, last))) if (!NILP (Fequal (tem, last)))
Fminibuffer_completion_help (); Fminibuffer_completion_help ();
} }
...@@ -1760,10 +1760,10 @@ a repetition of this command will exit.") ...@@ -1760,10 +1760,10 @@ a repetition of this command will exit.")
Lisp_Object val; Lisp_Object val;
/* Allow user to specify null string */ /* Allow user to specify null string */
if (Ffield_beginning (ZV, Qnil) == ZV) if (XINT (Ffield_beginning (make_number (ZV), Qnil)) == ZV)
goto exit; goto exit;
if (!NILP (test_completion (Ffield_string (ZV)))) if (!NILP (test_completion (Ffield_string (make_number (ZV)))))
goto exit; goto exit;
/* Call do_completion, but ignore errors. */ /* Call do_completion, but ignore errors. */
...@@ -1811,7 +1811,7 @@ Return nil if there is no valid completion, else t.") ...@@ -1811,7 +1811,7 @@ Return nil if there is no valid completion, else t.")
/* We keep calling Fbuffer_string rather than arrange for GC to /* We keep calling Fbuffer_string rather than arrange for GC to
hold onto a pointer to one of the strings thus made. */ hold onto a pointer to one of the strings thus made. */
completion = Ftry_completion (Ffield_string (ZV), completion = Ftry_completion (Ffield_string (make_number (ZV)),
Vminibuffer_completion_table, Vminibuffer_completion_table,
Vminibuffer_completion_predicate); Vminibuffer_completion_predicate);
if (NILP (completion)) if (NILP (completion))
...@@ -1824,7 +1824,7 @@ Return nil if there is no valid completion, else t.") ...@@ -1824,7 +1824,7 @@ Return nil if there is no valid completion, else t.")
return Qnil; return Qnil;
#if 0 /* How the below code used to look, for reference. */ #if 0 /* How the below code used to look, for reference. */
tem = Ffield_string (ZV); tem = Ffield_string (make_number (ZV));
b = XSTRING (tem)->data; b = XSTRING (tem)->data;
i = ZV - 1 - XSTRING (completion)->size; i = ZV - 1 - XSTRING (completion)->size;
p = XSTRING (completion)->data; p = XSTRING (completion)->data;
...@@ -1843,7 +1843,7 @@ Return nil if there is no valid completion, else t.") ...@@ -1843,7 +1843,7 @@ Return nil if there is no valid completion, else t.")
int buffer_nchars, completion_nchars; int buffer_nchars, completion_nchars;
CHECK_STRING (completion, 0); CHECK_STRING (completion, 0);
tem = Ffield_string (ZV); tem = Ffield_string (make_number (ZV));
GCPRO2 (completion, tem); GCPRO2 (completion, tem);
/* If reading a file name, /* If reading a file name,
expand any $ENVVAR refs in the buffer and in TEM. */ 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,7 +1896,7 @@ Return nil if there is no valid completion, else t.")
} }
#endif /* Rewritten code */ #endif /* Rewritten code */
prompt_end_charpos = Ffield_beginning (make_number (ZV), Qnil); prompt_end_charpos = XINT (Ffield_beginning (make_number (ZV), Qnil));
{ {
int prompt_end_bytepos; int prompt_end_bytepos;
...@@ -1910,7 +1910,7 @@ Return nil if there is no valid completion, else t.") ...@@ -1910,7 +1910,7 @@ Return nil if there is no valid completion, else t.")
if (i == XSTRING (completion)->size) if (i == XSTRING (completion)->size)
{ {
GCPRO1 (completion); GCPRO1 (completion);
tem = Ftry_completion (concat2 (Ffield_string (ZV), build_string (" ")), tem = Ftry_completion (concat2 (Ffield_string (make_number (ZV)), build_string (" ")),
Vminibuffer_completion_table, Vminibuffer_completion_table,
Vminibuffer_completion_predicate); Vminibuffer_completion_predicate);
UNGCPRO; UNGCPRO;
...@@ -1921,7 +1921,7 @@ Return nil if there is no valid completion, else t.") ...@@ -1921,7 +1921,7 @@ Return nil if there is no valid completion, else t.")
{ {
GCPRO1 (completion); GCPRO1 (completion);
tem = tem =
Ftry_completion (concat2 (Ffield_string (ZV), build_string ("-")), Ftry_completion (concat2 (Ffield_string (make_number (ZV)), build_string ("-")),
Vminibuffer_completion_table, Vminibuffer_completion_table,
Vminibuffer_completion_predicate); Vminibuffer_completion_predicate);
UNGCPRO; UNGCPRO;
...@@ -2156,7 +2156,7 @@ DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_co ...@@ -2156,7 +2156,7 @@ DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_co
Lisp_Object completions; Lisp_Object completions;
message ("Making completion list..."); message ("Making completion list...");
completions = Fall_completions (Ffield_string (ZV), completions = Fall_completions (Ffield_string (make_number (ZV)),
Vminibuffer_completion_table, Vminibuffer_completion_table,
Vminibuffer_completion_predicate, Vminibuffer_completion_predicate,
Qt); Qt);
......
...@@ -1118,7 +1118,7 @@ print_preprocess (obj) ...@@ -1118,7 +1118,7 @@ print_preprocess (obj)
if (! NILP (Vprint_circle) || SYMBOLP (obj)) if (! NILP (Vprint_circle) || SYMBOLP (obj))
{ {
for (i = 0; i < print_number_index; i++) for (i = 0; i < print_number_index; i++)
if (PRINT_NUMBER_OBJECT (Vprint_number_table, i) == obj) if (EQ (PRINT_NUMBER_OBJECT (Vprint_number_table, i), obj))
{ {
/* OBJ appears more than once. Let's remember that. */ /* OBJ appears more than once. Let's remember that. */
PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt; PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt;
...@@ -1218,7 +1218,7 @@ print_object (obj, printcharfun, escapeflag) ...@@ -1218,7 +1218,7 @@ print_object (obj, printcharfun, escapeflag)
/* With the print-circle feature. */ /* With the print-circle feature. */
int i; int i;
for (i = 0; i < print_number_index; i++) for (i = 0; i < print_number_index; i++)
if (PRINT_NUMBER_OBJECT (Vprint_number_table, i) == obj) if (EQ (PRINT_NUMBER_OBJECT (Vprint_number_table, i), obj))
{ {
if (NILP (PRINT_NUMBER_STATUS (Vprint_number_table, i))) if (NILP (PRINT_NUMBER_STATUS (Vprint_number_table, i)))
{ {
...@@ -1506,7 +1506,7 @@ print_object (obj, printcharfun, escapeflag) ...@@ -1506,7 +1506,7 @@ print_object (obj, printcharfun, escapeflag)
{ {
int i; int i;
for (i = 0; i < print_number_index; i++) for (i = 0; i < print_number_index; i++)
if (PRINT_NUMBER_OBJECT (Vprint_number_table, i) == obj) if (EQ (PRINT_NUMBER_OBJECT (Vprint_number_table, i), obj))
{ {
if (NILP (PRINT_NUMBER_STATUS (Vprint_number_table, i))) if (NILP (PRINT_NUMBER_STATUS (Vprint_number_table, i)))
{ {
......
...@@ -218,7 +218,7 @@ compile_pattern (pattern, regp, translate, posix, multibyte) ...@@ -218,7 +218,7 @@ compile_pattern (pattern, regp, translate, posix, multibyte)
XSTRING in those cases. However, compile_pattern_1 is only XSTRING in those cases. However, compile_pattern_1 is only
applied to the cache entry we pick here to reuse. So nil applied to the cache entry we pick here to reuse. So nil
should never appear before a non-nil entry. */ should never appear before a non-nil entry. */
if (cp->regexp == Qnil) if (NILP (cp->regexp))
goto compile_it; goto compile_it;
if (XSTRING (cp->regexp)->size == XSTRING (pattern)->size if (XSTRING (cp->regexp)->size == XSTRING (pattern)->size
&& !NILP (Fstring_equal (cp->regexp, pattern)) && !NILP (Fstring_equal (cp->regexp, pattern))
......
...@@ -1893,7 +1893,7 @@ produce_special_glyphs (it, what) ...@@ -1893,7 +1893,7 @@ produce_special_glyphs (it, what)
temp_it.dp = NULL; temp_it.dp = NULL;
temp_it.what = IT_CHARACTER; temp_it.what = IT_CHARACTER;
temp_it.len = 1; temp_it.len = 1;
temp_it.object = 0; temp_it.object = make_number (0);
bzero (&temp_it.current, sizeof temp_it.current); bzero (&temp_it.current, sizeof temp_it.current);
if (what == IT_CONTINUATION) if (what == IT_CONTINUATION)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment