Source-Changes-HG archive

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

[src/trunk]: src/gnu/dist/toolchain/readline Do not compare to chars to >= 0 ...



details:   https://anonhg.NetBSD.org/src/rev/1a4bdd693f4c
branches:  trunk
changeset: 514331:1a4bdd693f4c
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Aug 30 02:15:42 2001 +0000

description:
Do not compare to chars to >= 0 since this will cause a warning where
chars are unsigned.  instead, change it from ((c) < foo && (c) >= 0) to
((unsigned char)(c) < foo) which does the same thing but avoids the warning

diffstat:

 gnu/dist/toolchain/readline/chardefs.h |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r e861f07465f6 -r 1a4bdd693f4c gnu/dist/toolchain/readline/chardefs.h
--- a/gnu/dist/toolchain/readline/chardefs.h    Thu Aug 30 02:08:42 2001 +0000
+++ b/gnu/dist/toolchain/readline/chardefs.h    Thu Aug 30 02:15:42 2001 +0000
@@ -51,7 +51,7 @@
 #define meta_character_bit 0x080           /* x0000000, must be on. */
 #define largest_char 255                   /* Largest character value. */
 
-#define CTRL_CHAR(c) ((c) < control_character_threshold && (c) >= 0)
+#define CTRL_CHAR(c) ((unsigned char)(c) < control_character_threshold)
 #define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
 
 #define CTRL(c) ((c) & control_character_mask)



Home | Main Index | Thread Index | Old Index