Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid LTO issues (backport #2681) #2684

Merged
merged 1 commit into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/minoltamn_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1649,23 +1649,23 @@ static std::ostream& resolveLens0xffff(std::ostream& os, const Value& value, con
return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
}

//! List of lens ids which require special treatment from printMinoltaSonyLensID
constexpr struct LensIdFct {
uint32_t idx;
PrintFct fct;
std::ostream& printMinoltaSonyLensID(std::ostream& os, const Value& value, const ExifData* metadata) {
//! List of lens ids which require special treatment from printMinoltaSonyLensID
static constexpr struct LensIdFct {
uint32_t idx;
PrintFct fct;

bool operator==(uint32_t i) const {
return i == idx;
}
} lensIdFct[] = {
{0x001cu, &resolveLens0x1c}, {0x0029u, &resolveLens0x29}, {0x0034u, &resolveLens0x34},
{0x0080u, &resolveLens0x80}, {0x00ffu, &resolveLens0xff}, {0xffffu, &resolveLens0xffff},
//{0x00ffu, &resolveLensTypeUsingExiftool}, // was used for debugging
};
// #1145 end - respect lenses with shared LensID
// ----------------------------------------------------------------------
bool operator==(uint32_t i) const {
return i == idx;
}
} lensIdFct[] = {
{0x001cu, &resolveLens0x1c}, {0x0029u, &resolveLens0x29}, {0x0034u, &resolveLens0x34},
{0x0080u, &resolveLens0x80}, {0x00ffu, &resolveLens0xff}, {0xffffu, &resolveLens0xffff},
//{0x00ffu, &resolveLensTypeUsingExiftool}, // was used for debugging
};
// #1145 end - respect lenses with shared LensID
// ----------------------------------------------------------------------

std::ostream& printMinoltaSonyLensID(std::ostream& os, const Value& value, const ExifData* metadata) {
// #1034
const std::string undefined("undefined");
const std::string minolta("minolta");
Expand Down
31 changes: 14 additions & 17 deletions src/pentaxmn_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1231,25 +1231,22 @@ static std::ostream& resolveLensType(std::ostream& os, const Value& value, const
return EXV_PRINT_COMBITAG_MULTI(pentaxLensType, 2, 1, 2)(os, value, metadata);
}

struct LensIdFct {
long id_; //!< Lens id
PrintFct fct_; //!< Pretty-print function
//! Comparison operator for find template
bool operator==(long id) const {
return id_ == id;
}
};

//! List of lens ids which require special treatment using resolveLensType
constexpr LensIdFct lensIdFct[] = {
{0x0317, resolveLensType}, {0x0319, resolveLens0x319}, {0x031b, resolveLensType}, {0x031c, resolveLensType},
{0x031d, resolveLensType}, {0x031f, resolveLensType}, {0x0329, resolveLensType}, {0x032c, resolveLens0x32c},
{0x032e, resolveLensType}, {0x0334, resolveLensType}, {0x03ff, resolveLens0x3ff}, {0x041a, resolveLensType},
{0x042d, resolveLensType}, {0x08ff, resolveLens0x8ff},
};

//! A lens id and a pretty-print function for special treatment of the id.
static std::ostream& printLensType(std::ostream& os, const Value& value, const ExifData* metadata) {
//! List of lens ids which require special treatment using resolveLensType
static constexpr struct LensIdFct {
uint32_t id_; //!< Lens id
PrintFct fct_; //!< Pretty-print function
//! Comparison operator for find template
bool operator==(uint32_t id) const {
return id_ == id;
}
} lensIdFct[] = {
{0x0317, resolveLensType}, {0x0319, resolveLens0x319}, {0x031b, resolveLensType}, {0x031c, resolveLensType},
{0x031d, resolveLensType}, {0x031f, resolveLensType}, {0x0329, resolveLensType}, {0x032c, resolveLens0x32c},
{0x032e, resolveLensType}, {0x0334, resolveLensType}, {0x03ff, resolveLens0x3ff}, {0x041a, resolveLensType},
{0x042d, resolveLensType}, {0x08ff, resolveLens0x8ff},
};
// #1034
const std::string undefined("undefined");
const std::string section("pentax");
Expand Down