Add casts for signed/unsigned ints
[yaz-moved-to-github.git] / src / zoom-c.c
index 2535a74..cb6144e 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2009 Index Data
+ * Copyright (C) 1995-2010 Index Data
  * See the file LICENSE for details.
  */
 /**
@@ -1071,7 +1071,7 @@ static void resultset_destroy(ZOOM_resultset r)
 ZOOM_API(size_t)
     ZOOM_resultset_size(ZOOM_resultset r)
 {
-    yaz_log(log_details, "ZOOM_resultset_size r=" ODR_INT_PRINTF " count=%d",
+    yaz_log(log_details, "ZOOM_resultset_size r=%p count=" ODR_INT_PRINTF,
             r, r->size);
     return r->size;
 }
@@ -1848,7 +1848,7 @@ static yaz_iconv_t iconv_create_charset(const char *record_charset)
     {
         /* Use "from,to" or just "from" */
         const char *cp = strchr(record_charset, ',');
-        int clen = strlen(record_charset);
+        size_t clen = strlen(record_charset);
         if (cp && cp[1])
         {
             strncpy( to, cp+1, sizeof(to)-1);
@@ -2065,7 +2065,7 @@ ZOOM_API(const char *)
     char charset[40];
     char xpath[512];
     const char *cp;
-    int i;
+    size_t i;
     Z_NamePlusRecord *npr;
     
     if (len)
@@ -2093,7 +2093,7 @@ ZOOM_API(const char *)
             i++;
         if (!strncmp(type_spec+i, "charset=", 8))
         {
-            int j = 0;
+            size_t j = 0;
             i = i + 8; /* skip charset= */
             for (j = 0; type_spec[i]  && j < sizeof(charset)-1; i++, j++)
             {
@@ -2105,7 +2105,7 @@ ZOOM_API(const char *)
         }
         else if (!strncmp(type_spec+i, "xpath=", 6))
         {
-            int j = 0; 
+            size_t j = 0; 
             i = i + 6;
             for (j = 0; type_spec[i] && j < sizeof(xpath)-1; i++, j++)
                 xpath[j] = cp[i];
@@ -2911,7 +2911,7 @@ ZOOM_API(size_t)
 }
 
 static void ZOOM_scanset_term_x(ZOOM_scanset scan, size_t pos,
-                                int *occ,
+                                size_t *occ,
                                 const char **value_term, size_t *value_len,
                                 const char **disp_term, size_t *disp_len)
 {
@@ -2924,7 +2924,7 @@ static void ZOOM_scanset_term_x(ZOOM_scanset scan, size_t pos,
     *disp_len = 0;
 
     *occ = 0;
-    if (pos >= noent || pos < 0)
+    if (pos >= noent)
         return;
     if (scan->scan_response)
     {
@@ -2969,7 +2969,7 @@ static void ZOOM_scanset_term_x(ZOOM_scanset scan, size_t pos,
 
 ZOOM_API(const char *)
     ZOOM_scanset_term(ZOOM_scanset scan, size_t pos,
-                      int *occ, int *len)
+                      size_t *occ, size_t *len)
 {
     const char *value_term = 0;
     size_t value_len = 0;
@@ -2985,7 +2985,7 @@ ZOOM_API(const char *)
 
 ZOOM_API(const char *)
     ZOOM_scanset_display_term(ZOOM_scanset scan, size_t pos,
-                              int *occ, int *len)
+                              size_t *occ, size_t *len)
 {
     const char *value_term = 0;
     size_t value_len = 0;