Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlaine committed Dec 29, 2022
1 parent 44547ae commit 4286513
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION

This software incorporates components from the projects listed below. The original copyright notices
and the licenses under which Microsoft received such components are set forth below and are provided for
informational purposes only. Microsoft reserves all rights not expressly granted herein, whether by
and the licenses under which Microsoft received such components are set forth below and are provided for
informational purposes only. Microsoft reserves all rights not expressly granted herein, whether by
implication, estoppel or otherwise.

This software includes parts of the BLAKE2 library (https://github.com/BLAKE2/BLAKE2).
Expand Down
2 changes: 1 addition & 1 deletion native/examples/4_bgv_basics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,4 @@ void example_bgv_basics()
rate of noise budget in an application, one needs to carefully choose the
location to insert modulus switching and manually choose coeff_modulus.
*/
}
}
2 changes: 1 addition & 1 deletion native/src/seal/c/modulus.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ SEAL_C_FUNC CoeffModulus_BFVDefault(uint64_t poly_modulus_degree, int sec_level,
SEAL_C_FUNC CoeffModulus_Create1(uint64_t poly_modulus_degree, uint64_t length, int *bit_sizes, void **coeffs);

SEAL_C_FUNC CoeffModulus_Create2(
uint64_t poly_modulus_degree, uint64_t length, int *bit_sizes, void *plain_modulus, void **coeffs);
uint64_t poly_modulus_degree, uint64_t length, int *bit_sizes, void *plain_modulus, void **coeffs);
2 changes: 1 addition & 1 deletion native/src/seal/memorymanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ namespace seal
instructions to the memory manager profile for internal logic.
*/
template <typename... Args>
SEAL_NODISCARD static inline MemoryPoolHandle GetPool(mm_prof_opt_t prof_opt, Args &&...args)
SEAL_NODISCARD static inline MemoryPoolHandle GetPool(mm_prof_opt_t prof_opt, Args &&... args)
{
switch (prof_opt)
{
Expand Down
12 changes: 6 additions & 6 deletions native/src/seal/util/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ namespace seal
}

template <typename T, typename... Args, typename = std::enable_if_t<std::is_integral<T>::value>>
SEAL_NODISCARD inline constexpr T mul_safe(T in1, T in2, Args &&...args)
SEAL_NODISCARD inline constexpr T mul_safe(T in1, T in2, Args &&... args)
{
return mul_safe(mul_safe(in1, in2), mul_safe(std::forward<Args>(args)...));
}
Expand Down Expand Up @@ -214,7 +214,7 @@ namespace seal
}

template <typename T, typename... Args, typename = std::enable_if_t<std::is_arithmetic<T>::value>>
SEAL_NODISCARD inline constexpr T add_safe(T in1, T in2, Args &&...args)
SEAL_NODISCARD inline constexpr T add_safe(T in1, T in2, Args &&... args)
{
return add_safe(add_safe(in1, in2), add_safe(std::forward<Args>(args)...));
}
Expand Down Expand Up @@ -318,25 +318,25 @@ namespace seal
}

template <typename T, typename... Args, typename = std::enable_if_t<std::is_arithmetic<T>::value>>
SEAL_NODISCARD inline constexpr bool sum_fits_in(Args &&...args)
SEAL_NODISCARD inline constexpr bool sum_fits_in(Args &&... args)
{
return fits_in<T>(add_safe(std::forward<Args>(args)...));
}

template <typename T, typename... Args, typename = std::enable_if_t<std::is_arithmetic<T>::value>>
SEAL_NODISCARD inline constexpr bool sum_fits_in(T in1, Args &&...args)
SEAL_NODISCARD inline constexpr bool sum_fits_in(T in1, Args &&... args)
{
return fits_in<T>(add_safe(in1, std::forward<Args>(args)...));
}

template <typename T, typename... Args, typename = std::enable_if_t<std::is_arithmetic<T>::value>>
SEAL_NODISCARD inline constexpr bool product_fits_in(Args &&...args)
SEAL_NODISCARD inline constexpr bool product_fits_in(Args &&... args)
{
return fits_in<T>(mul_safe(std::forward<Args>(args)...));
}

