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

small cleanups #2935

Merged
merged 2 commits into from
Mar 26, 2024
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
8 changes: 4 additions & 4 deletions include/exiv2/slice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ struct ContainerStorage {
using iterator = typename container::iterator;
using const_iterator = typename container::const_iterator;

#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L))
#ifdef __cpp_lib_type_trait_variable_templates
using value_type = std::remove_cv_t<typename container::value_type>;
#else
using value_type = typename std::remove_cv<typename container::value_type>::type;
Expand Down Expand Up @@ -320,7 +320,7 @@ struct ContainerStorage {
*/
template <typename storage_type>
struct PtrSliceStorage {
#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L))
#ifdef __cpp_lib_type_trait_variable_templates
using value_type = std::remove_cv_t<std::remove_pointer_t<storage_type>>;
#else
using value_type = typename std::remove_cv<typename std::remove_pointer<storage_type>::type>::type;
Expand Down Expand Up @@ -423,7 +423,7 @@ struct Slice : public Internal::MutableSliceBase<Internal::ContainerStorage, con
using iterator = typename container::iterator;
using const_iterator = typename container::const_iterator;

#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L))
#ifdef __cpp_lib_type_trait_variable_templates
using value_type = std::remove_cv_t<typename container::value_type>;
#else
using value_type = typename std::remove_cv<typename container::value_type>::type;
Expand Down Expand Up @@ -460,7 +460,7 @@ struct Slice<const container> : public Internal::ConstSliceBase<Internal::Contai
using iterator = typename container::iterator;
using const_iterator = typename container::const_iterator;

#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L))
#ifdef __cpp_lib_type_trait_variable_templates
using value_type = std::remove_cv_t<typename container::value_type>;
#else
using value_type = typename std::remove_cv<typename container::value_type>::type;
Expand Down
4 changes: 2 additions & 2 deletions include/exiv2/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ class ValueType : public Value {
} else if (std::is_signed<I>::value) {
#endif
// conversion is from unsigned to signed
#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L))
#ifdef __cpp_lib_type_trait_variable_templates
const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
#else
const auto imax = static_cast<typename std::make_unsigned<I>::type>(std::numeric_limits<I>::max());
Expand All @@ -1269,7 +1269,7 @@ class ValueType : public Value {
return 0;
}
// Inputs are not negative so convert them to unsigned.
#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L))
#ifdef __cpp_lib_type_trait_variable_templates
const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
#else
Expand Down
2 changes: 1 addition & 1 deletion src/makernote_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ int sony2FpSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/, Ti
// Not valid for models beginning
std::string model = getExifModel(pRoot);
const std::array strs{"SLT-", "HV", "ILCA-"};
return std::any_of(strs.begin(), strs.end(), [&model](auto& m) { return startsWith(model, m); }) ? -1 : 0;
return std::any_of(strs.begin(), strs.end(), [&model](auto m) { return startsWith(model, m); }) ? -1 : 0;
}

int sonyMisc2bSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/, TiffComponent* pRoot) {
Expand Down