]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Corrected data type for TIFF directory offsets
authorSteve Underwood <steveu@coppice.org>
Tue, 6 May 2014 18:28:27 +0000 (02:28 +0800)
committerSteve Underwood <steveu@coppice.org>
Tue, 6 May 2014 18:28:27 +0000 (02:28 +0800)
libs/spandsp/src/t4_rx.c
libs/spandsp/src/t4_tx.c
libs/spandsp/tests/t43_tests.c

index 7a39dfd1448eb208d8aa1290b7450d70968b2f87..df10c8f7c960b43e766af702f7d4b336284a8030 100644 (file)
@@ -616,7 +616,7 @@ static int write_tiff_image(t4_rx_state_t *s)
 {
     t4_rx_tiff_state_t *t;
 #if defined(SPANDSP_SUPPORT_TIFF_FX)
-    uint64_t offset;
+    toff_t diroff;
 #endif
 
     t = &s->tiff;
@@ -686,14 +686,14 @@ static int write_tiff_image(t4_rx_state_t *s)
             TIFFSetField(t->tiff_file, TIFFTAG_VERSIONYEAR, "1998");
             TIFFSetField(t->tiff_file, TIFFTAG_MODENUMBER, 3);
 
-            offset = 0;
-            if (!TIFFWriteCustomDirectory(t->tiff_file, &offset))
+            diroff = 0;
+            if (!TIFFWriteCustomDirectory(t->tiff_file, &diroff))
                 span_log(&s->logging, SPAN_LOG_WARNING, "Failed to write custom directory.\n");
 
             /* Now go back and patch in the pointer to the new IFD */
             if (!TIFFSetDirectory(t->tiff_file, s->current_page))
                 span_log(&s->logging, SPAN_LOG_WARNING, "Failed to set directory.\n");
-            if (!TIFFSetField(t->tiff_file, TIFFTAG_GLOBALPARAMETERSIFD, offset))
+            if (!TIFFSetField(t->tiff_file, TIFFTAG_GLOBALPARAMETERSIFD, diroff))
                 span_log(&s->logging, SPAN_LOG_WARNING, "Failed to set field.\n");
             if (!TIFFWriteDirectory(t->tiff_file))
                 span_log(&s->logging, SPAN_LOG_WARNING, "%s: Failed to write directory for page %d.\n", t->file, s->current_page);
index 43138e5073f193142f1a52a111ca57f0d590196a..a8960e91b48b19e8a76484af8457b2513a51b498 100644 (file)
@@ -409,7 +409,7 @@ static int get_tiff_directory_info(t4_tx_state_t *s)
     char *u;
     char uu[10];
     float *fl_parms;
-    uint64_t diroff;
+    toff_t diroff;
     float lmin;
     float lmax;
     float amin;
index f6f6f0891a5ccd37baf0a9b3c18d04f511d47e29..76946b94b37137c87224ac46b249b1da89e23e9e 100644 (file)
@@ -185,7 +185,7 @@ int write_file(meta_t *meta, int page, const uint8_t buf[])
     uint8_t *out_buf2;
     packer_t packer;
 #if defined(SPANDSP_SUPPORT_TIFF_FX)
-    uint64_t offset;
+    toff_t diroff;
 #endif
 
     tif = meta->tif;
@@ -319,13 +319,13 @@ int write_file(meta_t *meta, int page, const uint8_t buf[])
         TIFFSetField(tif, TIFFTAG_VERSIONYEAR, "1998");
         TIFFSetField(tif, TIFFTAG_MODENUMBER, 3);
 
-        offset = 0;
-        if (!TIFFWriteCustomDirectory(tif, &offset))
+        diroff = 0;
+        if (!TIFFWriteCustomDirectory(tif, &diroff))
             printf("Failed to write custom directory.\n");
 
         if (!TIFFSetDirectory(tif, (tdir_t) page))
             printf("Failed to set directory.\n");
-        if (!TIFFSetField(tif, TIFFTAG_GLOBALPARAMETERSIFD, offset))
+        if (!TIFFSetField(tif, TIFFTAG_GLOBALPARAMETERSIFD, diroff))
             printf("Failed to set global parameters IFD.\n");
         if (!TIFFWriteDirectory(tif))
             printf("Failed to write directory.\n");
@@ -354,7 +354,7 @@ int read_file(meta_t *meta, int page)
     float *fl_parms;
     char uu[10];
     char *u;
-    uint64_t offset;
+    toff_t diroff;
 #endif
     TIFF *tif;
     uint16_t *map_L;
@@ -434,10 +434,10 @@ int read_file(meta_t *meta, int page)
 
 #if defined(SPANDSP_SUPPORT_TIFF_FX)
     printf("Trying to get global parameters\n");
-    if (TIFFGetField(tif, TIFFTAG_GLOBALPARAMETERSIFD, &offset))
+    if (TIFFGetField(tif, TIFFTAG_GLOBALPARAMETERSIFD, &diroff))
     {
-        printf("Got global parameters - %" PRIu64 "\n", offset);
-        if (!TIFFReadCustomDirectory(tif, offset, &tiff_fx_field_array))
+        printf("Got global parameters - %" PRIu64 "\n", (uint64_t) diroff);
+        if (!TIFFReadCustomDirectory(tif, diroff, &tiff_fx_field_array))
         {
             printf("Failed to set global parameters IFD.\n");
         }
@@ -893,7 +893,7 @@ int main(int argc, char *argv[])
     int output_compression;
     int page_no;
 #if defined(SPANDSP_SUPPORT_TIFF_FX)
-    uint64_t offset;
+    toff_t diroff;
 #endif
 
     source_file = (argc > 1)  ?  argv[1]  :  IN_FILE_NAME;
@@ -1385,13 +1385,13 @@ int main(int argc, char *argv[])
         TIFFSetField(tif, TIFFTAG_VERSIONYEAR, "1998");
         TIFFSetField(tif, TIFFTAG_MODENUMBER, 3);
 
-        offset = 0;
-        if (!TIFFWriteCustomDirectory(tif, &offset))
+        diroff = 0;
+        if (!TIFFWriteCustomDirectory(tif, &diroff))
             printf("Failed to write custom directory.\n");
 
         if (!TIFFSetDirectory(tif, (tdir_t) page_no))
             printf("Failed to set directory.\n");
-        if (!TIFFSetField(tif, TIFFTAG_GLOBALPARAMETERSIFD, offset))
+        if (!TIFFSetField(tif, TIFFTAG_GLOBALPARAMETERSIFD, diroff))
             printf("Failed to set global parameters IFD.\n");
         if (!TIFFWriteDirectory(tif))
             printf("Failed to write directory.\n");