+2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
+
+ * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
+ written backwards.
+ * blockinput.h (input_blocked_p): Likewise.
+ * bytecode.c (exec_byte_code): Likewise.
+ * callproc.c (call_process_kill, call_process_cleanup)
+ (Fcall_process): Likewise.
+ * ccl.c (ccl_driver, resolve_symbol_ccl_program)
+ (Fccl_execute_on_string): Likewise.
+ * character.c (string_escape_byte8): Likewise.
+ * charset.c (read_hex): Likewise.
+ * cm.c (calccost): Likewise.
+ * data.c (cons_to_unsigned): Likewise.
+ * dired.c (directory_files_internal, file_name_completion):
+ Likewise.
+ * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
+ (sit_for): Likewise.
+ * doc.c (Fsubstitute_command_keys): Likewise.
+ * doprnt.c (doprnt): Likewise.
+ * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
+ * emacsgtkfixed.c: Likewise.
+ * fileio.c (file_offset, Fwrite_region): Likewise.
+ * floatfns.c (Fexpt, fmod_float): Likewise.
+ * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
+ Likewise.
+ * font.c (font_intern_prop): Likewise.
+ * frame.c (x_set_alpha): Likewise.
+ * gtkutil.c (get_utf8_string): Likewise.
+ * indent.c (check_display_width): Likewise.
+ * intervals.c (create_root_interval, rotate_right, rotate_left)
+ (split_interval_right, split_interval_left)
+ (adjust_intervals_for_insertion, delete_node)
+ (interval_deletion_adjustment, adjust_intervals_for_deletion)
+ (merge_interval_right, merge_interval_left, copy_intervals)
+ (set_intervals_multibyte_1): Likewise.
+ * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
+ * keymap.c (Fkey_description): Likewise.
+ * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
+ * lread.c (openp, read_integer, read1, string_to_number):
+ Likewise.
+ * menu.c (ensure_menu_items): Likewise.
+ * minibuf.c (read_minibuf_noninteractive): Likewise.
+ * print.c (printchar, strout): Likewise.
+ * process.c (create_process, Faccept_process_output)
+ (wait_reading_process_output, read_process_output, send_process)
+ (wait_reading_process_output): Likewise.
+ * profiler.c (make_log, handle_profiler_signal): Likewise.
+ * regex.c (re_exec): Likewise.
+ * regex.h: Likewise.
+ * search.c (looking_at_1, Freplace_match): Likewise.
+ * sysdep.c (get_child_status, procfs_ttyname)
+ (procfs_get_total_memory): Likewise.
+ * systime.h (EMACS_TIME_VALID_P): Likewise.
+ * term.c (dissociate_if_controlling_tty): Likewise.
+ * window.c (get_phys_cursor_glyph): Likewise.
+ * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
+ (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
+ Likewise.
+ * xfns.c (Fx_window_property): Likewise.
+ * xmenu.c (set_frame_menubar): Likewise.
+ * xselect.c (x_get_window_property, x_handle_dnd_message):
+ Likewise.
+ * xsmfns.c (smc_save_yourself_CB): Likewise.
+ * xterm.c (x_scroll_bar_set_handle): Likewise.
+
2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
* xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
a public macro and no need to inline by hand.
2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
- Stefan Monnier <monnier@iro.umontreal.ca>
- Juanma Barranquero <lekktu@gmail.com>
+ Stefan Monnier <monnier@iro.umontreal.ca>
+ Juanma Barranquero <lekktu@gmail.com>
* profiler.c: New file.
* Makefile.in (base_obj): Add profiler.o.
ptrdiff_t nitems_incr_max = n_max - n;
ptrdiff_t incr = max (nitems_incr_min, min (incr_estimate, nitems_incr_max));
- eassert (0 < item_size && 0 < nitems_incr_min && 0 <= n && -1 <= nitems_max);
+ eassert (item_size > 0 && nitems_incr_min > 0 && n >= 0 && nitems_max >= -1);
if (! pa)
*nitems = 0;
if (nitems_incr_max < incr)
double tot = total_bytes_of_live_objects ();
tot *= XFLOAT_DATA (Vgc_cons_percentage);
- if (0 < tot)
+ if (tot > 0)
{
if (tot < TYPE_MAXIMUM (EMACS_INT))
gc_relative_threshold = tot;
BLOCKINPUT_INLINE bool
input_blocked_p (void)
{
- return 0 < interrupt_input_blocked;
+ return interrupt_input_blocked > 0;
}
INLINE_HEADER_END
the table clearer. */
#define LABEL(OP) [OP] = &&insn_ ## OP
-#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Woverride-init"
#endif
#undef DEFINE
};
-#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
# pragma GCC diagnostic pop
#endif
/* Synchronous subprocess invocation for GNU Emacs.
- Copyright (C) 1985-1988, 1993-1995, 1999-2012
+ Copyright (C) 1985-1988, 1993-1995, 1999-2013
Free Software Foundation, Inc.
This file is part of GNU Emacs.
static Lisp_Object
call_process_kill (Lisp_Object ignored)
{
- if (0 <= synch_process_fd)
+ if (synch_process_fd >= 0)
emacs_close (synch_process_fd);
if (synch_process_pid)
}
#endif
- if (0 <= synch_process_fd)
+ if (synch_process_fd >= 0)
emacs_close (synch_process_fd);
#ifdef MSDOS
child_errno = errno;
- if (0 < pid)
+ if (pid > 0)
{
if (INTEGERP (buffer))
record_deleted_pid (pid);
}
map = XCDR (map);
if (! (VECTORP (map)
- && 0 < ASIZE (map)
+ && ASIZE (map) > 0
&& INTEGERP (AREF (map, 0))
&& XINT (AREF (map, 0)) <= op
&& op - XINT (AREF (map, 0)) + 1 < ASIZE (map)))
return Qnil;
}
- if (! (0 <= XINT (AREF (result, CCL_HEADER_BUF_MAG))
+ if (! (XINT (AREF (result, CCL_HEADER_BUF_MAG)) >= 0
&& ASCENDING_ORDER (0, XINT (AREF (result, CCL_HEADER_EOF)),
ASIZE (ccl))))
return Qnil;
produced_chars += ccl.produced;
offset = outp - outbuf;
shortfall = ccl.produced * max_expansion - (outbufsize - offset);
- if (0 < shortfall)
+ if (shortfall > 0)
{
outbuf = xpalloc (outbuf, &outbufsize, shortfall, -1, 1);
outp = outbuf + offset;
if (multibyte)
{
- if ((MOST_POSITIVE_FIXNUM - nchars) / 3 < byte8_count
- || (STRING_BYTES_BOUND - nbytes) / 2 < byte8_count)
+ if (byte8_count > (MOST_POSITIVE_FIXNUM - nchars) / 3
+ || byte8_count > (STRING_BYTES_BOUND - nbytes) / 2)
string_overflow ();
/* Convert 2-byte sequence of byte8 chars to 4-byte octal. */
}
else
{
- if ((STRING_BYTES_BOUND - nbytes) / 3 < byte8_count)
+ if (byte8_count > (STRING_BYTES_BOUND - nbytes) / 3)
string_overflow ();
/* Convert 1-byte sequence of byte8 chars to 4-byte octal. */
n = 0;
while (c_isxdigit (c = getc (fp)))
{
- if (UINT_MAX >> 4 < n)
+ if (n > UINT_MAX >> 4)
*overflow = 1;
n = ((n << 4)
| (c - ('0' <= c && c <= '9' ? '0'
if (doit)
do
emacs_tputs (tty, p, 1, cmputc);
- while (0 < --deltay);
+ while (--deltay > 0);
x:
if ((deltax = dstx - srcx) == 0)
goto done;
if (doit)
do
emacs_tputs (tty, p, 1, cmputc);
- while (0 < --deltax);
+ while (--deltax > 0);
done:
return totalcost;
}
uintmax_t val IF_LINT (= 0);
if (INTEGERP (c))
{
- valid = 0 <= XINT (c);
+ valid = XINT (c) >= 0;
val = XINT (c);
}
else if (FLOATP (c))
{
double d = XFLOAT_DATA (c);
- if (0 <= d
+ if (d >= 0
&& d < (max == UINTMAX_MAX ? (double) UINTMAX_MAX + 1 : max + 1))
{
val = d;
QUIT;
if (NILP (match)
- || (0 <= re_search (bufp, SSDATA (name), len, 0, len, 0)))
+ || re_search (bufp, SSDATA (name), len, 0, len, 0) >= 0)
wanted = 1;
immediate_quit = 0;
QUIT;
if (len < SCHARS (encoded_file)
- || 0 <= scmp (dp->d_name, SSDATA (encoded_file),
- SCHARS (encoded_file)))
+ || scmp (dp->d_name, SSDATA (encoded_file),
+ SCHARS (encoded_file)) >= 0)
continue;
if (file_name_completion_stat (fd, dp, &st) < 0)
if (skip < 0)
continue;
- if (0 <= scmp (dp->d_name + skip, p1, elt_len))
+ if (scmp (dp->d_name + skip, p1, elt_len) >= 0)
continue;
break;
}
skip = len - SCHARS (elt);
if (skip < 0) continue;
- if (0 <= scmp (dp->d_name + skip,
- SSDATA (elt),
- SCHARS (elt)))
+ if (scmp (dp->d_name + skip, SSDATA (elt), SCHARS (elt))
+ >= 0)
continue;
break;
}
row_table[row_entry_pool[i].bucket] = NULL;
/* Value is 1 to indicate that we scrolled the display. */
- return 0 < nruns;
+ return nruns > 0;
}
}
}
- lint_assume (0 <= FRAME_LINES (f));
+ lint_assume (FRAME_LINES (f) >= 0);
pause_p = 0 < i && i < FRAME_LINES (f) - 1;
/* Now just clean up termcap drivers and set cursor, etc. */
duration += XINT (milliseconds) / 1000.0;
}
- if (0 < duration)
+ if (duration > 0)
{
EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (duration);
wait_reading_process_output (min (EMACS_SECS (t), WAIT_READING_MAX),
if (INTEGERP (timeout))
{
sec = XINT (timeout);
- if (! (0 < sec))
+ if (sec <= 0)
return Qt;
nsec = 0;
}
else if (FLOATP (timeout))
{
double seconds = XFLOAT_DATA (timeout);
- if (! (0 < seconds))
+ if (seconds <= 0)
return Qt;
else
{
if (NILP (tem)) /* but not on any keys */
{
ptrdiff_t offset = bufp - buf;
- if (STRING_BYTES_BOUND - 4 < bsize)
+ if (bsize > STRING_BYTES_BOUND - 4)
string_overflow ();
buf = xrealloc (buf, bsize += 4);
bufp = buf + offset;
/* Copy string into final output, truncating if no room. */
doit:
- eassert (0 <= tem);
+ eassert (tem >= 0);
/* Coming here means STRING contains ASCII only. */
if (STRING_BYTES_BOUND < tem)
error ("Format width or precision too large");
no runtime check is needed, and taking care not to convert
negative numbers to unsigned before comparing them. */
if (! ((! TYPE_SIGNED (time_t)
- || MOST_NEGATIVE_FIXNUM <= TIME_T_MIN >> 16
- || MOST_NEGATIVE_FIXNUM <= hi)
+ || TIME_T_MIN >> 16 >= MOST_NEGATIVE_FIXNUM
+ || hi >= MOST_NEGATIVE_FIXNUM)
&& (TIME_T_MAX >> 16 <= MOST_POSITIVE_FIXNUM
|| hi <= MOST_POSITIVE_FIXNUM)))
time_overflow ();
if (result)
{
- if ((TYPE_SIGNED (time_t) ? TIME_T_MIN >> 16 <= hi : 0 <= hi)
+ if (hi >= (TYPE_SIGNED (time_t) ? TIME_T_MIN >> 16 : 0)
&& hi <= TIME_T_MAX >> 16)
{
/* Return the greatest representable time that is not greater
trailing "d"). */
pMlen = sizeof pMd - 2
};
- verify (0 < USEFUL_PRECISION_MAX);
+ verify (USEFUL_PRECISION_MAX > 0);
int prec;
ptrdiff_t padding, sprintf_bytes;
#include "xterm.h"
/* Silence a bogus diagnostic; see GNOME bug 683906. */
-#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#endif
if (FLOATP (val))
{
double v = XFLOAT_DATA (val);
- if (0 <= v
+ if (v >= 0
&& (sizeof (off_t) < sizeof v
? v <= TYPE_MAXIMUM (off_t)
: v < TYPE_MAXIMUM (off_t)))
&& ! (valid_timestamp_file_system && st.st_dev == timestamp_file_system))
{
int desc1 = emacs_open (fn, O_WRONLY | O_BINARY, 0);
- if (0 <= desc1)
+ if (desc1 >= 0)
{
struct stat st1;
if (fstat (desc1, &st1) == 0
CHECK_NUMBER_OR_FLOAT (arg2);
if (INTEGERP (arg1) /* common lisp spec */
&& INTEGERP (arg2) /* don't promote, if both are ints, and */
- && 0 <= XINT (arg2)) /* we are sure the result is not fractional */
+ && XINT (arg2) >= 0) /* we are sure the result is not fractional */
{ /* this can be improved by pre-calculating */
EMACS_INT y; /* some binary powers of x then accumulating */
EMACS_UINT acc, x; /* Unsigned so that overflow is well defined. */
f1 = fmod (f1, f2);
/* If the "remainder" comes out with the wrong sign, fix it. */
- if (f2 < 0 ? 0 < f1 : f1 < 0)
+ if (f2 < 0 ? f1 > 0 : f1 < 0)
f1 += f2;
return make_float (f1);
ptrdiff_t n_max = (0 <= nitems_max && nitems_max < C_language_max
? nitems_max : C_language_max);
eassert (VECTORP (vec));
- eassert (0 < incr_min && -1 <= nitems_max);
+ eassert (incr_min > 0 && nitems_max >= -1);
old_size = ASIZE (vec);
incr_max = n_max - old_size;
incr = max (incr_min, min (old_size >> 1, incr_max));
eassert (SYMBOLP (test.name));
eassert (INTEGERP (size) && XINT (size) >= 0);
eassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0)
- || (FLOATP (rehash_size) && 1 < XFLOAT_DATA (rehash_size)));
+ || (FLOATP (rehash_size) && XFLOAT_DATA (rehash_size) > 1));
eassert (FLOATP (rehash_threshold)
- && 0 < XFLOAT_DATA (rehash_threshold)
+ && XFLOAT_DATA (rehash_threshold) > 0
&& XFLOAT_DATA (rehash_threshold) <= 1.0);
if (XFASTINT (size) == 0)
/* Look for `:rehash-size SIZE'. */
i = get_key_arg (QCrehash_size, nargs, args, used);
rehash_size = i ? args[i] : make_float (DEFAULT_REHASH_SIZE);
- if (! ((INTEGERP (rehash_size) && 0 < XINT (rehash_size))
- || (FLOATP (rehash_size) && 1 < XFLOAT_DATA (rehash_size))))
+ if (! ((INTEGERP (rehash_size) && XINT (rehash_size) > 0)
+ || (FLOATP (rehash_size) && XFLOAT_DATA (rehash_size) > 1)))
signal_error ("Invalid hash table rehash size", rehash_size);
/* Look for `:rehash-threshold THRESHOLD'. */
i = get_key_arg (QCrehash_threshold, nargs, args, used);
rehash_threshold = i ? args[i] : make_float (DEFAULT_REHASH_THRESHOLD);
if (! (FLOATP (rehash_threshold)
- && 0 < XFLOAT_DATA (rehash_threshold)
+ && XFLOAT_DATA (rehash_threshold) > 0
&& XFLOAT_DATA (rehash_threshold) <= 1))
signal_error ("Invalid hash table rehash threshold", rehash_threshold);
if (len == 1 && *str == '*')
return Qnil;
- if (!force_symbol && 0 < len && '0' <= *str && *str <= '9')
+ if (!force_symbol && len > 0 && '0' <= *str && *str <= '9')
{
for (i = 1; i < len; i++)
if (! ('0' <= str[i] && str[i] <= '9'))
{
if (i == len)
return make_number (n);
- if (MOST_POSITIVE_FIXNUM / 10 < n)
+ if (n > MOST_POSITIVE_FIXNUM / 10)
break;
}
else if (FLOATP (item))
{
alpha = XFLOAT_DATA (item);
- if (alpha < 0.0 || 1.0 < alpha)
+ if (alpha < 0.0 || alpha > 1.0)
args_out_of_range (make_float (0.0), make_float (1.0));
}
else if (INTEGERP (item))
{
EMACS_INT ialpha = XINT (item);
- if (ialpha < 0 || 100 < ialpha)
+ if (ialpha < 0 || ialpha > 100)
args_out_of_range (make_number (0), make_number (100));
else
alpha = ialpha / 100.0;
if (cp) g_free (cp);
len = strlen (str);
- if ((min (PTRDIFF_MAX, SIZE_MAX) - len - 1) / 4 < nr_bad)
+ if (nr_bad > (min (PTRDIFF_MAX, SIZE_MAX) - len - 1) / 4)
memory_full (SIZE_MAX);
up = utf8_str = xmalloc (len + nr_bad * 4 + 1);
p = (unsigned char *)str;
if ((prop = Fplist_get (plist, QCwidth),
RANGED_INTEGERP (0, prop, INT_MAX)))
width = XINT (prop);
- else if (FLOATP (prop) && 0 <= XFLOAT_DATA (prop)
+ else if (FLOATP (prop) && XFLOAT_DATA (prop) >= 0
&& XFLOAT_DATA (prop) <= INT_MAX)
width = (int)(XFLOAT_DATA (prop) + 0.5);
else if ((prop = Fplist_get (plist, QCalign_to),
{
new->total_length = (BUF_Z (XBUFFER (parent))
- BUF_BEG (XBUFFER (parent)));
- eassert (0 <= TOTAL_LENGTH (new));
+ eassert (TOTAL_LENGTH (new) >= 0);
set_buffer_intervals (XBUFFER (parent), new);
new->position = BEG;
}
else if (STRINGP (parent))
{
new->total_length = SCHARS (parent);
- eassert (0 <= TOTAL_LENGTH (new));
+ eassert (TOTAL_LENGTH (new) >= 0);
set_string_intervals (parent, new);
new->position = 0;
}
/* A's total length is decreased by the length of B and its left child. */
interval->total_length -= B->total_length - LEFT_TOTAL_LENGTH (interval);
- eassert (0 <= TOTAL_LENGTH (interval));
+ eassert (TOTAL_LENGTH (interval) >= 0);
/* B must have the same total length of A. */
B->total_length = old_total;
- eassert (0 <= TOTAL_LENGTH (B));
+ eassert (TOTAL_LENGTH (B) >= 0);
return B;
}
/* A's total length is decreased by the length of B and its right child. */
interval->total_length -= B->total_length - RIGHT_TOTAL_LENGTH (interval);
- eassert (0 <= TOTAL_LENGTH (interval));
+ eassert (TOTAL_LENGTH (interval) >= 0);
/* B must have the same total length of A. */
B->total_length = old_total;
- eassert (0 <= TOTAL_LENGTH (B));
+ eassert (TOTAL_LENGTH (B) >= 0);
return B;
}
{
set_interval_right (interval, new);
new->total_length = new_length;
- eassert (0 <= TOTAL_LENGTH (new));
+ eassert (TOTAL_LENGTH (new) >= 0);
}
else
{
set_interval_parent (interval->right, new);
set_interval_right (interval, new);
new->total_length = new_length + new->right->total_length;
- eassert (0 <= TOTAL_LENGTH (new));
+ eassert (TOTAL_LENGTH (new) >= 0);
balance_an_interval (new);
}
{
set_interval_left (interval, new);
new->total_length = new_length;
- eassert (0 <= TOTAL_LENGTH (new));
+ eassert (TOTAL_LENGTH (new) >= 0);
}
else
{
set_interval_parent (new->left, new);
set_interval_left (interval, new);
new->total_length = new_length + new->left->total_length;
- eassert (0 <= TOTAL_LENGTH (new));
+ eassert (TOTAL_LENGTH (new) >= 0);
balance_an_interval (new);
}
for (temp = prev ? prev : i; temp; temp = INTERVAL_PARENT_OR_NULL (temp))
{
temp->total_length += length;
- eassert (0 <= TOTAL_LENGTH (temp));
+ eassert (TOTAL_LENGTH (temp) >= 0);
temp = balance_possible_root_interval (temp);
}
for (temp = i; temp; temp = INTERVAL_PARENT_OR_NULL (temp))
{
temp->total_length += length;
- eassert (0 <= TOTAL_LENGTH (temp));
+ eassert (TOTAL_LENGTH (temp) >= 0);
temp = balance_possible_root_interval (temp);
}
}
this = this->left;
this->total_length += migrate_amt;
}
- eassert (0 <= TOTAL_LENGTH (this));
+ eassert (TOTAL_LENGTH (this) >= 0);
set_interval_left (this, migrate);
set_interval_parent (migrate, this);
relative_position,
amount);
tree->total_length -= subtract;
- eassert (0 <= TOTAL_LENGTH (tree));
+ eassert (TOTAL_LENGTH (tree) >= 0);
return subtract;
}
/* Right branch. */
relative_position,
amount);
tree->total_length -= subtract;
- eassert (0 <= TOTAL_LENGTH (tree));
+ eassert (TOTAL_LENGTH (tree) >= 0);
return subtract;
}
/* Here -- this node. */
amount = my_amount;
tree->total_length -= amount;
- eassert (0 <= TOTAL_LENGTH (tree));
+ eassert (TOTAL_LENGTH (tree) >= 0);
if (LENGTH (tree) == 0)
delete_interval (tree);
if (ONLY_INTERVAL_P (tree))
{
tree->total_length -= length;
- eassert (0 <= TOTAL_LENGTH (tree));
+ eassert (TOTAL_LENGTH (tree) >= 0);
return;
}
while (! NULL_LEFT_CHILD (successor))
{
successor->total_length += absorb;
- eassert (0 <= TOTAL_LENGTH (successor));
+ eassert (TOTAL_LENGTH (successor) >= 0);
successor = successor->left;
}
successor->total_length += absorb;
- eassert (0 <= TOTAL_LENGTH (successor));
+ eassert (TOTAL_LENGTH (successor) >= 0);
delete_interval (i);
return successor;
}
/* Zero out this interval. */
i->total_length -= absorb;
- eassert (0 <= TOTAL_LENGTH (i));
+ eassert (TOTAL_LENGTH (i) >= 0);
successor = i;
while (! NULL_PARENT (successor)) /* It's above us. Subtract as
successor = INTERVAL_PARENT (successor);
successor->total_length -= absorb;
- eassert (0 <= TOTAL_LENGTH (successor));
+ eassert (TOTAL_LENGTH (successor) >= 0);
}
/* This must be the rightmost or last interval and cannot
while (! NULL_RIGHT_CHILD (predecessor))
{
predecessor->total_length += absorb;
- eassert (0 <= TOTAL_LENGTH (predecessor));
+ eassert (TOTAL_LENGTH (predecessor) >= 0);
predecessor = predecessor->right;
}
predecessor->total_length += absorb;
- eassert (0 <= TOTAL_LENGTH (predecessor));
+ eassert (TOTAL_LENGTH (predecessor) >= 0);
delete_interval (i);
return predecessor;
}
/* Zero out this interval. */
i->total_length -= absorb;
- eassert (0 <= TOTAL_LENGTH (i));
+ eassert (TOTAL_LENGTH (i) >= 0);
predecessor = i;
while (! NULL_PARENT (predecessor)) /* It's above us. Go up,
predecessor = INTERVAL_PARENT (predecessor);
predecessor->total_length -= absorb;
- eassert (0 <= TOTAL_LENGTH (predecessor));
+ eassert (TOTAL_LENGTH (predecessor) >= 0);
}
/* This must be the leftmost or first interval and cannot
new->position = 0;
got = (LENGTH (i) - (start - i->position));
new->total_length = length;
- eassert (0 <= TOTAL_LENGTH (new));
+ eassert (TOTAL_LENGTH (new) >= 0);
copy_properties (i, new);
t = new;
i->total_length = end - start;
else
i->total_length = end_byte - start_byte;
- eassert (0 <= TOTAL_LENGTH (i));
+ eassert (TOTAL_LENGTH (i) >= 0);
if (TOTAL_LENGTH (i) == 0)
{
hold_quit.kind = NO_EVENT;
/* No need for FIONREAD or fcntl; just say don't wait. */
- while (0 < (nr = (*t->read_socket_hook) (t, &hold_quit)))
+ while ((nr = (*t->read_socket_hook) (t, &hold_quit)) > 0)
nread += nr;
if (nr == -1) /* Not OK to read input now. */
- (ASIZE (tool_bar_items_vector) - TOOL_BAR_ITEM_NSLOTS));
/* Enlarge tool_bar_items_vector if necessary. */
- if (0 < incr)
- tool_bar_items_vector
- = larger_vector (tool_bar_items_vector, incr, -1);
+ if (incr > 0)
+ tool_bar_items_vector = larger_vector (tool_bar_items_vector, incr, -1);
/* Append entries from tool_bar_item_properties to the end of
tool_bar_items_vector. */
size += XINT (Flength (prefix));
/* This has one extra element at the end that we don't pass to Fconcat. */
- if (min (PTRDIFF_MAX, SIZE_MAX) / word_size / 4 < size)
+ if (size > min (PTRDIFF_MAX, SIZE_MAX) / word_size / 4)
memory_full (SIZE_MAX);
SAFE_ALLOCA_LISP (args, size * 4);
type or if I is a NaN. */
#define FIXNUM_OVERFLOW_P(i) \
- (! ((0 <= (i) || MOST_NEGATIVE_FIXNUM <= (i)) && (i) <= MOST_POSITIVE_FIXNUM))
+ (! (((i) >= 0 || (i) >= MOST_NEGATIVE_FIXNUM) && (i) <= MOST_POSITIVE_FIXNUM))
LISP_INLINE ptrdiff_t
clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
LISP_INLINE void
vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Object *args, ptrdiff_t count)
{
- eassert (0 <= offset && 0 <= count && offset + count <= ASIZE (v));
+ eassert (offset >= 0 && count >= 0 && offset + count <= ASIZE (v));
memcpy (XVECTOR (v)->contents + offset, args, count * sizeof *args);
}
{
struct stat st;
fd = emacs_open (pfn, O_RDONLY, 0);
- if (0 <= fd
+ if (fd >= 0
&& (fstat (fd, &st) != 0 || S_ISDIR (st.st_mode)))
{
emacs_close (fd);
while (c == '0');
}
- while (-1 <= (digit = digit_to_number (c, radix)))
+ while ((digit = digit_to_number (c, radix)) >= -1)
{
if (digit == -1)
valid = 0;
/* Read a non-negative integer. */
while (c >= '0' && c <= '9')
{
- if (MOST_POSITIVE_FIXNUM / 10 < n
- || MOST_POSITIVE_FIXNUM < n * 10 + c - '0')
+ if (n > MOST_POSITIVE_FIXNUM / 10
+ || n * 10 + c - '0' > MOST_POSITIVE_FIXNUM)
n = MOST_POSITIVE_FIXNUM + 1;
else
n = n * 10 + c - '0';
if (end - p < MAX_MULTIBYTE_LENGTH)
{
ptrdiff_t offset = p - read_buffer;
- if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size)
+ if (read_buffer_size > min (PTRDIFF_MAX, SIZE_MAX) / 2)
memory_full (SIZE_MAX);
read_buffer = xrealloc (read_buffer, read_buffer_size * 2);
read_buffer_size *= 2;
if (end - p < MAX_MULTIBYTE_LENGTH)
{
ptrdiff_t offset = p - read_buffer;
- if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size)
+ if (read_buffer_size > min (PTRDIFF_MAX, SIZE_MAX) / 2)
memory_full (SIZE_MAX);
read_buffer = xrealloc (read_buffer, read_buffer_size * 2);
read_buffer_size *= 2;
if (p == end)
{
ptrdiff_t offset = p - read_buffer;
- if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size)
+ if (read_buffer_size > min (PTRDIFF_MAX, SIZE_MAX) / 2)
memory_full (SIZE_MAX);
read_buffer = xrealloc (read_buffer, read_buffer_size * 2);
read_buffer_size *= 2;
state = 0;
leading_digit = digit_to_number (*cp, base);
- if (0 <= leading_digit)
+ if (leading_digit >= 0)
{
state |= LEAD_INT;
do
++cp;
- while (0 <= digit_to_number (*cp, base));
+ while (digit_to_number (*cp, base) >= 0);
}
if (*cp == '.')
{
/* If the number uses integer and not float syntax, and is in C-language
range, use its value, preferably as a fixnum. */
- if (0 <= leading_digit && ! float_syntax)
+ if (leading_digit >= 0 && ! float_syntax)
{
uintmax_t n;
ensure_menu_items (int items)
{
int incr = items - (menu_items_allocated - menu_items_used);
- if (0 < incr)
+ if (incr > 0)
{
menu_items = larger_vector (menu_items, incr, INT_MAX);
menu_items_allocated = ASIZE (menu_items);
{
if (len == size)
{
- if (STRING_BYTES_BOUND / 2 < size)
+ if (size > STRING_BYTES_BOUND / 2)
memory_full (SIZE_MAX);
size *= 2;
line = xrealloc (line, size);
if (NILP (fun))
{
ptrdiff_t incr = len - (print_buffer_size - print_buffer_pos_byte);
- if (0 < incr)
- print_buffer =
- xpalloc (print_buffer, &print_buffer_size, incr, -1, 1);
+ if (incr > 0)
+ print_buffer = xpalloc (print_buffer, &print_buffer_size,
+ incr, -1, 1);
memcpy (print_buffer + print_buffer_pos_byte, str, len);
print_buffer_pos += 1;
print_buffer_pos_byte += len;
if (NILP (printcharfun))
{
ptrdiff_t incr = size_byte - (print_buffer_size - print_buffer_pos_byte);
- if (0 < incr)
+ if (incr > 0)
print_buffer = xpalloc (print_buffer, &print_buffer_size, incr, -1, 1);
memcpy (print_buffer + print_buffer_pos_byte, ptr, size_byte);
print_buffer_pos += size;
/* Work around GCC 4.7.0 bug with strict overflow checking; see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>.
These lines can be removed once the GCC bug is fixed. */
-#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
# pragma GCC diagnostic ignored "-Wstrict-overflow"
#endif
/* Back in the parent process. */
XPROCESS (process)->pid = pid;
- if (0 <= pid)
+ if (pid >= 0)
XPROCESS (process)->alive = 1;
/* Stop blocking signals in the parent. */
{
if (INTEGERP (seconds))
{
- if (0 < XINT (seconds))
+ if (XINT (seconds) > 0)
{
secs = XINT (seconds);
nsecs = 0;
}
else if (FLOATP (seconds))
{
- if (0 < XFLOAT_DATA (seconds))
+ if (XFLOAT_DATA (seconds) > 0)
{
EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (XFLOAT_DATA (seconds));
secs = min (EMACS_SECS (t), WAIT_READING_MAX);
time_limit = 0;
nsecs = -1;
}
- else if (TYPE_MAXIMUM (time_t) < time_limit)
+ else if (time_limit > TYPE_MAXIMUM (time_t))
time_limit = TYPE_MAXIMUM (time_t);
/* Since we may need to wait several times,
compute the absolute time to return at. */
- if (time_limit || 0 < nsecs)
+ if (time_limit || nsecs > 0)
{
timeout = make_emacs_time (time_limit, nsecs);
end_time = add_emacs_time (current_emacs_time (), timeout);
timeout = make_emacs_time (0, 0);
}
- else if (time_limit || 0 < nsecs)
+ else if (time_limit || nsecs > 0)
{
EMACS_TIME now = current_emacs_time ();
if (EMACS_TIME_LE (end_time, now))
break;
/* A negative timeout means do not wait at all. */
- if (0 <= nsecs)
+ if (nsecs >= 0)
{
if (EMACS_TIME_VALID_P (timer_delay))
{
if (nread == 0)
break;
- if (0 < nread)
+ if (nread > 0)
{
total_nread += nread;
got_some_input = 1;
else
#endif
{
- bool buffered = 0 <= proc_buffered_char[channel];
+ bool buffered = proc_buffered_char[channel] >= 0;
if (buffered)
{
chars[carryover] = proc_buffered_char[channel];
rv = sendto (outfd, cur_buf, cur_len,
0, datagram_address[outfd].sa,
datagram_address[outfd].len);
- if (0 <= rv)
+ if (rv >= 0)
written = rv;
else if (errno == EMSGSIZE)
report_file_error ("sending datagram", Fcons (proc, Qnil));
time_limit = TYPE_MAXIMUM (time_t);
/* What does time_limit really mean? */
- if (time_limit || 0 < nsecs)
+ if (time_limit || nsecs > 0)
{
timeout = make_emacs_time (time_limit, nsecs);
end_time = add_emacs_time (current_emacs_time (), timeout);
timeout = make_emacs_time (0, 0);
}
- else if (time_limit || 0 < nsecs)
+ else if (time_limit || nsecs > 0)
{
EMACS_TIME now = current_emacs_time ();
if (EMACS_TIME_LE (end_time, now))
&& requeued_events_pending_p ())
break;
- if (EMACS_TIME_VALID_P (timer_delay) && 0 <= nsecs)
+ if (EMACS_TIME_VALID_P (timer_delay) && nsecs >= 0)
{
if (EMACS_TIME_LT (timer_delay, timeout))
{
/* What is special about our hash-tables is that the keys are pre-filled
with the vectors we'll put in them. */
int i = ASIZE (h->key_and_value) / 2;
- while (0 < i)
+ while (i > 0)
set_hash_key_slot (h, --i,
Fmake_vector (make_number (max_stack_depth), Qnil));
return log;
if (profiler_timer_ok)
{
int overruns = timer_getoverrun (profiler_timer);
- eassert (0 <= overruns);
+ eassert (overruns >= 0);
count += overruns;
}
#endif
/* Ignore some GCC warnings for now. This section should go away
once the Emacs and Gnulib regex code is merged. */
-#if (__GNUC__ == 4 && 5 <= __GNUC_MINOR__) || 4 < __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
# pragma GCC diagnostic ignored "-Wstrict-overflow"
# ifndef emacs
# pragma GCC diagnostic ignored "-Wunused-but-set-variable"
re_exec (const char *s)
{
const size_t len = strlen (s);
- return
- 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
+ return (re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0)
+ >= 0);
}
#endif /* _REGEX_RE_COMP */
\f
/* GCC 2.95 and later have "__restrict"; C99 compilers have
"restrict", and "configure" may have defined "restrict". */
#ifndef __restrict
-# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
+# if ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
# if defined restrict || 199901L <= __STDC_VERSION__
# define __restrict restrict
# else
if (i == -2)
matcher_overflow ();
- val = (0 <= i ? Qt : Qnil);
+ val = (i >= 0 ? Qt : Qnil);
if (NILP (Vinhibit_changing_match_data) && i >= 0)
for (i = 0; i < search_regs.num_regs; i++)
if (search_regs.start[i] >= 0)
else if (c >= '1' && c <= '9')
{
if (c - '0' < search_regs.num_regs
- && 0 <= search_regs.start[c - '0'])
+ && search_regs.start[c - '0'] >= 0)
{
substart = search_regs.start[c - '0'];
subend = search_regs.end[c - '0'];
bool str_multibyte = STRING_MULTIBYTE (newtext);
bool really_changed = 0;
- substed_alloc_size = ((STRING_BYTES_BOUND - 100) / 2 < length
+ substed_alloc_size = (length > (STRING_BYTES_BOUND - 100) / 2
? STRING_BYTES_BOUND
: length * 2 + 100);
substed = xmalloc (substed_alloc_size);
reap an unwanted process by mistake. For example, invoking
waitpid (-1, ...) can mess up glib by reaping glib's subprocesses,
so that another thread running glib won't find them. */
- eassert (0 < child);
+ eassert (child > 0);
while ((pid = waitpid (child, status, options)) < 0)
{
while (!feof (fdev) && !ferror (fdev))
{
- if (3 <= fscanf (fdev, "%*s %s %u %s %*s\n", name, &major, minor)
+ if (fscanf (fdev, "%*s %s %u %s %*s\n", name, &major, minor) >= 3
&& major == MAJOR (rdev))
{
minor_beg = strtoul (minor, &endp, 0);
while (!feof (fmem) && !ferror (fmem))
{
- if (2 <= fscanf (fmem, "%s %lu kB\n", entry_name, &entry_value)
+ if (fscanf (fmem, "%s %lu kB\n", entry_name, &entry_value) >= 2
&& strcmp (entry_name, "MemTotal:") == 0)
{
retval = entry_value;
SYSTIME_INLINE int
EMACS_TIME_VALID_P (EMACS_TIME t)
{
- return 0 <= t.tv_nsec;
+ return t.tv_nsec >= 0;
}
/* Convert the double D to the greatest EMACS_TIME not greater than D.
{
/* If tcgetpgrp succeeds, fd is the controlling terminal,
so dissociate it by invoking setsid. */
- if (0 <= tcgetpgrp (fd) && setsid () < 0)
+ if (tcgetpgrp (fd) >= 0 && setsid () < 0)
{
#ifdef TIOCNOTTY
/* setsid failed, presumably because Emacs is already a process
hpos = row->used[TEXT_AREA] - 1;
}
- if (row->used[TEXT_AREA] > hpos
- && 0 <= hpos)
+ if (hpos >= 0 && hpos < row->used[TEXT_AREA])
glyph = row->glyphs[TEXT_AREA] + hpos;
else
glyph = NULL;
and IT->region_end_charpos to the start and end of a visible region
in window IT->w. Set both to -1 to indicate no region. */
markpos = markpos_of_region ();
- if (0 <= markpos
+ if (markpos >= 0
/* Maybe highlight only in selected window. */
&& (/* Either show region everywhere. */
highlight_nonselected_windows
PT == w->last_point
/* Make sure the cursor was last displayed
in this window. Otherwise we have to reposition it. */
- && 0 <= w->cursor.vpos
- && WINDOW_TOTAL_LINES (w) > w->cursor.vpos)
+ && w->cursor.vpos >= 0
+ && w->cursor.vpos < WINDOW_TOTAL_LINES (w))
{
if (!must_finish)
{
/* If we are highlighting the region, then we just changed
the region, so redisplay to show it. */
- if (0 <= markpos_of_region ())
+ if (markpos_of_region () >= 0)
{
clear_glyph_matrix (w->desired_matrix);
if (!try_window (window, startp, 0))
return 0;
/* Can't do this if region may have changed. */
- if (0 <= markpos_of_region ()
+ if (markpos_of_region () >= 0
|| w->region_showing
|| !NILP (Vshow_trailing_whitespace))
return 0;
/* Can't use this if highlighting a region because a cursor movement
will do more than just set the cursor. */
- if (0 <= markpos_of_region ())
+ if (markpos_of_region () >= 0)
GIVE_UP (9);
/* Likewise if highlighting trailing whitespace. */
char * psuffix;
char * p;
- if (1000 <= quotient)
+ if (quotient >= 1000)
{
/* Scale to the appropriate EXPONENT. */
do
quotient /= 1000;
exponent++;
}
- while (1000 <= quotient);
+ while (quotient >= 1000);
/* Round to nearest and decide whether to use TENTHS or not. */
if (quotient <= 9)
{
tenths = remainder / 100;
- if (50 <= remainder % 100)
+ if (remainder % 100 >= 50)
{
if (tenths < 9)
tenths++;
}
}
else
- if (500 <= remainder)
+ if (remainder >= 500)
{
if (quotient < 999)
quotient++;
property and those are indeed in 32 bit quantities if format is
32. */
- if (32 < BITS_PER_LONG && actual_format == 32)
+ if (BITS_PER_LONG > 32 && actual_format == 32)
{
unsigned long i;
int *idata = (int *) tmp_data;
wv->help = Qnil;
first_wv = wv;
- for (i = 0; 0 <= submenu_start[i]; i++)
+ for (i = 0; submenu_start[i] >= 0; i++)
{
menu_items_n_panes = submenu_n_panes[i];
wv = digest_single_submenu (submenu_start[i], submenu_end[i],
data = data1;
}
- if (32 < BITS_PER_LONG && *actual_format_ret == 32)
+ if (BITS_PER_LONG > 32 && *actual_format_ret == 32)
{
unsigned long i;
int *idata = (int *) (data + offset);
function expects them to be of size int (i.e. 32). So to be able to
use that function, put the data in the form it expects if format is 32. */
- if (32 < BITS_PER_LONG && event->format == 32)
+ if (BITS_PER_LONG > 32 && event->format == 32)
{
for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */
idata[i] = event->data.l[i];
props[props_idx]->name = xstrdup (SmRestartCommand);
props[props_idx]->type = xstrdup (SmLISTofARRAY8);
/* /path/to/emacs, --smid=xxx --no-splash --chdir=dir ... */
- if (INT_MAX - 3 < initial_argc)
+ if (initial_argc > INT_MAX - 3)
memory_full (SIZE_MAX);
i = 3 + initial_argc;
props[props_idx]->num_vals = i;
/* Draw the empty space above the handle. Note that we can't clear
zero-height areas; that means "clear to end of window." */
- if (0 < start)
+ if (start > 0)
x_clear_area (FRAME_X_DISPLAY (f), w,
/* x, y, width, height, and exposures. */
VERTICAL_SCROLL_BAR_LEFT_BORDER,