1
0
mirror of https://gitlab.com/libtiff/libtiff.git synced 2026-10-24 19:59:18 +03:00

Add -Wswitch-enum to extra-warnings

* Fix warnings
This commit is contained in:
Roger Leigh
2025-12-24 16:58:51 +00:00
parent b5eff3d3b7
commit 2a3d55b52e
19 changed files with 384 additions and 3 deletions

View File

@@ -89,6 +89,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
-Wstrict-prototypes
-Wmissing-prototypes
-Wswitch-default
-Wswitch-enum
)
endif()
if(broken-warnings)
@@ -98,7 +99,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
-Wdouble-promotion
-Wmisleading-indentation
-Wmissing-include-dirs
-Wswitch-enum
-Wunused-local-typedefs
-Wunused-parameter
-Wuninitialized

View File

@@ -1018,6 +1018,8 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
_TIFFmemcpy(val, &v2, tv_size);
}
break;
case TIFF_NOTYPE:
case TIFF_ASCII:
default:
_TIFFmemset(val, 0, tv_size);
status = 0;
@@ -1564,6 +1566,8 @@ static int _TIFFVGetField(TIFF *tif, uint32_t tag, va_list ap)
*va_arg(ap, double *) = *(double *)val;
ret_val = 1;
break;
case TIFF_NOTYPE:
case TIFF_ASCII:
default:
ret_val = 0;
break;

View File

@@ -842,6 +842,34 @@ int TIFFFieldSetGetCountSize(const TIFFField *fip)
case TIFF_SETGET_C32_DOUBLE:
case TIFF_SETGET_C32_IFD8:
return 4;
case TIFF_SETGET_UNDEFINED:
case TIFF_SETGET_ASCII:
case TIFF_SETGET_UINT8:
case TIFF_SETGET_SINT8:
case TIFF_SETGET_UINT16:
case TIFF_SETGET_SINT16:
case TIFF_SETGET_UINT32:
case TIFF_SETGET_SINT32:
case TIFF_SETGET_UINT64:
case TIFF_SETGET_SINT64:
case TIFF_SETGET_FLOAT:
case TIFF_SETGET_DOUBLE:
case TIFF_SETGET_IFD8:
case TIFF_SETGET_INT:
case TIFF_SETGET_UINT16_PAIR:
case TIFF_SETGET_C0_ASCII:
case TIFF_SETGET_C0_UINT8:
case TIFF_SETGET_C0_SINT8:
case TIFF_SETGET_C0_UINT16:
case TIFF_SETGET_C0_SINT16:
case TIFF_SETGET_C0_UINT32:
case TIFF_SETGET_C0_SINT32:
case TIFF_SETGET_C0_UINT64:
case TIFF_SETGET_C0_SINT64:
case TIFF_SETGET_C0_FLOAT:
case TIFF_SETGET_C0_DOUBLE:
case TIFF_SETGET_C0_IFD8:
case TIFF_SETGET_OTHER:
default:
return 0;
}
@@ -1011,6 +1039,7 @@ TIFFField *_TIFFCreateAnonField(TIFF *tif, uint32_t tag,
case TIFF_SLONG8:
fld->set_get_field_type = TIFF_SETGET_C32_SINT64;
break;
case TIFF_NOTYPE:
default:
fld->set_get_field_type = TIFF_SETGET_UNDEFINED;
break;
@@ -1083,6 +1112,7 @@ static TIFFSetGetFieldType _TIFFSetGetType(TIFFDataType type, short count,
return TIFF_SETGET_UINT64;
case TIFF_SLONG8:
return TIFF_SETGET_SINT64;
case TIFF_NOTYPE:
default:
return TIFF_SETGET_UNDEFINED;
}
@@ -1120,6 +1150,7 @@ static TIFFSetGetFieldType _TIFFSetGetType(TIFFDataType type, short count,
return TIFF_SETGET_C0_UINT64;
case TIFF_SLONG8:
return TIFF_SETGET_C0_SINT64;
case TIFF_NOTYPE:
default:
return TIFF_SETGET_UNDEFINED;
}
@@ -1157,6 +1188,7 @@ static TIFFSetGetFieldType _TIFFSetGetType(TIFFDataType type, short count,
return TIFF_SETGET_C16_UINT64;
case TIFF_SLONG8:
return TIFF_SETGET_C16_SINT64;
case TIFF_NOTYPE:
default:
return TIFF_SETGET_UNDEFINED;
}
@@ -1194,6 +1226,7 @@ static TIFFSetGetFieldType _TIFFSetGetType(TIFFDataType type, short count,
return TIFF_SETGET_C32_UINT64;
case TIFF_SLONG8:
return TIFF_SETGET_C32_SINT64;
case TIFF_NOTYPE:
default:
return TIFF_SETGET_UNDEFINED;
}

View File

@@ -4028,6 +4028,7 @@ static void TIFFReadDirEntryOutputErr(TIFF *tif, enum TIFFReadDirEntryErr err,
TIFFErrorExtR(tif, module, "Out of memory reading of \"%s\"",
tagname);
break;
case TIFFReadDirEntryErrOk:
default:
assert(0); /* we should never get here */
break;
@@ -4074,6 +4075,7 @@ static void TIFFReadDirEntryOutputErr(TIFF *tif, enum TIFFReadDirEntryErr err,
"Out of memory reading of \"%s\"; tag ignored",
tagname);
break;
case TIFFReadDirEntryErrOk:
default:
assert(0); /* we should never get here */
break;
@@ -7704,6 +7706,12 @@ static int TIFFFetchNormalTag(TIFF *tif, TIFFDirEntry *dp, int recover)
}
}
break;
case TIFF_SETGET_INT:
case TIFF_SETGET_C0_ASCII:
case TIFF_SETGET_C0_IFD8:
case TIFF_SETGET_OTHER:
assert(0); /* these should not arrive here */
break;
default:
assert(0); /* we should never get here */
break;

