Skip to content
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
3 changes: 2 additions & 1 deletion sources/lite_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ namespace
explicit AESSIVBasedNameTranslator(const key_type& name_master_key)
: name_master_key_(name_master_key)
, name_aes_siv_(
[this]() {
[this]()
{
return std::make_unique<AES_SIV>(name_master_key_.data(),
name_master_key_.size());
})
Expand Down
6 changes: 4 additions & 2 deletions sources/lite_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ class StreamOpener : public lite::AESGCMCryptStream::ParamCalculator
, max_padding_size_(max_padding_size)
, verify_(verify)
, content_ecb(
[this]() {
[this]()
{
return std::make_unique<AES_ECB>(content_master_key_.data(),
content_master_key_.size());
})
, padding_ecb(
[this]() {
[this]()
{
return std::make_unique<AES_ECB>(padding_master_key_.data(),
padding_master_key_.size());
})
Expand Down
10 changes: 5 additions & 5 deletions sources/stat_workaround.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace securefs
#define GENERATE_TIME_HELPER(PREFIX) \
template <typename Stat> \
constexpr inline auto has_##PREFIX##tim(std::nullptr_t) \
->decltype(std::declval<Stat>().st_##PREFIX##tim, true) \
-> decltype(std::declval<Stat>().st_##PREFIX##tim, true) \
{ \
return true; \
} \
Expand Down Expand Up @@ -54,8 +54,8 @@ GENERATE_TIME_HELPER(c)
#undef GENERATE_TIME_HELPER

template <typename Stat>
constexpr inline auto has_birthtim(std::nullptr_t) -> decltype(std::declval<Stat>().st_birthtim,
true)
constexpr inline auto has_birthtim(std::nullptr_t)
-> decltype(std::declval<Stat>().st_birthtim, true)
{
return true;
}
Expand All @@ -67,8 +67,8 @@ constexpr inline auto has_birthtim(...)
}

template <typename Stat>
constexpr inline auto
has_birthtimespec(std::nullptr_t) -> decltype(std::declval<Stat>().st_birthtimespec, true)
constexpr inline auto has_birthtimespec(std::nullptr_t)
-> decltype(std::declval<Stat>().st_birthtimespec, true)
{
return true;
}
Expand Down
39 changes: 18 additions & 21 deletions sources/tags.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,68 +68,65 @@ struct StrongType

// Arithmetic operators
template <typename U = T>
auto operator+(const StrongType& other) const -> decltype(std::declval<U>() + std::declval<U>(),
StrongType(std::declval<U>()))
auto operator+(const StrongType& other) const
-> decltype(std::declval<U>() + std::declval<U>(), StrongType(std::declval<U>()))
{
return StrongType(value + other.value);
}

template <typename U = T>
auto operator-(const StrongType& other) const -> decltype(std::declval<U>() - std::declval<U>(),
StrongType(std::declval<U>()))
auto operator-(const StrongType& other) const
-> decltype(std::declval<U>() - std::declval<U>(), StrongType(std::declval<U>()))
{
return StrongType(value - other.value);
}

template <typename U = T>
auto operator*(const StrongType& other) const -> decltype(std::declval<U>() * std::declval<U>(),
StrongType(std::declval<U>()))
auto operator*(const StrongType& other) const
-> decltype(std::declval<U>() * std::declval<U>(), StrongType(std::declval<U>()))
{
return StrongType(value * other.value);
}

template <typename U = T>
auto operator/(const StrongType& other) const -> decltype(std::declval<U>() / std::declval<U>(),
StrongType(std::declval<U>()))
auto operator/(const StrongType& other) const
-> decltype(std::declval<U>() / std::declval<U>(), StrongType(std::declval<U>()))
{
return StrongType(value / other.value);
}

// Comparison operators
template <typename U = T>
auto operator<(const StrongType& other) const -> decltype(std::declval<U>() < std::declval<U>(),
bool())
auto operator<(const StrongType& other) const
-> decltype(std::declval<U>() < std::declval<U>(), bool())
{
return value < other.value;
}

template <typename U = T>
auto operator>(const StrongType& other) const -> decltype(std::declval<U>() > std::declval<U>(),
bool())
auto operator>(const StrongType& other) const
-> decltype(std::declval<U>() > std::declval<U>(), bool())
{
return value > other.value;
}

template <typename U = T>
auto operator==(const StrongType& other) const -> decltype(std::declval<U>()
== std::declval<U>(),
bool())
auto operator==(const StrongType& other) const
-> decltype(std::declval<U>() == std::declval<U>(), bool())
{
return value == other.value;
}

template <typename U = T>
auto operator<=(const StrongType& other) const -> decltype(std::declval<U>()
<= std::declval<U>(),
bool())
auto operator<=(const StrongType& other) const
-> decltype(std::declval<U>() <= std::declval<U>(), bool())
{
return value <= other.value;
}

template <typename U = T>
auto operator>=(const StrongType& other) const -> decltype(std::declval<U>()
>= std::declval<U>(),
bool())
auto operator>=(const StrongType& other) const
-> decltype(std::declval<U>() >= std::declval<U>(), bool())
{
return value >= other.value;
}
Expand Down