grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v2.25-50-g5b3da8d


From: Paul Eggert
Subject: grep branch, master, updated. v2.25-50-g5b3da8d
Date: Fri, 19 Aug 2016 05:44:10 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  5b3da8d04b34f80e02c8d96bd739add0b05961a0 (commit)
      from  487a7fcfd8dfd6d6e8b3e95020d2ed3d852d317f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=5b3da8d04b34f80e02c8d96bd739add0b05961a0


commit 5b3da8d04b34f80e02c8d96bd739add0b05961a0
Author: Paul Eggert <address@hidden>
Date:   Thu Aug 18 22:43:28 2016 -0700

    grep: prefer bitwise to short-circuit when shorter
    
    * src/grep.c (skip_devices, initialize_unibyte_mask, fillbuf, main)
    * src/kwsearch.c (Fexecute): Prefer bitwise to short-circuit ops
    when they are logically equivalent and the bitwise ops generate
    shorter code on GCC 6.1 x86-64.
    * src/grep.c (get_nondigit_option, parse_grep_colors):
    Use c_isdigit instead of spelling it out with a short-circuit op.

diff --git a/src/grep.c b/src/grep.c
index a82da61..cc46919 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -560,7 +560,7 @@ static bool
 skip_devices (bool command_line)
 {
   return (devices == SKIP_DEVICES
-          || (devices == READ_COMMAND_LINE_DEVICES && !command_line));
+          || ((devices == READ_COMMAND_LINE_DEVICES) & !command_line));
 }
 
 /* Return if ST->st_size is defined.  Assume the file is not a
@@ -642,7 +642,7 @@ initialize_unibyte_mask (void)
   unsigned char mask = 0;
   int ms1b = 1;
   for (int i = 1; i <= UCHAR_MAX; i++)
-    if (mbclen_cache[i] != 1 && ! (mask & i))
+    if ((mbclen_cache[i] != 1) & ! (mask & i))
       {
         while (ms1b * 2 <= i)
           ms1b *= 2;
@@ -952,7 +952,7 @@ fillbuf (size_t save, struct stat const *st)
         }
       bufoffset += fillsize;
 
-      if (fillsize == 0 || !skip_nuls || !all_zeros (readbuf, fillsize))
+      if (((fillsize == 0) | !skip_nuls) || !all_zeros (readbuf, fillsize))
         break;
       totalnl = add_count (totalnl, fillsize);
 
@@ -2152,7 +2152,7 @@ get_nondigit_option (int argc, char *const *argv, 
intmax_t *default_context)
     {
       opt = getopt_long (argc, (char **) argv, short_options,
                          long_options, NULL);
-      if ( ! ('0' <= opt && opt <= '9'))
+      if (! c_isdigit (opt))
         break;
 
       if (prev_digit_optind != this_digit_optind || !was_digit)
@@ -2244,7 +2244,7 @@ parse_grep_colors (void)
       }
     else if (val == NULL)
       q++; /* Accumulate name.  */
-    else if (*q == ';' || (*q >= '0' && *q <= '9'))
+    else if (*q == ';' || c_isdigit (*q))
       q++; /* Accumulate val.  Protect the terminal from being sent crap.  */
     else
       return;
@@ -2702,7 +2702,7 @@ main (int argc, char **argv)
       count_matches = false;
       done_on_match = true;
     }
-  out_quiet = count_matches || done_on_match;
+  out_quiet = count_matches | done_on_match;
 
   if (out_after < 0)
     out_after = default_context;
diff --git a/src/kwsearch.c b/src/kwsearch.c
index d2afa40..09af4a2 100644
--- a/src/kwsearch.c
+++ b/src/kwsearch.c
@@ -94,7 +94,7 @@ Fexecute (char *buf, size_t size, size_t *match_size,
   else
     {
       mb_check = MB_CUR_MAX > 1 && !using_utf8 ();
-      longest = mb_check || start_ptr || match_words;
+      longest = mb_check | !!start_ptr | match_words;
     }
 
   for (mb_start = beg = start_ptr ? start_ptr : buf; beg <= buf + size; beg++)
@@ -124,7 +124,7 @@ Fexecute (char *buf, size_t size, size_t *match_size,
           continue;
         }
       beg += offset;
-      if (start_ptr && !match_words)
+      if (!!start_ptr & !match_words)
         goto success_in_beg_and_len;
       if (match_lines)
         {

-----------------------------------------------------------------------

Summary of changes:
 src/grep.c     |   12 ++++++------
 src/kwsearch.c |    4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]