View File

@@ -952,6 +952,54 @@ static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone,
goto bad;
}
break;
case TIFF_SETGET_UNDEFINED:
case TIFF_SETGET_SINT8:
case TIFF_SETGET_SINT16:
case TIFF_SETGET_SINT32:
case TIFF_SETGET_UINT64:
case TIFF_SETGET_SINT64:
case TIFF_SETGET_FLOAT:
case TIFF_SETGET_DOUBLE:
case TIFF_SETGET_IFD8:
case TIFF_SETGET_INT:
case TIFF_SETGET_UINT16_PAIR:
case TIFF_SETGET_C0_ASCII:
case TIFF_SETGET_C0_UINT8:
case TIFF_SETGET_C0_SINT8:
case TIFF_SETGET_C0_UINT16:
case TIFF_SETGET_C0_SINT16:
case TIFF_SETGET_C0_UINT32:
case TIFF_SETGET_C0_SINT32:
case TIFF_SETGET_C0_UINT64:
case TIFF_SETGET_C0_SINT64:
case TIFF_SETGET_C0_FLOAT:
case TIFF_SETGET_C0_DOUBLE:
case TIFF_SETGET_C0_IFD8:
case TIFF_SETGET_C16_ASCII:
case TIFF_SETGET_C16_UINT8:
case TIFF_SETGET_C16_SINT8:
case TIFF_SETGET_C16_UINT16:
case TIFF_SETGET_C16_SINT16:
case TIFF_SETGET_C16_UINT32:
case TIFF_SETGET_C16_SINT32:
case TIFF_SETGET_C16_UINT64:
case TIFF_SETGET_C16_SINT64:
case TIFF_SETGET_C16_FLOAT:
case TIFF_SETGET_C16_DOUBLE:
case TIFF_SETGET_C16_IFD8:
case TIFF_SETGET_C32_ASCII:
case TIFF_SETGET_C32_SINT8:
case TIFF_SETGET_C32_UINT16:
case TIFF_SETGET_C32_SINT16:
case TIFF_SETGET_C32_UINT32:
case TIFF_SETGET_C32_SINT32:
case TIFF_SETGET_C32_UINT64:
case TIFF_SETGET_C32_SINT64:
case TIFF_SETGET_C32_FLOAT:
case TIFF_SETGET_C32_DOUBLE:
case TIFF_SETGET_C32_IFD8:
case TIFF_SETGET_UINT8:
case TIFF_SETGET_OTHER:
default:
TIFFErrorExtR(
tif, module,
@@ -1127,6 +1175,7 @@ static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone,
(uint64_t *)tif->tif_dir.td_customValues[m].value))
goto bad;
break;
case TIFF_NOTYPE:
default:
assert(0); /* we should never get here */
break;

