瀏覽代碼

* 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.
Paul Eggert 17 年之前
父節點
當前提交
6060d613d1
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 6 0
      ChangeLog
  2. 1 1
      src/utf8.c

+ 6 - 0
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.

+ 1 - 1
src/utf8.c

@@ -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;
 }