Qualify some std integer types

This commit is contained in:
Lawrence Lee
2022-09-08 23:14:16 -07:00
parent 4b97a5cf3c
commit aa02ee8c49
2 changed files with 12 additions and 12 deletions

View File

@@ -602,7 +602,7 @@ FrameData::FrameData(rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
// ----------------------- Special file type detection (HDR, PixelShift) ------------------------ // ----------------------- Special file type detection (HDR, PixelShift) ------------------------
uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0, photometric = 0, compression = 0; std::uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0, photometric = 0, compression = 0;
const rtexif::Tag* const bps = frameRootDir->findTag("BitsPerSample"); const rtexif::Tag* const bps = frameRootDir->findTag("BitsPerSample");
const rtexif::Tag* const spp = frameRootDir->findTag("SamplesPerPixel"); const rtexif::Tag* const spp = frameRootDir->findTag("SamplesPerPixel");
const rtexif::Tag* const sf = frameRootDir->findTag("SampleFormat"); const rtexif::Tag* const sf = frameRootDir->findTag("SampleFormat");

View File

@@ -665,7 +665,7 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s
return IMIO_CANNOTREADFILE; return IMIO_CANNOTREADFILE;
} }
uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0; std::uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0;
int hasTag = TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); int hasTag = TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample);
hasTag &= TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); hasTag &= TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
@@ -690,7 +690,7 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s
sampleformat = SAMPLEFORMAT_UINT; sampleformat = SAMPLEFORMAT_UINT;
} }
uint16_t config; std::uint16_t config;
TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config); TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config);
if (config == PLANARCONFIG_CONTIG) { if (config == PLANARCONFIG_CONTIG) {
@@ -702,14 +702,14 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s
return IMIO_VARIANTNOTSUPPORTED; return IMIO_VARIANTNOTSUPPORTED;
} }
uint16_t photometric; std::uint16_t photometric;
if (!TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &photometric)) { if (!TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &photometric)) {
TIFFClose(in); TIFFClose(in);
return IMIO_VARIANTNOTSUPPORTED; return IMIO_VARIANTNOTSUPPORTED;
} }
uint16_t compression; std::uint16_t compression;
if (photometric == PHOTOMETRIC_LOGLUV) if (photometric == PHOTOMETRIC_LOGLUV)
if (!TIFFGetField(in, TIFFTAG_COMPRESSION, &compression)) { if (!TIFFGetField(in, TIFFTAG_COMPRESSION, &compression)) {
@@ -787,7 +787,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname)
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width); TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height); TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
uint16_t bitspersample, samplesperpixel; std::uint16_t bitspersample, samplesperpixel;
int hasTag = TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); int hasTag = TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample);
hasTag &= TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); hasTag &= TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
@@ -799,7 +799,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname)
return IMIO_VARIANTNOTSUPPORTED; return IMIO_VARIANTNOTSUPPORTED;
} }
uint16_t config; std::uint16_t config;
TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config); TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config);
if (config != PLANARCONFIG_CONTIG) { if (config != PLANARCONFIG_CONTIG) {
@@ -820,7 +820,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname)
*/ */
if (settings->verbose) { if (settings->verbose) {
printf("Information of \"%s\":\n", fname.c_str()); printf("Information of \"%s\":\n", fname.c_str());
uint16_t tiffDefaultScale, tiffBaselineExposure, tiffLinearResponseLimit; std::uint16_t tiffDefaultScale, tiffBaselineExposure, tiffLinearResponseLimit;
if (TIFFGetField(in, TIFFTAG_DEFAULTSCALE, &tiffDefaultScale)) { if (TIFFGetField(in, TIFFTAG_DEFAULTSCALE, &tiffDefaultScale)) {
printf(" DefaultScale: %d\n", tiffDefaultScale); printf(" DefaultScale: %d\n", tiffDefaultScale);
} }
@@ -837,7 +837,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname)
else else
printf(" No LinearResponseLimit value!\n"); printf(" No LinearResponseLimit value!\n");
uint16_t tiffMinValue, tiffMaxValue; std::uint16_t tiffMinValue, tiffMaxValue;
if (TIFFGetField(in, TIFFTAG_SMINSAMPLEVALUE, &tiffMinValue)) { if (TIFFGetField(in, TIFFTAG_SMINSAMPLEVALUE, &tiffMinValue)) {
printf(" MinValue: %d\n", tiffMinValue); printf(" MinValue: %d\n", tiffMinValue);
} }
@@ -1557,15 +1557,15 @@ int ImageIO::saveTIFF (const Glib::ustring &fname, int bps, bool isFloat, bool u
*/ */
if (applyExifPatch) { if (applyExifPatch) {
unsigned char b[10]; unsigned char b[10];
uint16_t tagCount = 0; std::uint16_t tagCount = 0;
lseek(fileno, 4, SEEK_SET); lseek(fileno, 4, SEEK_SET);
read(fileno, b, 4); read(fileno, b, 4);
uint32_t ifd0Offset = rtexif::sget4(b, exifRoot->getOrder()); std::uint32_t ifd0Offset = rtexif::sget4(b, exifRoot->getOrder());
lseek(fileno, ifd0Offset, SEEK_SET); lseek(fileno, ifd0Offset, SEEK_SET);
read(fileno, b, 2); read(fileno, b, 2);
tagCount = rtexif::sget2(b, exifRoot->getOrder()); tagCount = rtexif::sget2(b, exifRoot->getOrder());
for (size_t i = 0; i < tagCount ; ++i) { for (size_t i = 0; i < tagCount ; ++i) {
uint16_t tagID = 0; std::uint16_t tagID = 0;
read(fileno, b, 2); read(fileno, b, 2);
tagID = rtexif::sget2(b, exifRoot->getOrder()); tagID = rtexif::sget2(b, exifRoot->getOrder());
if (tagID == 0x8769) { if (tagID == 0x8769) {