changeset 5415:6b74fae0519f

(struct quoting_options): Use unsigned int for quote_these_too, so that right shifts are well defined. All uses changed.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 11 Nov 2004 05:58:47 +0000
parents 1b5e702ecdd1
children 5d5bf053f352
files lib/quotearg.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/quotearg.c
+++ b/lib/quotearg.c
@@ -84,7 +84,7 @@
 
   /* 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 @@
 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;