View File

@@ -95,6 +95,15 @@ static const char *LZMAStrerror(lzma_ret ret)
return "no progress is possible (stream is truncated or corrupt)";
case LZMA_PROG_ERROR:
return "programming error";
case LZMA_SEEK_NEEDED:
case LZMA_RET_INTERNAL1:
case LZMA_RET_INTERNAL2:
case LZMA_RET_INTERNAL3:
case LZMA_RET_INTERNAL4:
case LZMA_RET_INTERNAL5:
case LZMA_RET_INTERNAL6:
case LZMA_RET_INTERNAL7:
case LZMA_RET_INTERNAL8:
default:
return "unidentified liblzma error";
}
@@ -376,6 +385,25 @@ static int LZMAPostEncode(TIFF *tif)
ZIPPreEncode */
}
break;
case LZMA_NO_CHECK:
case LZMA_UNSUPPORTED_CHECK:
case LZMA_GET_CHECK:
case LZMA_MEM_ERROR:
case LZMA_MEMLIMIT_ERROR:
case LZMA_FORMAT_ERROR:
case LZMA_OPTIONS_ERROR:
case LZMA_DATA_ERROR:
case LZMA_BUF_ERROR:
case LZMA_PROG_ERROR:
case LZMA_SEEK_NEEDED:
case LZMA_RET_INTERNAL1:
case LZMA_RET_INTERNAL2:
case LZMA_RET_INTERNAL3:
case LZMA_RET_INTERNAL4:
case LZMA_RET_INTERNAL5:
case LZMA_RET_INTERNAL6:
case LZMA_RET_INTERNAL7:
case LZMA_RET_INTERNAL8:
default:
TIFFErrorExtR(tif, module, "Liblzma error: %s",
LZMAStrerror(ret));

View File

@@ -2248,6 +2248,8 @@ static int OJPEGReadBufferFill(OJPEGState *sp)
case osibsJpegInterchangeFormat:
sp->in_buffer_source = osibsStrile;
break;
case osibsEof:
break;
case osibsStrile:
if (sp->in_buffer_next_strile == sp->in_buffer_strile_count)
sp->in_buffer_source = osibsEof;
@@ -2628,6 +2630,8 @@ static int OJPEGWriteStreamCompressed(TIFF *tif, void **mem, uint32_t *len)
case osibsEof:
sp->out_state = ososEoi;
break;
case osibsNotSetYet:
case osibsJpegInterchangeFormat:
default:
break;
}

View File

