aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2013-04-01 18:54:56 -0700
committerPaul Eggert2013-04-01 18:54:56 -0700
commit7216e43b329303146455bb1dace88f8c61b1cd20 (patch)
tree900c267701eccb66398b6514816e153fb50b6a26 /src/alloc.c
parent4b725a70efa7ed781b6d5e466c8acc246f68f49d (diff)
downloademacs-7216e43b329303146455bb1dace88f8c61b1cd20.tar.gz
emacs-7216e43b329303146455bb1dace88f8c61b1cd20.zip
Prefer < to > in range checks such as 0 <= i && i < N.
This makes it easier to visualize quantities on a number line. This patch doesn't apply to all such range checks, only to the range checks affected by the 2013-03-24 change. This patch reverts most of the 2013-03-24 change. * alloc.c (xpalloc, Fgarbage_collect): * ccl.c (ccl_driver, resolve_symbol_ccl_program): * character.c (string_escape_byte8): * charset.c (read_hex): * data.c (cons_to_unsigned): * dispnew.c (update_frame_1): * doc.c (Fsubstitute_command_keys): * doprnt.c (doprnt): * editfns.c (hi_time, decode_time_components): * fileio.c (file_offset): * fns.c (larger_vector, make_hash_table, Fmake_hash_table): * font.c (font_intern_prop): * frame.c (x_set_alpha): * gtkutil.c (get_utf8_string): * indent.c (check_display_width): * keymap.c (Fkey_description): * lisp.h (FIXNUM_OVERFLOW_P, vcopy): * lread.c (read1): * minibuf.c (read_minibuf_noninteractive): * process.c (wait_reading_process_output): * search.c (Freplace_match): * window.c (get_phys_cursor_glyph): * xdisp.c (redisplay_internal): * xsmfns.c (smc_save_yourself_CB): Prefer < to > for range checks. * dispnew.c (sit_for): Don't mishandle NaNs. This fixes a bug introduced in the 2013-03-24 change. * editfns.c (decode_time_components): Don't hoist comparison. This fixes another bug introduced in the 2013-03-24 change.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 0a7950273f6..7a56c78e2ba 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -779,7 +779,7 @@ xpalloc (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min,
779 ptrdiff_t nitems_incr_max = n_max - n; 779 ptrdiff_t nitems_incr_max = n_max - n;
780 ptrdiff_t incr = max (nitems_incr_min, min (incr_estimate, nitems_incr_max)); 780 ptrdiff_t incr = max (nitems_incr_min, min (incr_estimate, nitems_incr_max));
781 781
782 eassert (item_size > 0 && nitems_incr_min > 0 && n >= 0 && nitems_max >= -1); 782 eassert (0 < item_size && 0 < nitems_incr_min && 0 <= n && -1 <= nitems_max);
783 if (! pa) 783 if (! pa)
784 *nitems = 0; 784 *nitems = 0;
785 if (nitems_incr_max < incr) 785 if (nitems_incr_max < incr)
@@ -5376,7 +5376,7 @@ See Info node `(elisp)Garbage Collection'. */)
5376 double tot = total_bytes_of_live_objects (); 5376 double tot = total_bytes_of_live_objects ();
5377 5377
5378 tot *= XFLOAT_DATA (Vgc_cons_percentage); 5378 tot *= XFLOAT_DATA (Vgc_cons_percentage);
5379 if (tot > 0) 5379 if (0 < tot)
5380 { 5380 {
5381 if (tot < TYPE_MAXIMUM (EMACS_INT)) 5381 if (tot < TYPE_MAXIMUM (EMACS_INT))
5382 gc_relative_threshold = tot; 5382 gc_relative_threshold = tot;