Skip to content

Commit a81375a

Browse files
author
kr-2003
committed
clang formatter
1 parent b835679 commit a81375a

File tree

2 files changed

+28
-48
lines changed

2 files changed

+28
-48
lines changed

libc/src/__support/CPP/type_traits/is_signed.h

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,70 +19,59 @@ namespace cpp {
1919

2020
// Primary template: handles arithmetic and signed fixed-point types
2121
template <typename T>
22-
struct is_signed : bool_constant<((is_fixed_point_v<T> || is_arithmetic_v<T>) && (T(-1) < T(0)))> {
22+
struct is_signed : bool_constant<((is_fixed_point_v<T> || is_arithmetic_v<T>) &&
23+
(T(-1) < T(0)))> {
2324
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
2425
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
2526
};
2627

2728
#ifdef LIBC_COMPILER_HAS_FIXED_POINT
2829
// Specializations for unsigned fixed-point types
29-
template <>
30-
struct is_signed<unsigned short _Fract> : bool_constant<false> {
30+
template <> struct is_signed<unsigned short _Fract> : bool_constant<false> {
3131
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
3232
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
3333
};
34-
template <>
35-
struct is_signed<unsigned _Fract> : bool_constant<false> {
34+
template <> struct is_signed<unsigned _Fract> : bool_constant<false> {
3635
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
3736
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
3837
};
39-
template <>
40-
struct is_signed<unsigned long _Fract> : bool_constant<false> {
38+
template <> struct is_signed<unsigned long _Fract> : bool_constant<false> {
4139
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
4240
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
4341
};
44-
template <>
45-
struct is_signed<unsigned short _Accum> : bool_constant<false> {
42+
template <> struct is_signed<unsigned short _Accum> : bool_constant<false> {
4643
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
4744
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
4845
};
49-
template <>
50-
struct is_signed<unsigned _Accum> : bool_constant<false> {
46+
template <> struct is_signed<unsigned _Accum> : bool_constant<false> {
5147
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
5248
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
5349
};
54-
template <>
55-
struct is_signed<unsigned long _Accum> : bool_constant<false> {
50+
template <> struct is_signed<unsigned long _Accum> : bool_constant<false> {
5651
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
5752
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
5853
};
59-
template <>
60-
struct is_signed<unsigned short sat _Fract> : bool_constant<false> {
54+
template <> struct is_signed<unsigned short sat _Fract> : bool_constant<false> {
6155
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
6256
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
6357
};
64-
template <>
65-
struct is_signed<unsigned sat _Fract> : bool_constant<false> {
58+
template <> struct is_signed<unsigned sat _Fract> : bool_constant<false> {
6659
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
6760
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
6861
};
69-
template <>
70-
struct is_signed<unsigned long sat _Fract> : bool_constant<false> {
62+
template <> struct is_signed<unsigned long sat _Fract> : bool_constant<false> {
7163
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
7264
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
7365
};
74-
template <>
75-
struct is_signed<unsigned short sat _Accum> : bool_constant<false> {
66+
template <> struct is_signed<unsigned short sat _Accum> : bool_constant<false> {
7667
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
7768
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
7869
};
79-
template <>
80-
struct is_signed<unsigned sat _Accum> : bool_constant<false> {
70+
template <> struct is_signed<unsigned sat _Accum> : bool_constant<false> {
8171
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
8272
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
8373
};
84-
template <>
85-
struct is_signed<unsigned long sat _Accum> : bool_constant<false> {
74+
template <> struct is_signed<unsigned long sat _Accum> : bool_constant<false> {
8675
LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
8776
LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
8877
};

libc/src/__support/CPP/type_traits/is_unsigned.h

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,40 +19,36 @@ namespace cpp {
1919

2020
// Primary template: handles arithmetic and signed fixed-point types
2121
template <typename T>
22-
struct is_unsigned : bool_constant<((is_fixed_point_v<T> || is_arithmetic_v<T>) && (T(-1) > T(0)))> {
22+
struct is_unsigned
23+
: bool_constant<((is_fixed_point_v<T> || is_arithmetic_v<T>) &&
24+
(T(-1) > T(0)))> {
2325
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
2426
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
2527
};
2628

2729
#ifdef LIBC_COMPILER_HAS_FIXED_POINT
2830
// Specializations for unsigned fixed-point types
29-
template <>
30-
struct is_unsigned<unsigned short _Fract> : bool_constant<true> {
31+
template <> struct is_unsigned<unsigned short _Fract> : bool_constant<true> {
3132
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
3233
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
3334
};
34-
template <>
35-
struct is_unsigned<unsigned _Fract> : bool_constant<true> {
35+
template <> struct is_unsigned<unsigned _Fract> : bool_constant<true> {
3636
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
3737
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
3838
};
39-
template <>
40-
struct is_unsigned<unsigned long _Fract> : bool_constant<true> {
39+
template <> struct is_unsigned<unsigned long _Fract> : bool_constant<true> {
4140
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
4241
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
4342
};
44-
template <>
45-
struct is_unsigned<unsigned short accum> : bool_constant<true> {
43+
template <> struct is_unsigned<unsigned short accum> : bool_constant<true> {
4644
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
4745
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
4846
};
49-
template <>
50-
struct is_unsigned<unsigned accum> : bool_constant<true> {
47+
template <> struct is_unsigned<unsigned accum> : bool_constant<true> {
5148
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
5249
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
5350
};
54-
template <>
55-
struct is_unsigned<unsigned long accum> : bool_constant<true> {
51+
template <> struct is_unsigned<unsigned long accum> : bool_constant<true> {
5652
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
5753
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
5854
};
@@ -61,28 +57,23 @@ struct is_unsigned<unsigned short sat _Fract> : bool_constant<true> {
6157
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
6258
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
6359
};
64-
template <>
65-
struct is_unsigned<unsigned sat _Fract> : bool_constant<true> {
60+
template <> struct is_unsigned<unsigned sat _Fract> : bool_constant<true> {
6661
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
6762
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
6863
};
69-
template <>
70-
struct is_unsigned<unsigned long sat _Fract> : bool_constant<true> {
64+
template <> struct is_unsigned<unsigned long sat _Fract> : bool_constant<true> {
7165
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
7266
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
7367
};
74-
template <>
75-
struct is_unsigned<unsigned short sat accum> : bool_constant<true> {
68+
template <> struct is_unsigned<unsigned short sat accum> : bool_constant<true> {
7669
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
7770
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
7871
};
79-
template <>
80-
struct is_unsigned<unsigned sat accum> : bool_constant<true> {
72+
template <> struct is_unsigned<unsigned sat accum> : bool_constant<true> {
8173
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
8274
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
8375
};
84-
template <>
85-
struct is_unsigned<unsigned long sat accum> : bool_constant<true> {
76+
template <> struct is_unsigned<unsigned long sat accum> : bool_constant<true> {
8677
LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
8778
LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
8879
};

0 commit comments

Comments
 (0)