summaryrefslogtreecommitdiff
path: root/cmd-line-utils
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-06-05 18:14:56 +0300
committerGeorgi Kodinov <joro@sun.com>2009-06-05 18:14:56 +0300
commitdd570869f483e5ce6dcd45f3b77e69df585c814a (patch)
treea7ea481953e3f4cb28070fdc02e04ed7e71318d0 /cmd-line-utils
parent22454390c0ce1c3f90059811548a71ee18cac4f3 (diff)
downloadmariadb-git-dd570869f483e5ce6dcd45f3b77e69df585c814a.tar.gz
Bug #45286: compilation warnings on mysql-5.0-bugteam on MacOSX
Implemented a way to circumvent the always true comparison by having nested macros (as suggested on review).
Diffstat (limited to 'cmd-line-utils')
-rw-r--r--cmd-line-utils/readline/chardefs.h3
-rw-r--r--cmd-line-utils/readline/display.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/cmd-line-utils/readline/chardefs.h b/cmd-line-utils/readline/chardefs.h
index def3a111bd3..36fe7fdd7ac 100644
--- a/cmd-line-utils/readline/chardefs.h
+++ b/cmd-line-utils/readline/chardefs.h
@@ -59,7 +59,8 @@
#define largest_char 255 /* Largest character value. */
#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
-#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
+#define META_BYTE(c) ((c) > meta_character_threshold)
+#define META_CHAR(c) (META_BYTE(c) && (c) <= largest_char)
#define CTRL(c) ((c) & control_character_mask)
#define META(c) ((c) | meta_character_bit)
diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c
index 54c56954f43..842a586b76b 100644
--- a/cmd-line-utils/readline/display.c
+++ b/cmd-line-utils/readline/display.c
@@ -1888,7 +1888,7 @@ rl_character_len (c, pos)
uc = (unsigned char)c;
- if (META_CHAR (c))
+ if (META_BYTE (uc))
return ((_rl_output_meta_chars == 0) ? 4 : 1);
if (uc == '\t')