template <typename T, typename... Args, typename = std::enable_if_t<std::is_arithmetic<T>::value>>
SEAL_NODISCARD inline constexpr bool product_fits_in(T in1, Args &&...args)
SEAL_NODISCARD inline constexpr bool product_fits_in(T in1, Args &&... args)
{
return fits_in<T>(mul_safe(in1, std::forward<Args>(args)...));
}
Expand Down
10 changes: 5 additions & 5 deletions native/src/seal/util/iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ namespace seal
template <typename... Ts>
IterTuple(const std::tuple<Ts...> &tp)
: IterTuple(seal_apply(
[](auto &&...args) -> IterTuple { return { std::forward<decltype(args)>(args)... }; },
[](auto &&... args) -> IterTuple { return { std::forward<decltype(args)>(args)... }; },
std::forward<decltype(tp)>(tp)))
{
static_assert(
Expand All @@ -1855,7 +1855,7 @@ namespace seal
template <typename... Ts>
IterTuple(std::tuple<Ts...> &&tp)
: IterTuple(seal_apply(
[](auto &&...args) -> IterTuple && { return { std::forward<decltype(args)>(args)... }; },
[](auto &&... args) -> IterTuple && { return { std::forward<decltype(args)>(args)... }; },
std::forward<decltype(tp)>(tp)))
{
static_assert(
Expand All @@ -1869,7 +1869,7 @@ namespace seal
SEAL_NODISCARD inline value_type operator*() const noexcept
{
return seal_apply(
[this](auto &&...args) -> value_type {
[this](auto &&... args) -> value_type {
return { *first_, std::forward<decltype(args)>(args)... };
},
*rest_);
Expand Down Expand Up @@ -2281,13 +2281,13 @@ namespace seal
}

template <typename... Ts>
SEAL_NODISCARD inline auto iter(Ts &&...ts) noexcept -> typename iterator_internal::IterType<void, Ts...>::type
SEAL_NODISCARD inline auto iter(Ts &&... ts) noexcept -> typename iterator_internal::IterType<void, Ts...>::type
{
return { std::forward<Ts>(ts)... };
}

template <typename... Ts>
SEAL_NODISCARD inline auto reverse_iter(Ts &&...ts) noexcept
SEAL_NODISCARD inline auto reverse_iter(Ts &&... ts) noexcept
-> ReverseIter<typename iterator_internal::IterType<void, Ts...>::type>
{
return typename iterator_internal::IterType<void, Ts...>::type(std::forward<Ts>(ts)...);
Expand Down
14 changes: 7 additions & 7 deletions native/src/seal/util/pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ namespace seal

// Move when T is not seal_byte
template <typename... Args>
Pointer(Pointer<seal_byte> &&source, Args &&...args)
Pointer(Pointer<seal_byte> &&source, Args &&... args)
{
// Cannot acquire a non-pool pointer of different type
if (!source.head_ && source.data_)
Expand Down Expand Up @@ -482,7 +482,7 @@ namespace seal
}

template <typename... Args>
Pointer(class MemoryPoolHead *head, Args &&...args)
Pointer(class MemoryPoolHead *head, Args &&... args)
{
#ifdef SEAL_DEBUG
if (!head)
Expand Down Expand Up @@ -778,7 +778,7 @@ namespace seal

// Move when T is not seal_byte
template <typename... Args>
ConstPointer(Pointer<seal_byte> &&source, Args &&...args)
ConstPointer(Pointer<seal_byte> &&source, Args &&... args)
{
// Cannot acquire a non-pool pointer of different type
if (!source.head_ && source.data_)
Expand Down Expand Up @@ -874,7 +874,7 @@ namespace seal

// Move when T is not seal_byte
template <typename... Args>
ConstPointer(ConstPointer<seal_byte> &&source, Args &&...args)
ConstPointer(ConstPointer<seal_byte> &&source, Args &&... args)
{
// Cannot acquire a non-pool pointer of different type
if (!source.head_ && source.data_)
Expand Down Expand Up @@ -1170,7 +1170,7 @@ namespace seal
}

template <typename... Args>
ConstPointer(class MemoryPoolHead *head, Args &&...args)
ConstPointer(class MemoryPoolHead *head, Args &&... args)
{
#ifdef SEAL_DEBUG
if (!head)
Expand Down Expand Up @@ -1218,7 +1218,7 @@ namespace seal
typename T_, typename... Args,
typename = std::enable_if_t<std::is_standard_layout<
typename std::remove_cv<typename std::remove_reference<T_>::type>::type>::value>>
SEAL_NODISCARD inline auto allocate(MemoryPool &pool, Args &&...args)
SEAL_NODISCARD inline auto allocate(MemoryPool &pool, Args &&... args)
{
using T = typename std::remove_cv<typename std::remove_reference<T_>::type>::type;
return Pointer<T>(pool.get_for_byte_count(sizeof(T)), std::forward<Args>(args)...);
Expand All @@ -1229,7 +1229,7 @@ namespace seal
typename T_, typename... Args,
typename = std::enable_if_t<std::is_standard_layout<
typename std::remove_cv<typename std::remove_reference<T_>::type>::type>::value>>
SEAL_NODISCARD inline auto allocate(std::size_t count, MemoryPool &pool, Args &&...args)
SEAL_NODISCARD inline auto allocate(std::size_t count, MemoryPool &pool, Args &&... args)
{
using T = typename std::remove_cv<typename std::remove_reference<T_>::type>::type;
return Pointer<T>(pool.get_for_byte_count(mul_safe(count, sizeof(T))), std::forward<Args>(args)...);
Expand Down

0 comments on commit 4286513

Please sign in to comment.