]> Dogcows Code - chaz/tar/commitdiff
* src/utf8.c (string_ascii_p): Recode to avoid bogus GCC 4.2.1
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 13 Oct 2007 05:49:18 +0000 (05:49 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 13 Oct 2007 05:49:18 +0000 (05:49 +0000)
warning about "comparison is always true due to limited range of
data type" when char is unsigned.

ChangeLog
src/utf8.c

index 34088562a74f4adc440a5679abcd31e96280394f..6d15c9cac774041caad7d1b3c315257065cade2e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * src/utf8.c (string_ascii_p): Recode to avoid bogus GCC 4.2.1
+       warning about "comparison is always true due to limited range of
+       data type" when char is unsigned.
+
 2007-10-11  Paul Eggert  <eggert@cs.ucla.edu>
 
        Adjust to recent gnulib changes.
index d5e5963863ee555cc727039cda3ef7128dce6bc0..c9836d6273f661faae0da85029444a7eac3fbc70 100644 (file)
@@ -91,7 +91,7 @@ bool
 string_ascii_p (char const *p)
 {
   for (; *p; p++)
-    if (! (0 <= *p && *p <= 127))
+    if (*p & ~0x7f)
       return false;
   return true;
 }
This page took 0.024435 seconds and 4 git commands to generate.