Now on revision 112128. ------------------------------------------------------------ revno: 112128 fixes bug: http://debbugs.gnu.org/14017 committer: Juri Linkov branch nick: trunk timestamp: Sun 2013-03-24 23:47:52 +0200 message: * lisp/replace.el (list-matching-lines-prefix-face): New defcustom. (occur-1): Pass `list-matching-lines-prefix-face' to the function `occur-engine' if `face-differs-from-default-p' returns t. (occur-engine): Add `,' inside backquote construct to evaluate `prefix-face'. Propertize the prefix with the `prefix-face' face. Pass `prefix-face' to the functions `occur-context-lines' and `occur-engine-add-prefix'. (occur-engine-add-prefix, occur-context-lines): Add optional arg `prefix-face' and propertize the prefix with `prefix-face'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-24 06:42:25 +0000 +++ lisp/ChangeLog 2013-03-24 21:47:52 +0000 @@ -1,3 +1,16 @@ +2013-03-24 Juri Linkov + + * replace.el (list-matching-lines-prefix-face): New defcustom. + (occur-1): Pass `list-matching-lines-prefix-face' to the function + `occur-engine' if `face-differs-from-default-p' returns t. + (occur-engine): Add `,' inside backquote construct to evaluate + `prefix-face'. Propertize the prefix with the `prefix-face' face. + Pass `prefix-face' to the functions `occur-context-lines' and + `occur-engine-add-prefix'. + (occur-engine-add-prefix, occur-context-lines): Add optional arg + `prefix-face' and propertize the prefix with `prefix-face'. + (Bug#14017) + 2013-03-24 Leo Liu * nxml/rng-valid.el (rng-validate-while-idle) === modified file 'lisp/replace.el' --- lisp/replace.el 2013-03-10 08:44:07 +0000 +++ lisp/replace.el 2013-03-24 21:47:52 +0000 @@ -1125,6 +1125,14 @@ :type 'face :group 'matching) +(defcustom list-matching-lines-prefix-face 'shadow + "Face used by \\[list-matching-lines] to show the prefix column. +If the face doesn't differ from the default face, +don't highlight the prefix with line numbers specially." + :type 'face + :group 'matching + :version "24.4") + (defcustom occur-excluded-properties '(read-only invisible intangible field mouse-face help-echo local-map keymap yank-handler follow-link) @@ -1334,7 +1342,9 @@ (isearch-no-upper-case-p regexp t) case-fold-search) list-matching-lines-buffer-name-face - nil list-matching-lines-face + (if (face-differs-from-default-p list-matching-lines-prefix-face) + list-matching-lines-prefix-face) + list-matching-lines-face (not (eq occur-excluded-properties t)))))) (let* ((bufcount (length active-bufs)) (diff (- (length bufs) bufcount))) @@ -1423,7 +1433,7 @@ (apply #'propertize (format "%7d:" lines) (append (when prefix-face - `(font-lock-face prefix-face)) + `(font-lock-face ,prefix-face)) `(occur-prefix t mouse-face (highlight) ;; Allow insertion of text at ;; the end of the prefix (for @@ -1447,7 +1457,9 @@ ;; of multi-line matches. (replace-regexp-in-string "\n" - "\n :" + (if prefix-face + (propertize "\n :" 'font-lock-face prefix-face) + "\n :") match-str) ;; Add marker at eol, but no mouse props. (propertize "\n" 'occur-target marker))) @@ -1458,7 +1470,8 @@ ;; The complex multi-line display style. (setq ret (occur-context-lines out-line nlines keep-props begpt endpt - lines prev-lines prev-after-lines)) + lines prev-lines prev-after-lines + prefix-face)) ;; Set first elem of the returned list to `data', ;; and the second elem to `prev-after-lines'. (setq prev-after-lines (nth 1 ret)) @@ -1482,7 +1495,7 @@ (when prev-after-lines (with-current-buffer out-buf (insert (apply #'concat (occur-engine-add-prefix - prev-after-lines))))))) + prev-after-lines prefix-face))))))) (when (not (zerop matches)) ;; is the count zero? (setq globalcount (+ globalcount matches)) (with-current-buffer out-buf @@ -1537,10 +1550,13 @@ str) (buffer-substring-no-properties beg end))) -(defun occur-engine-add-prefix (lines) +(defun occur-engine-add-prefix (lines &optional prefix-face) (mapcar #'(lambda (line) - (concat " :" line "\n")) + (concat (if prefix-face + (propertize " :" 'font-lock-face prefix-face) + " :") + line "\n")) lines)) (defun occur-accumulate-lines (count &optional keep-props pt) @@ -1569,7 +1585,8 @@ ;; Generate a list of lines, add prefixes to all but OUT-LINE, ;; then concatenate them all together. (defun occur-context-lines (out-line nlines keep-props begpt endpt - lines prev-lines prev-after-lines) + lines prev-lines prev-after-lines + &optional prefix-face) ;; Find after- and before-context lines of the current match. (let ((before-lines (nreverse (cdr (occur-accumulate-lines @@ -1609,10 +1626,13 @@ ;; Return a list where the first element is the output line. (apply #'concat (append - (and prev-after-lines - (occur-engine-add-prefix prev-after-lines)) - (and separator (list separator)) - (occur-engine-add-prefix before-lines) + (if prev-after-lines + (occur-engine-add-prefix prev-after-lines prefix-face)) + (if separator + (list (if prefix-face + (propertize separator 'font-lock-face prefix-face) + separator))) + (occur-engine-add-prefix before-lines prefix-face) (list out-line))) ;; And the second element is the list of context after-lines. (if (> nlines 0) after-lines)))) ------------------------------------------------------------ revno: 112127 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2013-03-24 19:55:06 +0200 message: Minor improvements in ELisp manual. doc/lispref/compile.texi (Byte-Code Objects): Add index entry. (Disassembly): Add cross-references. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-03-23 09:33:00 +0000 +++ doc/lispref/ChangeLog 2013-03-24 17:55:06 +0000 @@ -1,3 +1,8 @@ +2013-03-24 Eli Zaretskii + + * compile.texi (Byte-Code Objects): Add index entry. + (Disassembly): Add cross-references. + 2013-03-23 Eli Zaretskii * frames.texi (Size Parameters): More accurate description of the === modified file 'doc/lispref/compile.texi' --- doc/lispref/compile.texi 2013-01-01 09:11:05 +0000 +++ doc/lispref/compile.texi 2013-03-24 17:55:06 +0000 @@ -514,6 +514,7 @@ @section Byte-Code Function Objects @cindex compiled function @cindex byte-code function +@cindex byte-code object Byte-compiled functions have a special data type: they are @dfn{byte-code function objects}. Whenever such an object appears as @@ -606,8 +607,9 @@ point is left before the output. The argument @var{object} can be a function name, a lambda expression -or a byte-code object. If it is a lambda expression, @code{disassemble} -compiles it and disassembles the resulting compiled code. +(@pxref{Lambda Expressions}), or a byte-code object (@pxref{Byte-Code +Objects}). If it is a lambda expression, @code{disassemble} compiles +it and disassembles the resulting compiled code. @end deffn Here are two examples of using the @code{disassemble} function. We ------------------------------------------------------------ revno: 112126 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2013-03-24 13:59:45 +0100 message: Reorder conditions that are written backwards * 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. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-24 05:29:35 +0000 +++ src/ChangeLog 2013-03-24 12:59:45 +0000 @@ -1,3 +1,69 @@ +2013-03-24 Andreas Schwab + + * 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 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument @@ -5273,8 +5339,8 @@ a public macro and no need to inline by hand. 2012-09-26 Tomohiro Matsuyama - Stefan Monnier - Juanma Barranquero + Stefan Monnier + Juanma Barranquero * profiler.c: New file. * Makefile.in (base_obj): Add profiler.o. === modified file 'src/alloc.c' --- src/alloc.c 2013-03-21 20:56:22 +0000 +++ src/alloc.c 2013-03-24 12:59:45 +0000 @@ -779,7 +779,7 @@ 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) @@ -5376,7 +5376,7 @@ 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; === modified file 'src/blockinput.h' --- src/blockinput.h 2013-01-01 09:11:05 +0000 +++ src/blockinput.h 2013-03-24 12:59:45 +0000 @@ -67,7 +67,7 @@ BLOCKINPUT_INLINE bool input_blocked_p (void) { - return 0 < interrupt_input_blocked; + return interrupt_input_blocked > 0; } INLINE_HEADER_END === modified file 'src/bytecode.c' --- src/bytecode.c 2013-03-13 07:27:34 +0000 +++ src/bytecode.c 2013-03-24 12:59:45 +0000 @@ -660,7 +660,7 @@ 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 @@ -676,7 +676,7 @@ #undef DEFINE }; -#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) # pragma GCC diagnostic pop #endif === modified file 'src/callproc.c' --- src/callproc.c 2013-02-13 02:10:36 +0000 +++ src/callproc.c 2013-03-24 12:59:45 +0000 @@ -1,5 +1,5 @@ /* 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. @@ -125,7 +125,7 @@ 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) @@ -173,7 +173,7 @@ } #endif - if (0 <= synch_process_fd) + if (synch_process_fd >= 0) emacs_close (synch_process_fd); #ifdef MSDOS @@ -682,7 +682,7 @@ child_errno = errno; - if (0 < pid) + if (pid > 0) { if (INTEGERP (buffer)) record_deleted_pid (pid); === modified file 'src/ccl.c' --- src/ccl.c 2013-02-08 05:28:52 +0000 +++ src/ccl.c 2013-03-24 12:59:45 +0000 @@ -1668,7 +1668,7 @@ } 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))) @@ -1867,7 +1867,7 @@ 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; @@ -2130,7 +2130,7 @@ 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; === modified file 'src/character.c' --- src/character.c 2013-01-01 09:11:05 +0000 +++ src/character.c 2013-03-24 12:59:45 +0000 @@ -833,8 +833,8 @@ 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. */ @@ -843,7 +843,7 @@ } 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. */ === modified file 'src/charset.c' --- src/charset.c 2013-02-08 05:28:52 +0000 +++ src/charset.c 2013-03-24 12:59:45 +0000 @@ -447,7 +447,7 @@ 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' === modified file 'src/cm.c' --- src/cm.c 2013-02-11 00:35:37 +0000 +++ src/cm.c 2013-03-24 12:59:45 +0000 @@ -214,7 +214,7 @@ if (doit) do emacs_tputs (tty, p, 1, cmputc); - while (0 < --deltay); + while (--deltay > 0); x: if ((deltax = dstx - srcx) == 0) goto done; @@ -297,7 +297,7 @@ if (doit) do emacs_tputs (tty, p, 1, cmputc); - while (0 < --deltax); + while (--deltax > 0); done: return totalcost; } === modified file 'src/data.c' --- src/data.c 2013-01-10 10:30:16 +0000 +++ src/data.c 2013-03-24 12:59:45 +0000 @@ -2337,13 +2337,13 @@ 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; === modified file 'src/dired.c' --- src/dired.c 2013-02-02 17:14:24 +0000 +++ src/dired.c 2013-03-24 12:59:45 +0000 @@ -258,7 +258,7 @@ 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; @@ -517,8 +517,8 @@ 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) @@ -580,7 +580,7 @@ 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; } @@ -602,9 +602,8 @@ 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; } === modified file 'src/dispnew.c' --- src/dispnew.c 2013-03-22 12:41:34 +0000 +++ src/dispnew.c 2013-03-24 12:59:45 +0000 @@ -4459,7 +4459,7 @@ row_table[row_entry_pool[i].bucket] = NULL; /* Value is 1 to indicate that we scrolled the display. */ - return 0 < nruns; + return nruns > 0; } @@ -4545,7 +4545,7 @@ } } - 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. */ @@ -5764,7 +5764,7 @@ 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), @@ -5804,14 +5804,14 @@ 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 { === modified file 'src/doc.c' --- src/doc.c 2013-02-11 23:37:18 +0000 +++ src/doc.c 2013-03-24 12:59:45 +0000 @@ -826,7 +826,7 @@ 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; === modified file 'src/doprnt.c' --- src/doprnt.c 2013-01-20 17:45:53 +0000 +++ src/doprnt.c 2013-03-24 12:59:45 +0000 @@ -361,7 +361,7 @@ /* 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"); === modified file 'src/editfns.c' --- src/editfns.c 2013-03-21 20:56:22 +0000 +++ src/editfns.c 2013-03-24 12:59:45 +0000 @@ -1398,8 +1398,8 @@ 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 (); @@ -1561,7 +1561,7 @@ 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 @@ -3958,7 +3958,7 @@ trailing "d"). */ pMlen = sizeof pMd - 2 }; - verify (0 < USEFUL_PRECISION_MAX); + verify (USEFUL_PRECISION_MAX > 0); int prec; ptrdiff_t padding, sprintf_bytes; === modified file 'src/emacsgtkfixed.c' --- src/emacsgtkfixed.c 2013-01-01 09:11:05 +0000 +++ src/emacsgtkfixed.c 2013-03-24 12:59:45 +0000 @@ -28,7 +28,7 @@ #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 === modified file 'src/fileio.c' --- src/fileio.c 2013-03-21 20:56:22 +0000 +++ src/fileio.c 2013-03-24 12:59:45 +0000 @@ -3449,7 +3449,7 @@ 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))) @@ -5013,7 +5013,7 @@ && ! (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 === modified file 'src/floatfns.c' --- src/floatfns.c 2013-01-02 16:13:04 +0000 +++ src/floatfns.c 2013-03-24 12:59:45 +0000 @@ -193,7 +193,7 @@ 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. */ @@ -475,7 +475,7 @@ 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); === modified file 'src/fns.c' --- src/fns.c 2013-03-07 03:01:17 +0000 +++ src/fns.c 2013-03-24 12:59:45 +0000 @@ -3409,7 +3409,7 @@ 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)); @@ -3574,9 +3574,9 @@ 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) @@ -4312,15 +4312,15 @@ /* 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); === modified file 'src/font.c' --- src/font.c 2013-03-20 09:56:19 +0000 +++ src/font.c 2013-03-24 12:59:45 +0000 @@ -229,7 +229,7 @@ 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')) @@ -243,7 +243,7 @@ { if (i == len) return make_number (n); - if (MOST_POSITIVE_FIXNUM / 10 < n) + if (n > MOST_POSITIVE_FIXNUM / 10) break; } === modified file 'src/frame.c' --- src/frame.c 2013-03-24 05:29:35 +0000 +++ src/frame.c 2013-03-24 12:59:45 +0000 @@ -3315,13 +3315,13 @@ 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; === modified file 'src/gtkutil.c' --- src/gtkutil.c 2013-02-14 19:01:12 +0000 +++ src/gtkutil.c 2013-03-24 12:59:45 +0000 @@ -543,7 +543,7 @@ 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; === modified file 'src/indent.c' --- src/indent.c 2013-03-08 09:34:35 +0000 +++ src/indent.c 2013-03-24 12:59:45 +0000 @@ -476,7 +476,7 @@ 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), === modified file 'src/intervals.c' --- src/intervals.c 2013-01-02 16:13:04 +0000 +++ src/intervals.c 2013-03-24 12:59:45 +0000 @@ -110,14 +110,14 @@ { 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; } @@ -371,11 +371,11 @@ /* 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; } @@ -418,11 +418,11 @@ /* 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; } @@ -556,7 +556,7 @@ { set_interval_right (interval, new); new->total_length = new_length; - eassert (0 <= TOTAL_LENGTH (new)); + eassert (TOTAL_LENGTH (new) >= 0); } else { @@ -565,7 +565,7 @@ 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); } @@ -601,7 +601,7 @@ { set_interval_left (interval, new); new->total_length = new_length; - eassert (0 <= TOTAL_LENGTH (new)); + eassert (TOTAL_LENGTH (new) >= 0); } else { @@ -610,7 +610,7 @@ 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); } @@ -960,7 +960,7 @@ 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); } @@ -1016,7 +1016,7 @@ 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); } } @@ -1218,7 +1218,7 @@ 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); @@ -1300,7 +1300,7 @@ relative_position, amount); tree->total_length -= subtract; - eassert (0 <= TOTAL_LENGTH (tree)); + eassert (TOTAL_LENGTH (tree) >= 0); return subtract; } /* Right branch. */ @@ -1315,7 +1315,7 @@ relative_position, amount); tree->total_length -= subtract; - eassert (0 <= TOTAL_LENGTH (tree)); + eassert (TOTAL_LENGTH (tree) >= 0); return subtract; } /* Here -- this node. */ @@ -1330,7 +1330,7 @@ amount = my_amount; tree->total_length -= amount; - eassert (0 <= TOTAL_LENGTH (tree)); + eassert (TOTAL_LENGTH (tree) >= 0); if (LENGTH (tree) == 0) delete_interval (tree); @@ -1372,7 +1372,7 @@ if (ONLY_INTERVAL_P (tree)) { tree->total_length -= length; - eassert (0 <= TOTAL_LENGTH (tree)); + eassert (TOTAL_LENGTH (tree) >= 0); return; } @@ -1435,19 +1435,19 @@ 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 @@ -1462,7 +1462,7 @@ 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 @@ -1491,19 +1491,19 @@ 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, @@ -1518,7 +1518,7 @@ 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 @@ -2272,7 +2272,7 @@ 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; @@ -2355,7 +2355,7 @@ 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) { === modified file 'src/keyboard.c' --- src/keyboard.c 2013-03-13 07:27:34 +0000 +++ src/keyboard.c 2013-03-24 12:59:45 +0000 @@ -6766,7 +6766,7 @@ 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. */ @@ -8240,9 +8240,8 @@ - (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. */ === modified file 'src/keymap.c' --- src/keymap.c 2013-03-21 20:56:22 +0000 +++ src/keymap.c 2013-03-24 12:59:45 +0000 @@ -2063,7 +2063,7 @@ 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); === modified file 'src/lisp.h' --- src/lisp.h 2013-03-23 09:01:14 +0000 +++ src/lisp.h 2013-03-24 12:59:45 +0000 @@ -543,7 +543,7 @@ 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) @@ -2565,7 +2565,7 @@ 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); } === modified file 'src/lread.c' --- src/lread.c 2013-03-10 21:52:01 +0000 +++ src/lread.c 2013-03-24 12:59:45 +0000 @@ -1571,7 +1571,7 @@ { 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); @@ -2359,7 +2359,7 @@ while (c == '0'); } - while (-1 <= (digit = digit_to_number (c, radix))) + while ((digit = digit_to_number (c, radix)) >= -1) { if (digit == -1) valid = 0; @@ -2731,8 +2731,8 @@ /* 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'; @@ -2930,7 +2930,7 @@ 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; @@ -3064,7 +3064,7 @@ 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; @@ -3094,7 +3094,7 @@ 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; @@ -3298,12 +3298,12 @@ 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 == '.') { @@ -3380,7 +3380,7 @@ /* 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; === modified file 'src/menu.c' --- src/menu.c 2013-01-01 09:11:05 +0000 +++ src/menu.c 2013-03-24 12:59:45 +0000 @@ -173,7 +173,7 @@ 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); === modified file 'src/minibuf.c' --- src/minibuf.c 2013-01-02 16:13:04 +0000 +++ src/minibuf.c 2013-03-24 12:59:45 +0000 @@ -251,7 +251,7 @@ { 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); === modified file 'src/print.c' --- src/print.c 2013-03-21 20:56:22 +0000 +++ src/print.c 2013-03-24 12:59:45 +0000 @@ -227,9 +227,9 @@ 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; @@ -273,7 +273,7 @@ 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; === modified file 'src/process.c' --- src/process.c 2013-03-24 02:40:51 +0000 +++ src/process.c 2013-03-24 12:59:45 +0000 @@ -136,7 +136,7 @@ /* Work around GCC 4.7.0 bug with strict overflow checking; see . 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 @@ -1804,7 +1804,7 @@ /* 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. */ @@ -3901,7 +3901,7 @@ { if (INTEGERP (seconds)) { - if (0 < XINT (seconds)) + if (XINT (seconds) > 0) { secs = XINT (seconds); nsecs = 0; @@ -3909,7 +3909,7 @@ } 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); @@ -4236,12 +4236,12 @@ 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); @@ -4273,7 +4273,7 @@ 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)) @@ -4325,7 +4325,7 @@ break; /* A negative timeout means do not wait at all. */ - if (0 <= nsecs) + if (nsecs >= 0) { if (EMACS_TIME_VALID_P (timer_delay)) { @@ -4407,7 +4407,7 @@ if (nread == 0) break; - if (0 < nread) + if (nread > 0) { total_nread += nread; got_some_input = 1; @@ -4948,7 +4948,7 @@ else #endif { - bool buffered = 0 <= proc_buffered_char[channel]; + bool buffered = proc_buffered_char[channel] >= 0; if (buffered) { chars[carryover] = proc_buffered_char[channel]; @@ -5455,7 +5455,7 @@ 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)); @@ -6578,7 +6578,7 @@ 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); @@ -6616,7 +6616,7 @@ 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)) @@ -6654,7 +6654,7 @@ && 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)) { === modified file 'src/profiler.c' --- src/profiler.c 2013-02-09 22:42:33 +0000 +++ src/profiler.c 2013-03-24 12:59:45 +0000 @@ -55,7 +55,7 @@ /* 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; @@ -247,7 +247,7 @@ if (profiler_timer_ok) { int overruns = timer_getoverrun (profiler_timer); - eassert (0 <= overruns); + eassert (overruns >= 0); count += overruns; } #endif === modified file 'src/regex.c' --- src/regex.c 2013-01-02 16:13:04 +0000 +++ src/regex.c 2013-03-24 12:59:45 +0000 @@ -33,7 +33,7 @@ /* 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" @@ -6404,8 +6404,8 @@ 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 */ === modified file 'src/regex.h' --- src/regex.h 2013-01-01 09:11:05 +0000 +++ src/regex.h 2013-03-24 12:59:45 +0000 @@ -530,7 +530,7 @@ /* 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 === modified file 'src/search.c' --- src/search.c 2013-03-08 21:37:41 +0000 +++ src/search.c 2013-03-24 12:59:45 +0000 @@ -326,7 +326,7 @@ 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) @@ -2450,7 +2450,7 @@ 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']; @@ -2533,7 +2533,7 @@ 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); === modified file 'src/sysdep.c' --- src/sysdep.c 2013-03-13 18:42:22 +0000 +++ src/sysdep.c 2013-03-24 12:59:45 +0000 @@ -282,7 +282,7 @@ 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) { @@ -2691,7 +2691,7 @@ 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); @@ -2731,7 +2731,7 @@ 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; === modified file 'src/systime.h' --- src/systime.h 2013-01-01 09:11:05 +0000 +++ src/systime.h 2013-03-24 12:59:45 +0000 @@ -121,7 +121,7 @@ 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. === modified file 'src/term.c' --- src/term.c 2013-03-13 07:27:34 +0000 +++ src/term.c 2013-03-24 12:59:45 +0000 @@ -2909,7 +2909,7 @@ { /* 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 === modified file 'src/window.c' --- src/window.c 2013-03-20 11:29:37 +0000 +++ src/window.c 2013-03-24 12:59:45 +0000 @@ -6002,8 +6002,7 @@ 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; === modified file 'src/xdisp.c' --- src/xdisp.c 2013-03-24 02:40:51 +0000 +++ src/xdisp.c 2013-03-24 12:59:45 +0000 @@ -2677,7 +2677,7 @@ 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 @@ -13170,8 +13170,8 @@ 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) { @@ -15520,7 +15520,7 @@ /* 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)) @@ -16221,7 +16221,7 @@ 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; @@ -17053,7 +17053,7 @@ /* 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. */ @@ -21008,7 +21008,7 @@ char * psuffix; char * p; - if (1000 <= quotient) + if (quotient >= 1000) { /* Scale to the appropriate EXPONENT. */ do @@ -21017,13 +21017,13 @@ 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++; @@ -21038,7 +21038,7 @@ } } else - if (500 <= remainder) + if (remainder >= 500) { if (quotient < 999) quotient++; === modified file 'src/xfns.c' --- src/xfns.c 2013-03-20 11:29:37 +0000 +++ src/xfns.c 2013-03-24 12:59:45 +0000 @@ -4322,7 +4322,7 @@ 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; === modified file 'src/xmenu.c' --- src/xmenu.c 2013-03-21 20:56:22 +0000 +++ src/xmenu.c 2013-03-24 12:59:45 +0000 @@ -1055,7 +1055,7 @@ 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], === modified file 'src/xselect.c' --- src/xselect.c 2013-03-24 05:29:35 +0000 +++ src/xselect.c 2013-03-24 12:59:45 +0000 @@ -1388,7 +1388,7 @@ 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); @@ -2541,7 +2541,7 @@ 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]; === modified file 'src/xsmfns.c' --- src/xsmfns.c 2013-03-13 07:27:34 +0000 +++ src/xsmfns.c 2013-03-24 12:59:45 +0000 @@ -221,7 +221,7 @@ 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; === modified file 'src/xterm.c' --- src/xterm.c 2013-03-07 03:01:17 +0000 +++ src/xterm.c 2013-03-24 12:59:45 +0000 @@ -5076,7 +5076,7 @@ /* 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, ------------------------------------------------------------ revno: 112125 fixes bug: http://debbugs.gnu.org/13999 committer: Leo Liu branch nick: trunk timestamp: Sun 2013-03-24 14:42:25 +0800 message: * lisp/files.el (kill-buffer-hook): Doc fix. * lisp/emacs-lisp/edebug.el (edebug-mode): Make sure edebug-kill-buffer is the last entry in kill-buffer-hook. * lisp/nxml/rng-valid.el (rng-validate-while-idle) (rng-validate-quick-while-idle): Guard against deleted buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-23 22:04:40 +0000 +++ lisp/ChangeLog 2013-03-24 06:42:25 +0000 @@ -1,3 +1,14 @@ +2013-03-24 Leo Liu + + * nxml/rng-valid.el (rng-validate-while-idle) + (rng-validate-quick-while-idle): Guard against deleted buffer. + (Bug#13999) + + * emacs-lisp/edebug.el (edebug-mode): Make sure edebug-kill-buffer + is the last entry in kill-buffer-hook. + + * files.el (kill-buffer-hook): Doc fix. + 2013-03-23 Dmitry Gutov * emacs-lisp/lisp-mode.el (emacs-lisp-docstring-fill-column): Make === modified file 'lisp/emacs-lisp/edebug.el' --- lisp/emacs-lisp/edebug.el 2013-01-11 23:08:55 +0000 +++ lisp/emacs-lisp/edebug.el 2013-03-24 06:42:25 +0000 @@ -3810,7 +3810,10 @@ ;; If the user kills the buffer in which edebug is currently active, ;; exit to top level, because the edebug command loop can't usefully ;; continue running in such a case. - (add-hook 'kill-buffer-hook 'edebug-kill-buffer nil t) + ;; + ;; Append `edebug-kill-buffer' to the hook to avoid interfering with + ;; other entries that are ungarded against deleted buffer. + (add-hook 'kill-buffer-hook 'edebug-kill-buffer t t) (use-local-map edebug-mode-map)) (defun edebug-kill-buffer () === modified file 'lisp/files.el' --- lisp/files.el 2013-03-04 07:37:30 +0000 +++ lisp/files.el 2013-03-24 06:42:25 +0000 @@ -1516,7 +1516,10 @@ (defvar kill-buffer-hook nil "Hook run when a buffer is killed. The buffer being killed is current while the hook is running. -See `kill-buffer'.") +See `kill-buffer'. + +Note: Be careful with let-binding this hook considering it is +frequently used for cleanup.") (defun find-alternate-file (filename &optional wildcards) "Find file FILENAME, select its buffer, kill previous buffer. === modified file 'lisp/nxml/rng-valid.el' --- lisp/nxml/rng-valid.el 2013-03-23 02:21:25 +0000 +++ lisp/nxml/rng-valid.el 2013-03-24 06:42:25 +0000 @@ -433,24 +433,26 @@ ;; validation process down. (defun rng-validate-while-idle (buffer) - (with-current-buffer buffer - (if rng-validate-mode - (if (let ((rng-validate-display-point (point)) - (rng-validate-display-modified-p (buffer-modified-p))) - (rng-do-some-validation 'rng-validate-while-idle-continue-p)) - (force-mode-line-update) - (rng-validate-done)) - ;; must have done kill-all-local-variables - (rng-kill-timers)))) + (when (buffer-live-p buffer) ; bug#13999 + (with-current-buffer buffer + (if rng-validate-mode + (if (let ((rng-validate-display-point (point)) + (rng-validate-display-modified-p (buffer-modified-p))) + (rng-do-some-validation 'rng-validate-while-idle-continue-p)) + (force-mode-line-update) + (rng-validate-done)) + ;; must have done kill-all-local-variables + (rng-kill-timers))))) (defun rng-validate-quick-while-idle (buffer) - (with-current-buffer buffer - (if rng-validate-mode - (if (rng-do-some-validation) - (force-mode-line-update) - (rng-validate-done)) - ;; must have done kill-all-local-variables - (rng-kill-timers)))) + (when (buffer-live-p buffer) ; bug#13999 + (with-current-buffer buffer + (if rng-validate-mode + (if (rng-do-some-validation) + (force-mode-line-update) + (rng-validate-done)) + ;; must have done kill-all-local-variables + (rng-kill-timers))))) (defun rng-validate-done () (when (or (not (current-message))