remove MSVC hacks

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2023-03-12 17:51:50 -07:00
parent dc196e729e
commit 2fd523873b
3 changed files with 20 additions and 22 deletions

View File

@ -214,7 +214,6 @@ std::ostream& printTagBitmask(std::ostream& os, const Value& value, const ExifDa
}
bool sep = false;
for (size_t i = 0; i < N; ++i) {
// *& acrobatics is a workaround for a MSVC 7.1 bug
auto [mask, label] = *(array + i);
if (val & mask) {
@ -270,7 +269,6 @@ std::ostream& printTagBitlistAllLE(std::ostream& os, const Value& value, const E
// Check to see if the numbered bit is found in the array
for (size_t k = lastArrayPos; k < N; ++k) {
// *& acrobatics is a workaround for a MSVC 7.1 bug
auto [bit, label] = *(array + k);
if (currentVNBit == bit) {

View File

@ -1530,9 +1530,9 @@ TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
}
//! Function to create and initialize a new binary array entry
template <const ArrayCfg& arrayCfg, size_t N, const ArrayDef arrayDef[N]>
template <const ArrayCfg& arrayCfg, size_t N, const ArrayDef (&arrayDef)[N]>
TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, &(*arrayDef), N);
return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
}
//! Function to create and initialize a new simple binary array entry
@ -1542,9 +1542,9 @@ TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
}
//! Function to create and initialize a new complex binary array entry
template <const ArraySet* arraySet, size_t N, CfgSelFct cfgSelFct>
template <size_t N, const ArraySet (&arraySet)[N], CfgSelFct cfgSelFct>
TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
return std::make_unique<TiffBinaryArray>(tag, group, &(*arraySet), N, cfgSelFct);
return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
}
//! Function to create and initialize a new TIFF entry for a thumbnail (data)

View File

