libtiff: Merge branch 'MinGW-warnings_ipctutil' into 'master'

From 6ac3c7a0b0bbcfbc82882b9ece77787455036173 Mon Sep 17 00:00:00 2001
From: Su Laus <[EMAIL REDACTED]>
Date: Mon, 26 Sep 2022 18:06:11 +0000
Subject: [PATCH] Fix #458: MinGW Windows 64: warning because 'long' is a 32
 bits type in...

---
 contrib/iptcutil/iptcutil.c | 10 +++++-----
 libtiff/tif_zstd.c          |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/contrib/iptcutil/iptcutil.c b/contrib/iptcutil/iptcutil.c
index 404b209e..22dce1aa 100644
--- a/contrib/iptcutil/iptcutil.c
+++ b/contrib/iptcutil/iptcutil.c
@@ -343,12 +343,12 @@ char *super_fgets(char *b, int *blen, FILE *file)
       c=fgetc(file);
       if (c == EOF || c == '\n')
         break;
-      if (((long)q - (long)b + 1 ) >= (long) len)
+      if ( (int)(q - b + 1) >= len) 
         {
           long
             tlen;
 
-          tlen=(long)q-(long)b;
+          tlen=(int)(q - b);
           len<<=1;
           b=(char *) realloc((char *) b,(len+2));
           if ((char *) b == (char *) NULL)
@@ -363,7 +363,7 @@ char *super_fgets(char *b, int *blen, FILE *file)
       int
         tlen;
 
-      tlen=(long)q - (long)b;
+      tlen=(int)(q - b);
       if (tlen == 0)
         return (char *) NULL;
       b[tlen] = '\0';
@@ -532,7 +532,7 @@ int main(int argc, char *argv[])
                       quoted;
 
                     next=0;
-                    len = strlen(token);
+                    len = (unsigned long)strlen(token);
                     while(tokenizer(0, newstr, inputlen, token, "", "&", "", 0,
                                     &brkused, &next, &quoted)==0)
                       {
@@ -541,7 +541,7 @@ int main(int argc, char *argv[])
                             char
                               *s = &token[next-1];
 
-                            len -= convertHTMLcodes(s, strlen(s));
+                            len -= convertHTMLcodes(s, (int)strlen(s));
                           }
                       }
 
diff --git a/libtiff/tif_zstd.c b/libtiff/tif_zstd.c
index 960aa90a..263c17ca 100644
--- a/libtiff/tif_zstd.c
+++ b/libtiff/tif_zstd.c
@@ -160,7 +160,7 @@ ZSTDDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
                 TIFFErrorExt(tif->tif_clientdata, module,
                     "Not enough data at scanline %lu (short %lu bytes)",
                     (unsigned long) tif->tif_row,
-                    (unsigned long) (size_t)occ - out_buffer.pos);
+                    (unsigned long) ((size_t)occ - out_buffer.pos));
                 return 0;
         }