From 3cca0edf4d9c3afe0c51c4b5bb59f99c743f7067 Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 17 Apr 2004 18:12:58 +0000 Subject: [PATCH] `gcc -Wall' points out some signed/unsigned comparisons. Fixed. git-svn-id: svn://svn.tartarus.org/sgt/charset@4090 cda61777-01e9-0310-a592-d414129be87e --- euc.c | 3 ++- hz.c | 2 +- iso2022s.c | 4 ++-- sbcs.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/euc.c b/euc.c index 72bd2b3..5d33a6f 100644 --- a/euc.c +++ b/euc.c @@ -79,7 +79,8 @@ static void read_euc(charset_spec const *charset, long int input_chr, * it. */ if (state->s0 != 0 && - ((state->s0 & 0x0F000000) >> 24) >= euc->nchars[(state->s0 >> 28)-1]) { + ((state->s0 & 0x0F000000) >> 24) >= + (unsigned)euc->nchars[(state->s0 >> 28)-1]) { emit(emitctx, euc->to_ucs(state->s0)); state->s0 = 0; } diff --git a/hz.c b/hz.c index dc42171..1266e7e 100644 --- a/hz.c +++ b/hz.c @@ -110,7 +110,7 @@ static int write_hz(charset_spec const *charset, long int input_chr, return FALSE; } - if (state->s0 != desired_state) { + if (state->s0 != (unsigned)desired_state) { emit(emitctx, '~'); emit(emitctx, desired_state ? '{' : '}'); state->s0 = desired_state; diff --git a/iso2022s.c b/iso2022s.c index 0878352..e202207 100644 --- a/iso2022s.c +++ b/iso2022s.c @@ -344,7 +344,7 @@ static int write_iso2022s(charset_spec const *charset, long int input_chr, * to the effort of emitting the sequence. */ cont = iso->escapes[i].container; - if (((state->s1 >> (6*cont)) & 0x3F) != subcharset) { + if (((state->s1 >> (6*cont)) & 0x3F) != (unsigned)subcharset) { for (j = 0; iso->escapes[i].sequence[j]; j++) emit(emitctx, iso->escapes[i].sequence[j]); state->s1 &= iso->escapes[i].andbits; @@ -362,7 +362,7 @@ static int write_iso2022s(charset_spec const *charset, long int input_chr, } else { /* Emit SI or SO, but only if the current container isn't already * the right one. */ - if (((state->s1 >> 28) & 7) != cont) { + if (((state->s1 >> 28) & 7) != (unsigned)cont) { emit(emitctx, cont ? SO : SI); state->s1 = (state->s1 & 0x8FFFFFFF) | (cont << 28); } diff --git a/sbcs.c b/sbcs.c index e15708c..bf4e4b1 100644 --- a/sbcs.c +++ b/sbcs.c @@ -43,9 +43,9 @@ int write_sbcs(charset_spec const *charset, long int input_chr, while (i+1 < j) { k = (i+j)/2; c = sd->ucs2sbcs[k]; - if (input_chr < sd->sbcs2ucs[c]) + if (input_chr < (long int)sd->sbcs2ucs[c]) j = k; - else if (input_chr > sd->sbcs2ucs[c]) + else if (input_chr > (long int)sd->sbcs2ucs[c]) i = k; else { emit(emitctx, c); -- 2.11.0