Avoid signed char subscript
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 30 Dec 2004 00:11:00 +0000 (00:11 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 30 Dec 2004 00:11:00 +0000 (00:11 +0000)
src/log.c
src/marcdisp.c
src/matchstr.c
src/odr_util.c
src/oid.c
ztest/read-grs.c
ztest/read-marc.c
ztest/ztest.c

index 6fd475d..e8aa1a8 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
- * $Id: log.c,v 1.18 2004-12-13 14:21:55 heikki Exp $
+ * $Id: log.c,v 1.19 2004-12-30 00:11:00 adam Exp $
  */
 
 /**
  */
 
 /**
@@ -397,15 +397,13 @@ int yaz_log_mask_str_x (const char *str, int level)
 {
     const char *p;
     int i;
 {
     const char *p;
     int i;
-    int found;
-    int negated;
     char clean[255] = "";
     char *n = clean;
 
     while (*str)
     {
     char clean[255] = "";
     char *n = clean;
 
     while (*str)
     {
-        found = 0;
-        negated=0;
+        int found = 0;
+        int negated = 0;
         for (p = str; *p && *p != ','; p++)
             ;
         if (*str=='-')
         for (p = str; *p && *p != ','; p++)
             ;
         if (*str=='-')
@@ -413,7 +411,7 @@ int yaz_log_mask_str_x (const char *str, int level)
             negated=1;
             str++;
         }
             negated=1;
             str++;
         }
-        if (isdigit(*str))
+        if (isdigit(*(unsigned char *) str))
         {
             level = atoi (str);
             found = 1;
         {
             level = atoi (str);
             found = 1;
index e42080a..ef06425 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
- * $Id: marcdisp.c,v 1.10 2004-11-26 11:01:05 adam Exp $
+ * $Id: marcdisp.c,v 1.11 2004-12-30 00:12:13 adam Exp $
  */
 
 /**
  */
 
 /**
@@ -84,11 +84,11 @@ int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr)
     /* ballout if bsize is known and record_length is less than that */
     if (bsize != -1 && record_length > bsize)
        return -1;
     /* ballout if bsize is known and record_length is less than that */
     if (bsize != -1 && record_length > bsize)
        return -1;
-    if (isdigit(buf[10]))
+    if (isdigit(((const unsigned char *) buf)[10]))
         indicator_length = atoi_n (buf+10, 1);
     else
         indicator_length = 2;
         indicator_length = atoi_n (buf+10, 1);
     else
         indicator_length = 2;
-    if (isdigit(buf[11]))
+    if (isdigit(((const unsigned char *) buf)[11]))
        identifier_length = atoi_n (buf+11, 1);
     else
         identifier_length = 2;
        identifier_length = atoi_n (buf+11, 1);
     else
         identifier_length = 2;
index 95c32e0..4db3360 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2004, Index Data.
  * See the file LICENSE for details.
  *
  * Copyright (c) 1995-2004, Index Data.
  * See the file LICENSE for details.
  *
- * $Id: matchstr.c,v 1.2 2004-10-15 00:19:00 adam Exp $
+ * $Id: matchstr.c,v 1.3 2004-12-30 00:14:00 adam Exp $
  */
 
 /**
  */
 
 /**
@@ -30,8 +30,8 @@ int yaz_matchstr(const char *s1, const char *s2)
 {
     while (*s1 && *s2)
     {
 {
     while (*s1 && *s2)
     {
-       char c1 = *s1;
-       char c2 = *s2;
+       unsigned char c1 = *s1;
+       unsigned char c2 = *s2;
 
         if (c2 == '?')
             return 0;
 
         if (c2 == '?')
             return 0;
index 0d4db2e..2748da4 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
- * $Id: odr_util.c,v 1.5 2004-10-15 00:19:00 adam Exp $
+ * $Id: odr_util.c,v 1.6 2004-12-30 00:14:38 adam Exp $
  */
 /**
  * \file odr_util.c
  */
 /**
  * \file odr_util.c
@@ -69,7 +69,7 @@ Odr_oid *odr_getoidbystr_nmem(NMEM nmem, const char *str)
     const char *p = str;
     Odr_oid *ret;
 
     const char *p = str;
     Odr_oid *ret;
 
-    if (!isdigit(*str))
+    if (!isdigit(*(const unsigned char *) str))
        return 0;
     while ((p = strchr(p, '.')))
        num++, p++;
        return 0;
     while ((p = strchr(p, '.')))
        num++, p++;
index 0fb1b1d..b7ec98d 100644 (file)
--- a/src/oid.c
+++ b/src/oid.c
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
- * $Id: oid.c,v 1.5 2004-12-22 23:45:13 adam Exp $
+ * $Id: oid.c,v 1.6 2004-12-30 00:12:54 adam Exp $
  */
 
 /**
  */
 
 /**
@@ -542,7 +542,7 @@ static oid_value oid_getval_raw(const char *name)
     int val = 0, i = 0, oid[OID_SIZE];
     struct oident *oident;
     
     int val = 0, i = 0, oid[OID_SIZE];
     struct oident *oident;
     
-    while (isdigit (*name))
+    while (isdigit (*(const unsigned char *) name))
     {
         val = val*10 + (*name - '0');
         name++;
     {
         val = val*10 + (*name - '0');
         name++;
@@ -568,7 +568,7 @@ oid_value oid_getvalbyname(const char *name)
     struct oident_list *ol;
 
     oid_init ();
     struct oident_list *ol;
 
     oid_init ();
-    if (isdigit (*name))
+    if (isdigit (*(const unsigned char *) name))
         return oid_getval_raw (name);
     for (ol = oident_table; ol; ol = ol->next)
        if (!yaz_matchstr(ol->oident.desc, name))
         return oid_getval_raw (name);
     for (ol = oident_table; ol; ol = ol->next)
        if (!yaz_matchstr(ol->oident.desc, name))
index 2acbca5..18b668f 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2003, Index Data.
  * See the file LICENSE for details.
  *
  * Copyright (c) 1995-2003, Index Data.
  * See the file LICENSE for details.
  *
- * $Id: read-grs.c,v 1.10 2004-12-13 14:21:59 heikki Exp $
+ * $Id: read-grs.c,v 1.11 2004-12-30 00:18:04 adam Exp $
  */
 
 /*
  */
 
 /*
@@ -32,7 +32,7 @@ static Z_GenericRecord *read_grs1(FILE *f, ODR o)
 
        while (fgets(buf = line, 512, f))
        {
 
        while (fgets(buf = line, 512, f))
        {
-           while (*buf && isspace(*buf))
+           while (*buf && isspace(*(unsigned char *) buf))
                buf++;
            if (!*buf || *buf == '#')
                continue;
                buf++;
            if (!*buf || *buf == '#')
                continue;
@@ -50,7 +50,7 @@ static Z_GenericRecord *read_grs1(FILE *f, ODR o)
        if (!(buf = strchr(buf, ')')))
            return 0;
        buf++;
        if (!(buf = strchr(buf, ')')))
            return 0;
        buf++;
-       while (*buf && isspace(*buf))
+       while (*buf && isspace(*(unsigned char *) buf))
            buf++;
        if (!*buf)
            return 0;
            buf++;
        if (!*buf)
            return 0;
index cc9ca29..850b706 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 2002, Index Data.
  * See the file LICENSE for details.
  *
  * Copyright (c) 2002, Index Data.
  * See the file LICENSE for details.
  *
- * $Id: read-marc.c,v 1.4 2002-12-16 13:13:53 adam Exp $
+ * $Id: read-marc.c,v 1.5 2004-12-30 00:18:04 adam Exp $
  */
 
 /*
  */
 
 /*
@@ -1537,7 +1537,7 @@ static int atoin (const char *buf, int n)
     int val = 0;
     while (--n >= 0)
     {
     int val = 0;
     while (--n >= 0)
     {
-        if (isdigit(*buf))
+        if (isdigit(*(const unsigned char *) buf))
             val = val*10 + (*buf - '0');
         buf++;
     }
             val = val*10 + (*buf - '0');
         buf++;
     }
index 1396c4e..c7f7fdb 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2004, Index Data.
  * See the file LICENSE for details.
  *
  * Copyright (c) 1995-2004, Index Data.
  * See the file LICENSE for details.
  *
- * $Id: ztest.c,v 1.67 2004-11-18 15:18:14 heikki Exp $
+ * $Id: ztest.c,v 1.68 2004-12-30 00:18:04 adam Exp $
  */
 
 /*
  */
 
 /*
@@ -568,7 +568,7 @@ int ztest_scan(void *handle, bend_scan_rr *q)
     memcpy(term, q->term->term->u.general->buf, q->term->term->u.general->len);
     term[q->term->term->u.general->len] = '\0';
     for (p = term; *p; p++)
     memcpy(term, q->term->term->u.general->buf, q->term->term->u.general->len);
     term[q->term->term->u.general->len] = '\0';
     for (p = term; *p; p++)
-       if (islower(*p))
+       if (islower(*(unsigned char *) p))
            *p = toupper(*p);
 
     fseek(f, 0, SEEK_SET);
            *p = toupper(*p);
 
     fseek(f, 0, SEEK_SET);