Avoid pointer-sign clash in yaz_marc_decode_buf() call.
[yaz-moved-to-github.git] / util / marcdump.c
index e056593..f5087e4 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2006, Index Data ApS
  * See the file LICENSE for details.
  *
  * Copyright (C) 1995-2006, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: marcdump.c,v 1.36 2006-04-19 10:05:04 adam Exp $
+ * $Id: marcdump.c,v 1.39 2006-06-12 16:12:58 mike Exp $
  */
 
 #define _FILE_OFFSET_BITS 64
  */
 
 #define _FILE_OFFSET_BITS 64
@@ -129,9 +129,9 @@ static void dump(const char *fname, const char *from, const char *to,
             int marc_no = 0;
             for(;; marc_no++)
             {
             int marc_no = 0;
             for(;; marc_no++)
             {
-                int len;
+                size_t len;
                 char *result = 0;
                 char *result = 0;
-                int rlen;
+                size_t rlen;
                 size_t r;
                 char buf[100001];
                 
                 size_t r;
                 char buf[100001];
                 
@@ -139,7 +139,8 @@ static void dump(const char *fname, const char *from, const char *to,
                 if (r < 5)
                 {
                     if (r && print_offset && verbose)
                 if (r < 5)
                 {
                     if (r && print_offset && verbose)
-                        printf ("<!-- Extra %d bytes at end of file -->\n", r);
+                        printf ("<!-- Extra %ld bytes at end of file -->\n",
+                                (long) r);
                     break;
                 }
                 while (*buf < '0' || *buf > '9')
                     break;
                 }
                 while (*buf < '0' || *buf > '9')
@@ -203,7 +204,9 @@ static void dump(const char *fname, const char *from, const char *to,
                         fclose(sf);
                     }
                 }
                         fclose(sf);
                     }
                 }
-                r = yaz_marc_decode_buf (mt, buf, -1, &result, &rlen);
+                { int rlentmp = (int) rlen;
+                  r = yaz_marc_decode_buf (mt, buf, -1, &result, &rlentmp);
+                  rlen = (size_t) rlentmp; }
                 if (r > 0 && result)
                 {
                     fwrite (result, rlen, 1, stdout);
                 if (r > 0 && result)
                 {
                     fwrite (result, rlen, 1, stdout);
@@ -211,7 +214,7 @@ static void dump(const char *fname, const char *from, const char *to,
                 if (r > 0 && cfile)
                 {
                     char *p = buf;
                 if (r > 0 && cfile)
                 {
                     char *p = buf;
-                    int i;
+                    size_t i;
                     if (count)
                         fprintf (cfile, ",");
                     fprintf (cfile, "\n");
                     if (count)
                         fprintf (cfile, ",");
                     fprintf (cfile, "\n");