+2000-04-05 Ken Raeburn <raeburn@gnu.org>
+
+ * dispnew.c (allocate_matrices_for_frame_redisplay,
+ direct_output_forward_char): Use X(U)INT and make_number as needed
+ to convert between (unsigned) int values and lisp integers.
+ * keyboard.c (read_key_sequence): Likewise.
+ * lread.c (substitute_object_recurse): Likewise.
+ * fns.c (concat, hash_lookup, hash_remove): Likewise.
+ * minibuf.c (do_completion, Fminibuffer_complete_word,
+ Fminibuffer_completion_help): Likewise.
+ * term.c (produce_special_glyphs): Likewise.
+
+ * fileio.c (Fwrite_region): Use EQ when comparing lisp objects.
+ * print.c (print_preprocess, print_object): Likewise.
+
+ * search.c (compile_pattern): Use NILP when checking for nil.
+
2000-04-04 Gerd Moellmann <gerd@gnu.org>
* window.c (compare_window_configurations): Signal an error
/* Width and height MUST be chosen so that there are no
holes in the frame matrix. */
- dim.width = w->width;
- dim.height = w->height;
+ dim.width = XINT (w->width);
+ dim.height = XINT (w->height);
/* Will matrix be re-allocated? */
if (x != w->desired_matrix->matrix_x
struct glyph_row *row;
/* 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))
return 0;
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);
if (STRINGP (visit))
S_IREAD | S_IWRITE);
#else /* not DOS_NT */
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);
#endif /* not DOS_NT */
#endif /* not VMS */
{
this = args[textprops[argnum].argnum];
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);
}
}
if (EQ (key, HASH_KEY (h, i))
|| (h->cmpfn
&& h->cmpfn (h, key, hash_code,
- HASH_KEY (h, i), HASH_HASH (h, i))))
+ HASH_KEY (h, i), XUINT (HASH_HASH (h, i)))))
break;
idx = HASH_NEXT (h, i);
}
if (EQ (key, HASH_KEY (h, i))
|| (h->cmpfn
&& 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. */
if (NILP (prev))
pos = XCDR (string);
string = XCAR (string);
- if (pos >= 0
- && pos < XSTRING (string)->size
+ if (XINT (pos) >= 0
+ && XINT (pos) < XSTRING (string)->size
&& (map = Fget_text_property (pos, Qlocal_map,
string),
!NILP (map)))
case Lisp_Vectorlike:
{
int i;
- int length = Flength(subtree);
+ int length = XINT (Flength(subtree));
for (i = 0; i < length; i++)
{
Lisp_Object idx = make_number (i);
Lisp_Object last;
struct gcpro gcpro1, gcpro2;
- completion = Ftry_completion (Ffield_string (ZV),
+ completion = Ftry_completion (Ffield_string (make_number (ZV)),
Vminibuffer_completion_table,
Vminibuffer_completion_predicate);
last = last_exact_completion;
}
/* compiler bug */
- tem = Fstring_equal (completion, Ffield_string(ZV));
+ tem = Fstring_equal (completion, Ffield_string(make_number (ZV)));
completedp = NILP (tem);
if (completedp)
{
}
/* 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))
{
/* not an exact match */
last_exact_completion = completion;
if (!NILP (last))
{
- tem = Ffield_string (ZV);
+ tem = Ffield_string (make_number (ZV));
if (!NILP (Fequal (tem, last)))
Fminibuffer_completion_help ();
}
Lisp_Object val;
/* Allow user to specify null string */
- if (Ffield_beginning (ZV, Qnil) == ZV)
+ if (XINT (Ffield_beginning (make_number (ZV), Qnil)) == ZV)
goto exit;
- if (!NILP (test_completion (Ffield_string (ZV))))
+ if (!NILP (test_completion (Ffield_string (make_number (ZV)))))
goto exit;
/* Call do_completion, but ignore errors. */
/* We keep calling Fbuffer_string rather than arrange for GC to
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_predicate);
if (NILP (completion))
return Qnil;
#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;
i = ZV - 1 - XSTRING (completion)->size;
p = XSTRING (completion)->data;
int buffer_nchars, completion_nchars;
CHECK_STRING (completion, 0);
- tem = Ffield_string (ZV);
+ tem = Ffield_string (make_number (ZV));
GCPRO2 (completion, tem);
/* If reading a file name,
expand any $ENVVAR refs in the buffer and in TEM. */
}
#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;
if (i == XSTRING (completion)->size)
{
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_predicate);
UNGCPRO;
{
GCPRO1 (completion);
tem =
- Ftry_completion (concat2 (Ffield_string (ZV), build_string ("-")),
+ Ftry_completion (concat2 (Ffield_string (make_number (ZV)), build_string ("-")),
Vminibuffer_completion_table,
Vminibuffer_completion_predicate);
UNGCPRO;
Lisp_Object completions;
message ("Making completion list...");
- completions = Fall_completions (Ffield_string (ZV),
+ completions = Fall_completions (Ffield_string (make_number (ZV)),
Vminibuffer_completion_table,
Vminibuffer_completion_predicate,
Qt);
if (! NILP (Vprint_circle) || SYMBOLP (obj))
{
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. */
PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt;
/* With the print-circle feature. */
int 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)))
{
{
int 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)))
{
XSTRING in those cases. However, compile_pattern_1 is only
applied to the cache entry we pick here to reuse. So nil
should never appear before a non-nil entry. */
- if (cp->regexp == Qnil)
+ if (NILP (cp->regexp))
goto compile_it;
if (XSTRING (cp->regexp)->size == XSTRING (pattern)->size
&& !NILP (Fstring_equal (cp->regexp, pattern))
temp_it.dp = NULL;
temp_it.what = IT_CHARACTER;
temp_it.len = 1;
- temp_it.object = 0;
+ temp_it.object = make_number (0);
bzero (&temp_it.current, sizeof temp_it.current);
if (what == IT_CONTINUATION)