@@ -708,6 +708,8 @@ static int TWebPPostEncode(TIFF *tif)
case VP8_ENC_ERROR_USER_ABORT:
pszErrorMsg = "User interrupted";
break;
case VP8_ENC_OK:
case VP8_ENC_ERROR_LAST:
default:
TIFFErrorExtR(tif, module,
"WebPEncode returned an unknown error code: %u",

View File

@@ -881,6 +881,23 @@ int write_test_tiff(TIFF *tif, const char *filenameRead)
pVoid = &auxInt32ArrayW[i];
deferredSetField = true;
break;
case TIFF_SETGET_UNDEFINED:
case TIFF_SETGET_UINT64:
case TIFF_SETGET_SINT64:
case TIFF_SETGET_UINT16_PAIR:
case TIFF_SETGET_C0_ASCII:
case TIFF_SETGET_C0_UINT64:
case TIFF_SETGET_C0_SINT64:
case TIFF_SETGET_C0_IFD8:
case TIFF_SETGET_C16_ASCII:
case TIFF_SETGET_C16_UINT64:
case TIFF_SETGET_C16_SINT64:
case TIFF_SETGET_C16_IFD8:
case TIFF_SETGET_C32_ASCII:
case TIFF_SETGET_C32_UINT64:
case TIFF_SETGET_C32_SINT64:
case TIFF_SETGET_C32_IFD8:
case TIFF_SETGET_OTHER:
default:
fprintf(stderr,
"SetFieldType %u not defined within writing switch for "
@@ -1795,6 +1812,25 @@ int write_test_tiff(TIFF *tif, const char *filenameRead)
case TIFF_SETGET_C32_SINT32:
deferredSetField = true;
break;
case TIFF_SETGET_UNDEFINED:
case TIFF_SETGET_UINT64:
case TIFF_SETGET_SINT64:
case TIFF_SETGET_UINT16_PAIR:
case TIFF_SETGET_C0_ASCII:
case TIFF_SETGET_C0_UINT64:
case TIFF_SETGET_C0_SINT64:
case TIFF_SETGET_C0_IFD8:
case TIFF_SETGET_C16_ASCII:
case TIFF_SETGET_C16_UINT64:
case TIFF_SETGET_C16_SINT64:
case TIFF_SETGET_C16_IFD8:
case TIFF_SETGET_C32_ASCII:
case TIFF_SETGET_C32_UINT64:
case TIFF_SETGET_C32_SINT64:
case TIFF_SETGET_C32_IFD8:
case TIFF_SETGET_OTHER:
/* Not applicable for this test */
break;
default:
fprintf(stderr,
"SetFieldType %u not defined within writing switch for "

View File

@@ -711,6 +711,52 @@ int write_test_tiff(TIFF *tif, const char *filenameRead, int blnAllCustomTags)
}
}
break;
case TIFF_SETGET_UNDEFINED:
case TIFF_SETGET_ASCII:
case TIFF_SETGET_UINT8:
case TIFF_SETGET_SINT8:
case TIFF_SETGET_UINT16:
case TIFF_SETGET_SINT16:
case TIFF_SETGET_UINT32:
case TIFF_SETGET_SINT32:
case TIFF_SETGET_UINT64:
case TIFF_SETGET_SINT64:
case TIFF_SETGET_IFD8:
case TIFF_SETGET_INT:
case TIFF_SETGET_UINT16_PAIR:
case TIFF_SETGET_C0_ASCII:
case TIFF_SETGET_C0_UINT8:
case TIFF_SETGET_C0_SINT8:
case TIFF_SETGET_C0_UINT16:
case TIFF_SETGET_C0_SINT16:
case TIFF_SETGET_C0_UINT32:
case TIFF_SETGET_C0_SINT32:
case TIFF_SETGET_C0_UINT64:
case TIFF_SETGET_C0_SINT64:
case TIFF_SETGET_C0_IFD8:
case TIFF_SETGET_C16_ASCII:
case TIFF_SETGET_C16_UINT8:
case TIFF_SETGET_C16_SINT8:
case TIFF_SETGET_C16_UINT16:
case TIFF_SETGET_C16_SINT16:
case TIFF_SETGET_C16_UINT32:
case TIFF_SETGET_C16_SINT32:
case TIFF_SETGET_C16_UINT64:
case TIFF_SETGET_C16_SINT64:
case TIFF_SETGET_C16_IFD8:
case TIFF_SETGET_C32_ASCII:
case TIFF_SETGET_C32_UINT8:
case TIFF_SETGET_C32_SINT8:
case TIFF_SETGET_C32_UINT16:
case TIFF_SETGET_C32_SINT16:
case TIFF_SETGET_C32_UINT32:
case TIFF_SETGET_C32_SINT32:
case TIFF_SETGET_C32_UINT64:
case TIFF_SETGET_C32_SINT64:
case TIFF_SETGET_C32_IFD8:
case TIFF_SETGET_OTHER:
/* Not applicable for this test */
break;
default:
fprintf(stderr,
"SetFieldType %u not defined within writing "
@@ -1306,6 +1352,52 @@ int write_test_tiff(TIFF *tif, const char *filenameRead, int blnAllCustomTags)
}
}
break;
case TIFF_SETGET_ASCII:
case TIFF_SETGET_C0_ASCII:
case TIFF_SETGET_C0_IFD8:
case TIFF_SETGET_C0_SINT16:
case TIFF_SETGET_C0_SINT32:
case TIFF_SETGET_C0_SINT64:
case TIFF_SETGET_C0_SINT8:
case TIFF_SETGET_C0_UINT16:
case TIFF_SETGET_C0_UINT32:
case TIFF_SETGET_C0_UINT64:
case TIFF_SETGET_C0_UINT8:
case TIFF_SETGET_C16_ASCII:
case TIFF_SETGET_C16_IFD8:
case TIFF_SETGET_C16_SINT16:
case TIFF_SETGET_C16_SINT32:
case TIFF_SETGET_C16_SINT64:
case TIFF_SETGET_C16_SINT8:
case TIFF_SETGET_C16_UINT16:
case TIFF_SETGET_C16_UINT32:
case TIFF_SETGET_C16_UINT64:
case TIFF_SETGET_C16_UINT8:
case TIFF_SETGET_C32_ASCII:
case TIFF_SETGET_C32_IFD8:
case TIFF_SETGET_C32_SINT16:
case TIFF_SETGET_C32_SINT32:
case TIFF_SETGET_C32_SINT64:
case TIFF_SETGET_C32_SINT8:
case TIFF_SETGET_C32_UINT16:
case TIFF_SETGET_C32_UINT32:
case TIFF_SETGET_C32_UINT64:
case TIFF_SETGET_C32_UINT8:
case TIFF_SETGET_IFD8:
case TIFF_SETGET_INT:
case TIFF_SETGET_SINT16:
case TIFF_SETGET_SINT32:
case TIFF_SETGET_SINT64:
case TIFF_SETGET_SINT8:
case TIFF_SETGET_UINT16:
case TIFF_SETGET_UINT16_PAIR:
case TIFF_SETGET_UINT32:
case TIFF_SETGET_UINT64:
case TIFF_SETGET_UINT8:
case TIFF_SETGET_UNDEFINED:
case TIFF_SETGET_OTHER:
/* Not applicable for this test */
break;
default:
fprintf(stderr,
"SetFieldType %u not defined within reading "

View File

@@ -1187,6 +1187,19 @@ int write_all_tags(TIFF *tif, const TIFFFieldArray *tFieldArray,
deferredSetField = true;
}
break;
case TIFF_SETGET_SINT64:
case TIFF_SETGET_C0_ASCII:
case TIFF_SETGET_C0_UINT64:
case TIFF_SETGET_C0_SINT64:
case TIFF_SETGET_C0_IFD8:
case TIFF_SETGET_C16_UINT64:
case TIFF_SETGET_C16_SINT64:
case TIFF_SETGET_C32_ASCII:
case TIFF_SETGET_C32_UINT64:
case TIFF_SETGET_C32_SINT64:
case TIFF_SETGET_C32_IFD8:
/* Not applicable for this test */
break;
case TIFF_SETGET_OTHER:
/* Transferfunction and Colormap to be inserted here. */
fprintf(stderr,
@@ -1246,7 +1259,7 @@ int write_all_tags(TIFF *tif, const TIFFFieldArray *tFieldArray,
}
}
}
}
} /*-- switch() --*/
} /*-- for() --*/
*iCnt = i;
@@ -1844,6 +1857,20 @@ int read_all_tags(TIFF *tif, const TIFFFieldArray *tFieldArray,
}
} /* case for all arrays */
break;
case TIFF_SETGET_UINT64:
case TIFF_SETGET_SINT64:
case TIFF_SETGET_C0_ASCII:
case TIFF_SETGET_C0_UINT64:
case TIFF_SETGET_C0_SINT64:
case TIFF_SETGET_C0_IFD8:
case TIFF_SETGET_C16_UINT64:
case TIFF_SETGET_C16_SINT64:
case TIFF_SETGET_C32_ASCII:
case TIFF_SETGET_C32_UINT64:
case TIFF_SETGET_C32_SINT64:
case TIFF_SETGET_C32_IFD8:
/* Not applicable for this test */
break;
case TIFF_SETGET_OTHER:
/* ToDo: Transferfunction and Colormap to be inserted here. */
break;