@ -14,7 +14,7 @@
// Shortcuts for the newTiffBinaryArray templates.
#define EXV_BINARY_ARRAY(arrayCfg, arrayDef) (newTiffBinaryArray0<arrayCfg, std::size(arrayDef), arrayDef>)
#define EXV_SIMPLE_BINARY_ARRAY(arrayCfg) (newTiffBinaryArray1<arrayCfg>)
#define EXV_COMPLEX_BINARY_ARRAY(arraySet, cfgSelFct) (newTiffBinaryArray2<arraySet, std::size(arraySet), cfgSelFct>)
#define EXV_COMPLEX_BINARY_ARRAY(arraySet, cfgSelFct) (newTiffBinaryArray2<std::size(arraySet), arraySet, cfgSelFct>)
namespace Exiv2::Internal {
//! Constant for non-encrypted binary arrays
@ -1725,12 +1725,12 @@ const TiffGroupTable TiffCreator::tiffGroupTable_ = {
{{0x0024, IfdId::nikon3Id}, EXV_BINARY_ARRAY(nikonWtCfg, nikonWtDef)},
{{0x0025, IfdId::nikon3Id}, EXV_BINARY_ARRAY(nikonIiCfg, nikonIiDef)},
{{0x0088, IfdId::nikon3Id}, EXV_BINARY_ARRAY(nikonAfCfg, nikonAfDef)},
{{0x0091, IfdId::nikon3Id}, EXV_COMPLEX_BINARY_ARRAY(nikonSiSet, nikonSelector)},
{{0x0097, IfdId::nikon3Id}, EXV_COMPLEX_BINARY_ARRAY(nikonCbSet, nikonSelector)},
{{0x0098, IfdId::nikon3Id}, EXV_COMPLEX_BINARY_ARRAY(nikonLdSet, nikonSelector)},
{{0x00a8, IfdId::nikon3Id}, EXV_COMPLEX_BINARY_ARRAY(nikonFlSet, nikonSelector)},
{{0x0091, IfdId::nikon3Id}, EXV_COMPLEX_BINARY_ARRAY(nikonSiSet, &nikonSelector)},
{{0x0097, IfdId::nikon3Id}, EXV_COMPLEX_BINARY_ARRAY(nikonCbSet, &nikonSelector)},
{{0x0098, IfdId::nikon3Id}, EXV_COMPLEX_BINARY_ARRAY(nikonLdSet, &nikonSelector)},
{{0x00a8, IfdId::nikon3Id}, EXV_COMPLEX_BINARY_ARRAY(nikonFlSet, &nikonSelector)},
{{0x00b0, IfdId::nikon3Id}, EXV_BINARY_ARRAY(nikonMeCfg, nikonMeDef)},
{{0x00b7, IfdId::nikon3Id}, EXV_COMPLEX_BINARY_ARRAY(nikonAf2Set, nikonSelector)},
{{0x00b7, IfdId::nikon3Id}, EXV_COMPLEX_BINARY_ARRAY(nikonAf2Set, &nikonSelector)},
{{0x00b8, IfdId::nikon3Id}, EXV_BINARY_ARRAY(nikonFiCfg, nikonFiDef)},
{{0x00b9, IfdId::nikon3Id}, EXV_BINARY_ARRAY(nikonAFTCfg, nikonAFTDef)},
{{Tag::all, IfdId::nikon3Id}, &newTiffEntry},
@ -1834,19 +1834,19 @@ const TiffGroupTable TiffCreator::tiffGroupTable_ = {
{{Tag::all, IfdId::sigmaId}, &newTiffEntry},
{{Tag::all, IfdId::sony2010eId}, &newTiffBinaryElement},
{{0x2010, IfdId::sony1Id}, EXV_COMPLEX_BINARY_ARRAY(sony2010eSet, sony2010eSelector)},
{{0x2010, IfdId::sony1Id}, EXV_COMPLEX_BINARY_ARRAY(sony2010eSet, &sony2010eSelector)},
// Tag 0x9402 Sony2Fp Focus Position
{{Tag::all, IfdId::sony2FpId}, &newTiffBinaryElement},
{{0x9402, IfdId::sony1Id}, EXV_COMPLEX_BINARY_ARRAY(sony2FpSet, sony2FpSelector)},
{{0x9402, IfdId::sony1Id}, EXV_COMPLEX_BINARY_ARRAY(sony2FpSet, &sony2FpSelector)},
// Tag 0x9404 SonyMisc2b
{{Tag::all, IfdId::sonyMisc2bId}, &newTiffBinaryElement},
{{0x9404, IfdId::sony1Id}, EXV_COMPLEX_BINARY_ARRAY(sonyMisc2bSet, sonyMisc2bSelector)},
{{0x9404, IfdId::sony1Id}, EXV_COMPLEX_BINARY_ARRAY(sonyMisc2bSet, &sonyMisc2bSelector)},
// Tag 0x9400 SonyMisc3c
{{Tag::all, IfdId::sonyMisc3cId}, &newTiffBinaryElement},
{{0x9400, IfdId::sony1Id}, EXV_COMPLEX_BINARY_ARRAY(sonyMisc3cSet, sonyMisc3cSelector)},
{{0x9400, IfdId::sony1Id}, EXV_COMPLEX_BINARY_ARRAY(sonyMisc3cSet, &sonyMisc3cSelector)},
// Tag 0x9403 SonyMisc1
{{Tag::all, IfdId::sonyMisc1Id}, &newTiffBinaryElement},
@ -1857,7 +1857,7 @@ const TiffGroupTable TiffCreator::tiffGroupTable_ = {
{{0x3000, IfdId::sony1Id}, EXV_BINARY_ARRAY(sonySInfo1Cfg, sonySInfo1Def)},
// Sony1 makernote
{{0x0114, IfdId::sony1Id}, EXV_COMPLEX_BINARY_ARRAY(sony1CsSet, sonyCsSelector)},
{{0x0114, IfdId::sony1Id}, EXV_COMPLEX_BINARY_ARRAY(sony1CsSet, &sonyCsSelector)},
{{0xb028, IfdId::sony1Id}, &newTiffSubIfd<IfdId::sonyMltId>},
{{Tag::next, IfdId::sony1Id}, ignoreTiffComponent},
{{Tag::all, IfdId::sony1Id}, &newTiffEntry},
@ -1867,11 +1867,11 @@ const TiffGroupTable TiffCreator::tiffGroupTable_ = {
{{Tag::all, IfdId::sony1Cs2Id}, &newTiffBinaryElement},
{{Tag::all, IfdId::sony2010eId}, &newTiffBinaryElement},
{{0x2010, IfdId::sony2Id}, EXV_COMPLEX_BINARY_ARRAY(sony2010eSet, sony2010eSelector)},
{{0x2010, IfdId::sony2Id}, EXV_COMPLEX_BINARY_ARRAY(sony2010eSet, &sony2010eSelector)},
// Tag 0x9402 Sony2Fp Focus Position
{{Tag::all, IfdId::sony2FpId}, &newTiffBinaryElement},
{{0x9402, IfdId::sony2Id}, EXV_COMPLEX_BINARY_ARRAY(sony2FpSet, sony2FpSelector)},
{{0x9402, IfdId::sony2Id}, EXV_COMPLEX_BINARY_ARRAY(sony2FpSet, &sony2FpSelector)},
// Tag 0x9403 SonyMisc1
{{Tag::all, IfdId::sonyMisc1Id}, &newTiffBinaryElement},
@ -1879,18 +1879,18 @@ const TiffGroupTable TiffCreator::tiffGroupTable_ = {
// Tag 0x9404 SonyMisc2b
{{Tag::all, IfdId::sonyMisc2bId}, &newTiffBinaryElement},
{{0x9404, IfdId::sony2Id}, EXV_COMPLEX_BINARY_ARRAY(sonyMisc2bSet, sonyMisc2bSelector)},
{{0x9404, IfdId::sony2Id}, EXV_COMPLEX_BINARY_ARRAY(sonyMisc2bSet, &sonyMisc2bSelector)},
// Tag 0x9400 SonyMisc3c
{{Tag::all, IfdId::sonyMisc3cId}, &newTiffBinaryElement},
{{0x9400, IfdId::sony2Id}, EXV_COMPLEX_BINARY_ARRAY(sonyMisc3cSet, sonyMisc3cSelector)},
{{0x9400, IfdId::sony2Id}, EXV_COMPLEX_BINARY_ARRAY(sonyMisc3cSet, &sonyMisc3cSelector)},
// Tag 0x3000 SonySInfo1
{{Tag::all, IfdId::sonySInfo1Id}, &newTiffBinaryElement},
{{0x3000, IfdId::sony2Id}, EXV_BINARY_ARRAY(sonySInfo1Cfg, sonySInfo1Def)},
// Sony2 makernote
{{0x0114, IfdId::sony2Id}, EXV_COMPLEX_BINARY_ARRAY(sony2CsSet, sonyCsSelector)},
{{0x0114, IfdId::sony2Id}, EXV_COMPLEX_BINARY_ARRAY(sony2CsSet, &sonyCsSelector)},
{{Tag::next, IfdId::sony2Id}, ignoreTiffComponent},
{{Tag::all, IfdId::sony2Id}, &newTiffEntry},