From 2b13c71b8560203814efd6b45f8fa387d5ab0418 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 11 Nov 2004 05:58:47 +0000 Subject: [PATCH] (struct quoting_options): Use unsigned int for quote_these_too, so that right shifts are well defined. All uses changed. --- lib/quotearg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/quotearg.c b/lib/quotearg.c index 64fa676354..8c95b7ae5e 100644 --- a/lib/quotearg.c +++ b/lib/quotearg.c @@ -84,7 +84,7 @@ struct quoting_options /* Quote the characters indicated by this bit vector even if the quoting style would not normally require them to be quoted. */ - int quote_these_too[(UCHAR_MAX / INT_BITS) + 1]; + unsigned int quote_these_too[(UCHAR_MAX / INT_BITS) + 1]; }; /* Names of quoting styles. */ @@ -152,7 +152,8 @@ int set_char_quoting (struct quoting_options *o, char c, int i) { unsigned char uc = c; - int *p = (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS; + unsigned int *p = + (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS; int shift = uc % INT_BITS; int r = (*p >> shift) & 1; *p ^= ((i & 1) ^ r) << shift; -- 2.30.2