View File

@@ -392,6 +392,18 @@ static void cpTag(TIFF *in, TIFF *out, uint16_t tag, uint16_t count,
CopyField(tag, doubleav);
}
break;
case TIFF_NOTYPE:
case TIFF_BYTE:
case TIFF_SBYTE:
case TIFF_UNDEFINED:
case TIFF_SSHORT:
case TIFF_SLONG:
case TIFF_SRATIONAL:
case TIFF_FLOAT:
case TIFF_IFD:
case TIFF_LONG8:
case TIFF_SLONG8:
case TIFF_IFD8:
default:
TIFFError(TIFFFileName(in),
"Data type %u is not supported, tag %d skipped.",

View File

@@ -295,6 +295,15 @@ int main(int argc, char *argv[])
case TIFF_DOUBLE:
TIFFSetField(out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP);
break;
case TIFF_NOTYPE:
case TIFF_ASCII:
case TIFF_RATIONAL:
case TIFF_UNDEFINED:
case TIFF_SRATIONAL:
case TIFF_IFD:
case TIFF_LONG8:
case TIFF_SLONG8:
case TIFF_IFD8:
default:
TIFFSetField(out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_VOID);
break;
@@ -418,6 +427,18 @@ static void swapBytesInScanline(void *buf, uint32_t width, TIFFDataType dtype)
case TIFF_DOUBLE:
TIFFSwabArrayOfDouble((double *)buf, (unsigned long)width);
break;
case TIFF_NOTYPE:
case TIFF_BYTE:
case TIFF_ASCII:
case TIFF_SBYTE:
case TIFF_RATIONAL:
case TIFF_UNDEFINED:
case TIFF_SRATIONAL:
case TIFF_FLOAT:
case TIFF_IFD:
case TIFF_LONG8:
case TIFF_SLONG8:
case TIFF_IFD8:
default:
break;
}
@@ -582,6 +603,15 @@ static double correlation(void *buf1, void *buf2, uint32_t n_elem,
switch (dtype)
{
case TIFF_BYTE:
case TIFF_NOTYPE:
case TIFF_ASCII:
case TIFF_RATIONAL:
case TIFF_UNDEFINED:
case TIFF_SRATIONAL:
case TIFF_IFD:
case TIFF_LONG8:
case TIFF_SLONG8:
case TIFF_IFD8:
default:
for (i = 0; i < n_elem; i++)
{

View File

@@ -238,6 +238,15 @@ static void cpTag(TIFF *in, TIFF *out, uint16_t tag, uint16_t count,
CopyField(tag, ifd8);
}
break;
case TIFF_NOTYPE:
case TIFF_BYTE:
case TIFF_SBYTE:
case TIFF_UNDEFINED:
case TIFF_SSHORT:
case TIFF_SLONG:
case TIFF_SRATIONAL:
case TIFF_FLOAT:
case TIFF_IFD:
default:
TIFFError(TIFFFileName(in),
"Data type %u is not supported, tag %d skipped.",

View File

@@ -467,6 +467,18 @@ static void cpTag(TIFF *in, TIFF *out, uint16_t tag, uint16_t count,
CopyField(tag, doubleav);
}
break;
case TIFF_NOTYPE:
case TIFF_BYTE:
case TIFF_SBYTE:
case TIFF_UNDEFINED:
case TIFF_SSHORT:
case TIFF_SLONG:
case TIFF_SRATIONAL:
case TIFF_FLOAT:
case TIFF_IFD:
case TIFF_LONG8:
case TIFF_SLONG8:
case TIFF_IFD8:
default:
TIFFError(TIFFFileName(in),
"Data type %u is not supported, tag %u skipped.",

View File

@@ -6114,6 +6114,8 @@ tsize_t t2p_write_pdf_xobject_stream_filter(ttile_t tile, T2P *t2p,
add_t2pWriteFile_check(output, (tdata_t) "/Filter ", 8, mod, written);
switch (t2p->pdf_compression)
{
case T2P_COMPRESS_NONE:
break;
#ifdef CCITT_SUPPORT
case T2P_COMPRESS_G4:
add_t2pWriteFile_check(output, (tdata_t) "/CCITTFaxDecode ", 16,

View File

@@ -776,6 +776,18 @@ static void cpTag(TIFF *in, TIFF *out, uint16_t tag, uint16_t count,
CopyField(tag, doubleav);
}
break;
case TIFF_NOTYPE:
case TIFF_BYTE:
case TIFF_SBYTE:
case TIFF_UNDEFINED:
case TIFF_SSHORT:
case TIFF_SLONG:
case TIFF_SRATIONAL:
case TIFF_FLOAT:
case TIFF_IFD:
case TIFF_LONG8:
case TIFF_SLONG8:
case TIFF_IFD8:
default:
TIFFError(TIFFFileName(in),
"Data type %u is not supported, tag %u skipped.",

View File

@@ -1793,6 +1793,18 @@ static void cpTag(TIFF *in, TIFF *out, uint16_t tag, uint16_t count,
CopyField(tag, doubleav);
}
break;
case TIFF_NOTYPE:
case TIFF_BYTE:
case TIFF_SBYTE:
case TIFF_UNDEFINED:
case TIFF_SSHORT:
case TIFF_SLONG:
case TIFF_SRATIONAL:
case TIFF_FLOAT:
case TIFF_IFD:
case TIFF_LONG8:
case TIFF_SLONG8:
case TIFF_IFD8:
default:
TIFFError(TIFFFileName(in),
"Data type %u is not supported, tag %u skipped",

View File

@@ -256,7 +256,6 @@ int main(int argc, char *argv[])
case TIFF_ASCII:
case TIFF_SBYTE:
case TIFF_UNDEFINED:
default:
size = 1;
break;
@@ -280,6 +279,10 @@ int main(int argc, char *argv[])
case TIFF_DOUBLE:
size = 8;
break;
case TIFF_NOTYPE:
default:
size = 1;
break;
}
array = limitMalloc((tmsize_t)wc * size);
@@ -345,6 +348,9 @@ int main(int argc, char *argv[])
((float *)array)[i] =
(float)atof(argv[arg_index + i]);
break;
case TIFF_NOTYPE:
case TIFF_ASCII:
case TIFF_UNDEFINED:
default:
break;
}
@@ -412,6 +418,9 @@ int main(int argc, char *argv[])
ret = TIFFSetField(tiff, TIFFFieldTag(fip),
(float)atof(argv[arg_index++]));
break;
case TIFF_NOTYPE:
case TIFF_ASCII:
case TIFF_UNDEFINED:
default:
break;
}