diff options
| author | Andreas Schwab | 2014-07-26 13:58:24 +0200 |
|---|---|---|
| committer | Andreas Schwab | 2014-07-26 13:58:24 +0200 |
| commit | 3acf58eec890249179b6f992c59f9adcf05b8ca8 (patch) | |
| tree | 330419ff2ccea3f5aea9d49bd0e5aba8b1d386b2 /src | |
| parent | a072c708aaa91e61fa148b1a69884a40a5d8f9fb (diff) | |
| download | emacs-3acf58eec890249179b6f992c59f9adcf05b8ca8.tar.gz emacs-3acf58eec890249179b6f992c59f9adcf05b8ca8.zip | |
Reorder conditions that are written backwards
* alloc.c (xnmalloc, xnrealloc, xpalloc, make_save_value)
(Fgarbage_collect): Reorder conditions that are written backwards.
* data.c (cons_to_unsigned): Likewise.
* dispnew.c (update_frame_1, sit_for): Likewise.
* fileio.c (file_offset): Likewise.
* filelock.c (read_lock_data, lock_file): Likewise.
* fns.c (larger_vector, make_hash_table, Fmake_hash_table):
Likewise.
* font.c (font_intern_prop, font_style_symbolic): Likewise.
* lisp.h (FIXNUM_OVERFLOW_P): Likewise.
* lread.c (read1): Likewise.
* minibuf.c (read_minibuf_noninteractive): Likewise.
* nsterm.m (x_set_frame_alpha): Likewise.
* process.c (wait_reading_process_output): Likewise.
* region-cache.c (delete_cache_boundaries): Likewise.
* xterm.c (x_set_frame_alpha): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 18 | ||||
| -rw-r--r-- | src/data.c | 4 | ||||
| -rw-r--r-- | src/dispnew.c | 2 | ||||
| -rw-r--r-- | src/fileio.c | 4 | ||||
| -rw-r--r-- | src/filelock.c | 4 | ||||
| -rw-r--r-- | src/fns.c | 12 | ||||
| -rw-r--r-- | src/font.c | 6 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/lread.c | 12 | ||||
| -rw-r--r-- | src/minibuf.c | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 4 | ||||
| -rw-r--r-- | src/process.c | 6 | ||||
| -rw-r--r-- | src/region-cache.c | 2 | ||||
| -rw-r--r-- | src/xterm.c | 2 |
14 files changed, 40 insertions, 40 deletions
diff --git a/src/alloc.c b/src/alloc.c index a8ad44491fa..f5f25d53435 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -806,8 +806,8 @@ verify (INT_MAX <= PTRDIFF_MAX); | |||
| 806 | void * | 806 | void * |
| 807 | xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size) | 807 | xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size) |
| 808 | { | 808 | { |
| 809 | eassert (0 <= nitems && 0 < item_size); | 809 | eassert (nitems >= 0 && item_size > 0); |
| 810 | if (min (PTRDIFF_MAX, SIZE_MAX) / item_size < nitems) | 810 | if (nitems > min (PTRDIFF_MAX, SIZE_MAX) / item_size) |
| 811 | memory_full (SIZE_MAX); | 811 | memory_full (SIZE_MAX); |
| 812 | return xmalloc (nitems * item_size); | 812 | return xmalloc (nitems * item_size); |
| 813 | } | 813 | } |
| @@ -819,8 +819,8 @@ xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size) | |||
| 819 | void * | 819 | void * |
| 820 | xnrealloc (void *pa, ptrdiff_t nitems, ptrdiff_t item_size) | 820 | xnrealloc (void *pa, ptrdiff_t nitems, ptrdiff_t item_size) |
| 821 | { | 821 | { |
| 822 | eassert (0 <= nitems && 0 < item_size); | 822 | eassert (nitems >= 0 && item_size > 0); |
| 823 | if (min (PTRDIFF_MAX, SIZE_MAX) / item_size < nitems) | 823 | if (nitems > min (PTRDIFF_MAX, SIZE_MAX) / item_size) |
| 824 | memory_full (SIZE_MAX); | 824 | memory_full (SIZE_MAX); |
| 825 | return xrealloc (pa, nitems * item_size); | 825 | return xrealloc (pa, nitems * item_size); |
| 826 | } | 826 | } |
| @@ -873,10 +873,10 @@ xpalloc (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min, | |||
| 873 | ptrdiff_t nitems_incr_max = n_max - n; | 873 | ptrdiff_t nitems_incr_max = n_max - n; |
| 874 | ptrdiff_t incr = max (nitems_incr_min, min (incr_estimate, nitems_incr_max)); | 874 | ptrdiff_t incr = max (nitems_incr_min, min (incr_estimate, nitems_incr_max)); |
| 875 | 875 | ||
| 876 | eassert (0 < item_size && 0 < nitems_incr_min && 0 <= n && -1 <= nitems_max); | 876 | eassert (item_size > 0 && nitems_incr_min > 0 && n >= 0 && nitems_max >= -1); |
| 877 | if (! pa) | 877 | if (! pa) |
| 878 | *nitems = 0; | 878 | *nitems = 0; |
| 879 | if (nitems_incr_max < incr) | 879 | if (incr > nitems_incr_max) |
| 880 | memory_full (SIZE_MAX); | 880 | memory_full (SIZE_MAX); |
| 881 | n += incr; | 881 | n += incr; |
| 882 | pa = xrealloc (pa, n * item_size); | 882 | pa = xrealloc (pa, n * item_size); |
| @@ -1183,7 +1183,7 @@ lisp_align_malloc (size_t nbytes, enum mem_type type) | |||
| 1183 | } | 1183 | } |
| 1184 | ABLOCKS_BUSY (abase) = (struct ablocks *) aligned; | 1184 | ABLOCKS_BUSY (abase) = (struct ablocks *) aligned; |
| 1185 | 1185 | ||
| 1186 | eassert (0 == ((uintptr_t) abase) % BLOCK_ALIGN); | 1186 | eassert ((uintptr_t) abase % BLOCK_ALIGN == 0); |
| 1187 | eassert (ABLOCK_ABASE (&abase->blocks[3]) == abase); /* 3 is arbitrary */ | 1187 | eassert (ABLOCK_ABASE (&abase->blocks[3]) == abase); /* 3 is arbitrary */ |
| 1188 | eassert (ABLOCK_ABASE (&abase->blocks[0]) == abase); | 1188 | eassert (ABLOCK_ABASE (&abase->blocks[0]) == abase); |
| 1189 | eassert (ABLOCKS_BASE (abase) == base); | 1189 | eassert (ABLOCKS_BASE (abase) == base); |
| @@ -1205,7 +1205,7 @@ lisp_align_malloc (size_t nbytes, enum mem_type type) | |||
| 1205 | 1205 | ||
| 1206 | MALLOC_PROBE (nbytes); | 1206 | MALLOC_PROBE (nbytes); |
| 1207 | 1207 | ||
| 1208 | eassert (0 == ((uintptr_t) val) % BLOCK_ALIGN); | 1208 | eassert ((uintptr_t) val % BLOCK_ALIGN == 0); |
| 1209 | return val; | 1209 | return val; |
| 1210 | } | 1210 | } |
| 1211 | 1211 | ||
| @@ -5706,7 +5706,7 @@ garbage_collect_1 (void *end) | |||
| 5706 | double tot = total_bytes_of_live_objects (); | 5706 | double tot = total_bytes_of_live_objects (); |
| 5707 | 5707 | ||
| 5708 | tot *= XFLOAT_DATA (Vgc_cons_percentage); | 5708 | tot *= XFLOAT_DATA (Vgc_cons_percentage); |
| 5709 | if (0 < tot) | 5709 | if (tot > 0) |
| 5710 | { | 5710 | { |
| 5711 | if (tot < TYPE_MAXIMUM (EMACS_INT)) | 5711 | if (tot < TYPE_MAXIMUM (EMACS_INT)) |
| 5712 | gc_relative_threshold = tot; | 5712 | gc_relative_threshold = tot; |
diff --git a/src/data.c b/src/data.c index 3e651414e68..cb0e9a825fb 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -2460,13 +2460,13 @@ cons_to_unsigned (Lisp_Object c, uintmax_t max) | |||
| 2460 | uintmax_t val IF_LINT (= 0); | 2460 | uintmax_t val IF_LINT (= 0); |
| 2461 | if (INTEGERP (c)) | 2461 | if (INTEGERP (c)) |
| 2462 | { | 2462 | { |
| 2463 | valid = 0 <= XINT (c); | 2463 | valid = XINT (c) >= 0; |
| 2464 | val = XINT (c); | 2464 | val = XINT (c); |
| 2465 | } | 2465 | } |
| 2466 | else if (FLOATP (c)) | 2466 | else if (FLOATP (c)) |
| 2467 | { | 2467 | { |
| 2468 | double d = XFLOAT_DATA (c); | 2468 | double d = XFLOAT_DATA (c); |
| 2469 | if (0 <= d | 2469 | if (d >= 0 |
| 2470 | && d < (max == UINTMAX_MAX ? (double) UINTMAX_MAX + 1 : max + 1)) | 2470 | && d < (max == UINTMAX_MAX ? (double) UINTMAX_MAX + 1 : max + 1)) |
| 2471 | { | 2471 | { |
| 2472 | val = d; | 2472 | val = d; |
diff --git a/src/dispnew.c b/src/dispnew.c index 2d137b4abbd..045ad2ed70b 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5829,7 +5829,7 @@ sit_for (Lisp_Object timeout, bool reading, int display_option) | |||
| 5829 | else if (FLOATP (timeout)) | 5829 | else if (FLOATP (timeout)) |
| 5830 | { | 5830 | { |
| 5831 | double seconds = XFLOAT_DATA (timeout); | 5831 | double seconds = XFLOAT_DATA (timeout); |
| 5832 | if (! (0 < seconds)) | 5832 | if (! (seconds > 0)) |
| 5833 | return Qt; | 5833 | return Qt; |
| 5834 | else | 5834 | else |
| 5835 | { | 5835 | { |
diff --git a/src/fileio.c b/src/fileio.c index f0bd75b170e..9829e4d9813 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3367,8 +3367,8 @@ file_offset (Lisp_Object val) | |||
| 3367 | if (FLOATP (val)) | 3367 | if (FLOATP (val)) |
| 3368 | { | 3368 | { |
| 3369 | double v = XFLOAT_DATA (val); | 3369 | double v = XFLOAT_DATA (val); |
| 3370 | if (0 <= v | 3370 | if (v >= 0 |
| 3371 | && (sizeof (off_t) < sizeof v | 3371 | && (sizeof v > sizeof (off_t) |
| 3372 | ? v <= TYPE_MAXIMUM (off_t) | 3372 | ? v <= TYPE_MAXIMUM (off_t) |
| 3373 | : v < TYPE_MAXIMUM (off_t))) | 3373 | : v < TYPE_MAXIMUM (off_t))) |
| 3374 | return v; | 3374 | return v; |
diff --git a/src/filelock.c b/src/filelock.c index f857c488143..bbc616206d7 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -504,7 +504,7 @@ read_lock_data (char *lfname, char lfinfo[MAX_LFINFO + 1]) | |||
| 504 | && errno == EINVAL) | 504 | && errno == EINVAL) |
| 505 | { | 505 | { |
| 506 | int fd = emacs_open (lfname, O_RDONLY | O_BINARY | O_NOFOLLOW, 0); | 506 | int fd = emacs_open (lfname, O_RDONLY | O_BINARY | O_NOFOLLOW, 0); |
| 507 | if (0 <= fd) | 507 | if (fd >= 0) |
| 508 | { | 508 | { |
| 509 | /* Use read, not emacs_read, since FD isn't unwind-protected. */ | 509 | /* Use read, not emacs_read, since FD isn't unwind-protected. */ |
| 510 | ptrdiff_t read_bytes = read (fd, lfinfo, MAX_LFINFO + 1); | 510 | ptrdiff_t read_bytes = read (fd, lfinfo, MAX_LFINFO + 1); |
| @@ -713,7 +713,7 @@ lock_file (Lisp_Object fn) | |||
| 713 | } | 713 | } |
| 714 | 714 | ||
| 715 | /* Try to lock the lock. */ | 715 | /* Try to lock the lock. */ |
| 716 | if (0 < lock_if_free (&lock_info, lfname)) | 716 | if (lock_if_free (&lock_info, lfname) > 0) |
| 717 | { | 717 | { |
| 718 | /* Someone else has the lock. Consider breaking it. */ | 718 | /* Someone else has the lock. Consider breaking it. */ |
| 719 | Lisp_Object attack; | 719 | Lisp_Object attack; |
| @@ -3496,7 +3496,7 @@ larger_vector (Lisp_Object vec, ptrdiff_t incr_min, ptrdiff_t nitems_max) | |||
| 3496 | ptrdiff_t n_max = (0 <= nitems_max && nitems_max < C_language_max | 3496 | ptrdiff_t n_max = (0 <= nitems_max && nitems_max < C_language_max |
| 3497 | ? nitems_max : C_language_max); | 3497 | ? nitems_max : C_language_max); |
| 3498 | eassert (VECTORP (vec)); | 3498 | eassert (VECTORP (vec)); |
| 3499 | eassert (0 < incr_min && -1 <= nitems_max); | 3499 | eassert (incr_min > 0 && nitems_max >= -1); |
| 3500 | old_size = ASIZE (vec); | 3500 | old_size = ASIZE (vec); |
| 3501 | incr_max = n_max - old_size; | 3501 | incr_max = n_max - old_size; |
| 3502 | incr = max (incr_min, min (old_size >> 1, incr_max)); | 3502 | incr = max (incr_min, min (old_size >> 1, incr_max)); |
| @@ -3659,9 +3659,9 @@ make_hash_table (struct hash_table_test test, | |||
| 3659 | eassert (SYMBOLP (test.name)); | 3659 | eassert (SYMBOLP (test.name)); |
| 3660 | eassert (INTEGERP (size) && XINT (size) >= 0); | 3660 | eassert (INTEGERP (size) && XINT (size) >= 0); |
| 3661 | eassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0) | 3661 | eassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0) |
| 3662 | || (FLOATP (rehash_size) && 1 < XFLOAT_DATA (rehash_size))); | 3662 | || (FLOATP (rehash_size) && XFLOAT_DATA (rehash_size) > 1)); |
| 3663 | eassert (FLOATP (rehash_threshold) | 3663 | eassert (FLOATP (rehash_threshold) |
| 3664 | && 0 < XFLOAT_DATA (rehash_threshold) | 3664 | && XFLOAT_DATA (rehash_threshold) > 0 |
| 3665 | && XFLOAT_DATA (rehash_threshold) <= 1.0); | 3665 | && XFLOAT_DATA (rehash_threshold) <= 1.0); |
| 3666 | 3666 | ||
| 3667 | if (XFASTINT (size) == 0) | 3667 | if (XFASTINT (size) == 0) |
| @@ -4399,15 +4399,15 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) | |||
| 4399 | /* Look for `:rehash-size SIZE'. */ | 4399 | /* Look for `:rehash-size SIZE'. */ |
| 4400 | i = get_key_arg (QCrehash_size, nargs, args, used); | 4400 | i = get_key_arg (QCrehash_size, nargs, args, used); |
| 4401 | rehash_size = i ? args[i] : make_float (DEFAULT_REHASH_SIZE); | 4401 | rehash_size = i ? args[i] : make_float (DEFAULT_REHASH_SIZE); |
| 4402 | if (! ((INTEGERP (rehash_size) && 0 < XINT (rehash_size)) | 4402 | if (! ((INTEGERP (rehash_size) && XINT (rehash_size) > 0) |
| 4403 | || (FLOATP (rehash_size) && 1 < XFLOAT_DATA (rehash_size)))) | 4403 | || (FLOATP (rehash_size) && XFLOAT_DATA (rehash_size) > 1))) |
| 4404 | signal_error ("Invalid hash table rehash size", rehash_size); | 4404 | signal_error ("Invalid hash table rehash size", rehash_size); |
| 4405 | 4405 | ||
| 4406 | /* Look for `:rehash-threshold THRESHOLD'. */ | 4406 | /* Look for `:rehash-threshold THRESHOLD'. */ |
| 4407 | i = get_key_arg (QCrehash_threshold, nargs, args, used); | 4407 | i = get_key_arg (QCrehash_threshold, nargs, args, used); |
| 4408 | rehash_threshold = i ? args[i] : make_float (DEFAULT_REHASH_THRESHOLD); | 4408 | rehash_threshold = i ? args[i] : make_float (DEFAULT_REHASH_THRESHOLD); |
| 4409 | if (! (FLOATP (rehash_threshold) | 4409 | if (! (FLOATP (rehash_threshold) |
| 4410 | && 0 < XFLOAT_DATA (rehash_threshold) | 4410 | && XFLOAT_DATA (rehash_threshold) > 0 |
| 4411 | && XFLOAT_DATA (rehash_threshold) <= 1)) | 4411 | && XFLOAT_DATA (rehash_threshold) <= 1)) |
| 4412 | signal_error ("Invalid hash table rehash threshold", rehash_threshold); | 4412 | signal_error ("Invalid hash table rehash threshold", rehash_threshold); |
| 4413 | 4413 | ||
diff --git a/src/font.c b/src/font.c index 054a68bfd94..ee6d230e171 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -280,7 +280,7 @@ font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol) | |||
| 280 | 280 | ||
| 281 | if (len == 1 && *str == '*') | 281 | if (len == 1 && *str == '*') |
| 282 | return Qnil; | 282 | return Qnil; |
| 283 | if (!force_symbol && 0 < len && '0' <= *str && *str <= '9') | 283 | if (!force_symbol && len > 0 && '0' <= *str && *str <= '9') |
| 284 | { | 284 | { |
| 285 | for (i = 1; i < len; i++) | 285 | for (i = 1; i < len; i++) |
| 286 | if (! ('0' <= str[i] && str[i] <= '9')) | 286 | if (! ('0' <= str[i] && str[i] <= '9')) |
| @@ -445,10 +445,10 @@ font_style_symbolic (Lisp_Object font, enum font_property_index prop, | |||
| 445 | table = AREF (font_style_table, prop - FONT_WEIGHT_INDEX); | 445 | table = AREF (font_style_table, prop - FONT_WEIGHT_INDEX); |
| 446 | CHECK_VECTOR (table); | 446 | CHECK_VECTOR (table); |
| 447 | i = XINT (val) & 0xFF; | 447 | i = XINT (val) & 0xFF; |
| 448 | eassert (((i >> 4) & 0xF) < ASIZE (table)); | 448 | eassert (ASIZE (table) > ((i >> 4) & 0xF)); |
| 449 | elt = AREF (table, ((i >> 4) & 0xF)); | 449 | elt = AREF (table, ((i >> 4) & 0xF)); |
| 450 | CHECK_VECTOR (elt); | 450 | CHECK_VECTOR (elt); |
| 451 | eassert ((i & 0xF) + 1 < ASIZE (elt)); | 451 | eassert (ASIZE (elt) > (i & 0xF) + 1); |
| 452 | elt = (for_face ? AREF (elt, 1) : AREF (elt, (i & 0xF) + 1)); | 452 | elt = (for_face ? AREF (elt, 1) : AREF (elt, (i & 0xF) + 1)); |
| 453 | CHECK_SYMBOL (elt); | 453 | CHECK_SYMBOL (elt); |
| 454 | return elt; | 454 | return elt; |
diff --git a/src/lisp.h b/src/lisp.h index bf25f073d4b..623becc4b33 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -782,7 +782,7 @@ LISP_MACRO_DEFUN (EQ, bool, (Lisp_Object x, Lisp_Object y), (x, y)) | |||
| 782 | type or if I is a NaN. */ | 782 | type or if I is a NaN. */ |
| 783 | 783 | ||
| 784 | #define FIXNUM_OVERFLOW_P(i) \ | 784 | #define FIXNUM_OVERFLOW_P(i) \ |
| 785 | (! ((0 <= (i) || MOST_NEGATIVE_FIXNUM <= (i)) && (i) <= MOST_POSITIVE_FIXNUM)) | 785 | (! (((i) >= 0 || (i) >= MOST_NEGATIVE_FIXNUM) && (i) <= MOST_POSITIVE_FIXNUM)) |
| 786 | 786 | ||
| 787 | INLINE ptrdiff_t | 787 | INLINE ptrdiff_t |
| 788 | clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper) | 788 | clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper) |
diff --git a/src/lread.c b/src/lread.c index 639d574ac6b..25c3503d86b 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2747,7 +2747,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 2747 | while ((c = READCHAR) >= 0 | 2747 | while ((c = READCHAR) >= 0 |
| 2748 | && c >= '0' && c <= '9') | 2748 | && c >= '0' && c <= '9') |
| 2749 | { | 2749 | { |
| 2750 | if ((STRING_BYTES_BOUND - extra) / 10 <= nskip) | 2750 | if (nskip >= (STRING_BYTES_BOUND - extra) / 10) |
| 2751 | string_overflow (); | 2751 | string_overflow (); |
| 2752 | digits++; | 2752 | digits++; |
| 2753 | nskip *= 10; | 2753 | nskip *= 10; |
| @@ -2861,8 +2861,8 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 2861 | /* Read a non-negative integer. */ | 2861 | /* Read a non-negative integer. */ |
| 2862 | while (c >= '0' && c <= '9') | 2862 | while (c >= '0' && c <= '9') |
| 2863 | { | 2863 | { |
| 2864 | if (MOST_POSITIVE_FIXNUM / 10 < n | 2864 | if (n > MOST_POSITIVE_FIXNUM / 10 |
| 2865 | || MOST_POSITIVE_FIXNUM < n * 10 + c - '0') | 2865 | || n * 10 + c - '0' > MOST_POSITIVE_FIXNUM) |
| 2866 | n = MOST_POSITIVE_FIXNUM + 1; | 2866 | n = MOST_POSITIVE_FIXNUM + 1; |
| 2867 | else | 2867 | else |
| 2868 | n = n * 10 + c - '0'; | 2868 | n = n * 10 + c - '0'; |
| @@ -3058,7 +3058,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 3058 | if (end - p < MAX_MULTIBYTE_LENGTH) | 3058 | if (end - p < MAX_MULTIBYTE_LENGTH) |
| 3059 | { | 3059 | { |
| 3060 | ptrdiff_t offset = p - read_buffer; | 3060 | ptrdiff_t offset = p - read_buffer; |
| 3061 | if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size) | 3061 | if (read_buffer_size > min (PTRDIFF_MAX, SIZE_MAX) / 2) |
| 3062 | memory_full (SIZE_MAX); | 3062 | memory_full (SIZE_MAX); |
| 3063 | read_buffer = xrealloc (read_buffer, read_buffer_size * 2); | 3063 | read_buffer = xrealloc (read_buffer, read_buffer_size * 2); |
| 3064 | read_buffer_size *= 2; | 3064 | read_buffer_size *= 2; |
| @@ -3192,7 +3192,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 3192 | if (end - p < MAX_MULTIBYTE_LENGTH) | 3192 | if (end - p < MAX_MULTIBYTE_LENGTH) |
| 3193 | { | 3193 | { |
| 3194 | ptrdiff_t offset = p - read_buffer; | 3194 | ptrdiff_t offset = p - read_buffer; |
| 3195 | if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size) | 3195 | if (read_buffer_size > min (PTRDIFF_MAX, SIZE_MAX) / 2) |
| 3196 | memory_full (SIZE_MAX); | 3196 | memory_full (SIZE_MAX); |
| 3197 | read_buffer = xrealloc (read_buffer, read_buffer_size * 2); | 3197 | read_buffer = xrealloc (read_buffer, read_buffer_size * 2); |
| 3198 | read_buffer_size *= 2; | 3198 | read_buffer_size *= 2; |
| @@ -3222,7 +3222,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 3222 | if (p == end) | 3222 | if (p == end) |
| 3223 | { | 3223 | { |
| 3224 | ptrdiff_t offset = p - read_buffer; | 3224 | ptrdiff_t offset = p - read_buffer; |
| 3225 | if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size) | 3225 | if (read_buffer_size > min (PTRDIFF_MAX, SIZE_MAX) / 2) |
| 3226 | memory_full (SIZE_MAX); | 3226 | memory_full (SIZE_MAX); |
| 3227 | read_buffer = xrealloc (read_buffer, read_buffer_size * 2); | 3227 | read_buffer = xrealloc (read_buffer, read_buffer_size * 2); |
| 3228 | read_buffer_size *= 2; | 3228 | read_buffer_size *= 2; |
diff --git a/src/minibuf.c b/src/minibuf.c index b85d3f57df3..e4f81906873 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -265,7 +265,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial, | |||
| 265 | fprintf (stdout, "%c", hide_char); | 265 | fprintf (stdout, "%c", hide_char); |
| 266 | if (len == size) | 266 | if (len == size) |
| 267 | { | 267 | { |
| 268 | if (STRING_BYTES_BOUND / 2 < size) | 268 | if (size > STRING_BYTES_BOUND / 2) |
| 269 | memory_full (SIZE_MAX); | 269 | memory_full (SIZE_MAX); |
| 270 | size *= 2; | 270 | size *= 2; |
| 271 | line = xrealloc (line, size); | 271 | line = xrealloc (line, size); |
diff --git a/src/nsterm.m b/src/nsterm.m index 3b1c945c6bf..762c4e79ea8 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -1795,9 +1795,9 @@ x_set_frame_alpha (struct frame *f) | |||
| 1795 | 1795 | ||
| 1796 | if (alpha < 0.0) | 1796 | if (alpha < 0.0) |
| 1797 | return; | 1797 | return; |
| 1798 | else if (1.0 < alpha) | 1798 | else if (alpha > 1.0) |
| 1799 | alpha = 1.0; | 1799 | alpha = 1.0; |
| 1800 | else if (0.0 <= alpha && alpha < alpha_min && alpha_min <= 1.0) | 1800 | else if (alpha >= 0.0 && alpha < alpha_min && alpha_min <= 1.0) |
| 1801 | alpha = alpha_min; | 1801 | alpha = alpha_min; |
| 1802 | 1802 | ||
| 1803 | #ifdef NS_IMPL_COCOA | 1803 | #ifdef NS_IMPL_COCOA |
diff --git a/src/process.c b/src/process.c index 4449493a2b6..ab30698b9e8 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4303,7 +4303,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4303 | time_limit = 0; | 4303 | time_limit = 0; |
| 4304 | nsecs = -1; | 4304 | nsecs = -1; |
| 4305 | } | 4305 | } |
| 4306 | else if (TYPE_MAXIMUM (time_t) < time_limit) | 4306 | else if (time_limit > TYPE_MAXIMUM (time_t)) |
| 4307 | time_limit = TYPE_MAXIMUM (time_t); | 4307 | time_limit = TYPE_MAXIMUM (time_t); |
| 4308 | 4308 | ||
| 4309 | /* Since we may need to wait several times, | 4309 | /* Since we may need to wait several times, |
| @@ -4580,7 +4580,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4580 | continue; | 4580 | continue; |
| 4581 | FD_CLR (channel, &Available); | 4581 | FD_CLR (channel, &Available); |
| 4582 | XPROCESS (proc)->read_output_skip = 0; | 4582 | XPROCESS (proc)->read_output_skip = 0; |
| 4583 | if (XPROCESS (proc)->read_output_delay < nsecs) | 4583 | if (nsecs > XPROCESS (proc)->read_output_delay) |
| 4584 | nsecs = XPROCESS (proc)->read_output_delay; | 4584 | nsecs = XPROCESS (proc)->read_output_delay; |
| 4585 | } | 4585 | } |
| 4586 | } | 4586 | } |
| @@ -4696,7 +4696,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4696 | if (timers_run != old_timers_run | 4696 | if (timers_run != old_timers_run |
| 4697 | && waiting_for_user_input_p == -1 | 4697 | && waiting_for_user_input_p == -1 |
| 4698 | && (old_buffer != current_buffer | 4698 | && (old_buffer != current_buffer |
| 4699 | || !EQ (old_window, selected_window))) | 4699 | || !EQ (old_window, selected_window))) |
| 4700 | record_asynch_buffer_change (); | 4700 | record_asynch_buffer_change (); |
| 4701 | 4701 | ||
| 4702 | if (leave) | 4702 | if (leave) |
diff --git a/src/region-cache.c b/src/region-cache.c index 1123a0fb755..2bd091fe4e1 100644 --- a/src/region-cache.c +++ b/src/region-cache.c | |||
| @@ -315,7 +315,7 @@ delete_cache_boundaries (struct region_cache *c, | |||
| 315 | ptrdiff_t len = end - start; | 315 | ptrdiff_t len = end - start; |
| 316 | 316 | ||
| 317 | /* Gotta be in range. */ | 317 | /* Gotta be in range. */ |
| 318 | eassert (0 <= start && end <= c->cache_len); | 318 | eassert (start >= 0 && end <= c->cache_len); |
| 319 | 319 | ||
| 320 | /* Gotta be in order. */ | 320 | /* Gotta be in order. */ |
| 321 | eassert (start <= end); | 321 | eassert (start <= end); |
diff --git a/src/xterm.c b/src/xterm.c index 85835a2c7c5..df2a9f331ef 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -394,7 +394,7 @@ x_set_frame_alpha (struct frame *f) | |||
| 394 | return; | 394 | return; |
| 395 | else if (alpha > 1.0) | 395 | else if (alpha > 1.0) |
| 396 | alpha = 1.0; | 396 | alpha = 1.0; |
| 397 | else if (0.0 <= alpha && alpha < alpha_min && alpha_min <= 1.0) | 397 | else if (alpha >= 0.0 && alpha < alpha_min && alpha_min <= 1.0) |
| 398 | alpha = alpha_min; | 398 | alpha = alpha_min; |
| 399 | 399 | ||
| 400 | opac = alpha * OPAQUE; | 400 | opac = alpha * OPAQUE; |