File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -618,6 +618,9 @@ struct static_arbitrary_seed {
618618public:
619619 static constexpr IntType value = fnv(IntType(2166136261U ^ sizeof (IntType)),
620620 __DATE__ __TIME__ __FILE__);
621+
622+ // Prevent creation, while keeping GCC from giving a warning
623+ static_arbitrary_seed () = delete ;
621624};
622625
623626// Sometimes, when debugging or testing, it's handy to be able print the name
Original file line number Diff line number Diff line change @@ -105,20 +105,20 @@ namespace pcg_extras {
105105
106106inline bitcount_t flog2 (uint32_t v)
107107{
108- return 31 - __builtin_clz (v);
108+ return bitcount_t ( 31 - __builtin_clz (v) );
109109}
110110
111111inline bitcount_t trailingzeros (uint32_t v)
112112{
113- return __builtin_ctz (v);
113+ return bitcount_t ( __builtin_ctz (v) );
114114}
115115
116116inline bitcount_t flog2 (uint64_t v)
117117{
118118#if UINT64_MAX == ULONG_MAX
119- return 63 - __builtin_clzl (v);
119+ return bitcount_t ( 63 - __builtin_clzl (v) );
120120#elif UINT64_MAX == ULLONG_MAX
121- return 63 - __builtin_clzll (v);
121+ return bitcount_t ( 63 - __builtin_clzll (v) );
122122#else
123123 #error Cannot find a function for uint64_t
124124#endif
@@ -127,9 +127,9 @@ inline bitcount_t flog2(uint64_t v)
127127inline bitcount_t trailingzeros (uint64_t v)
128128{
129129#if UINT64_MAX == ULONG_MAX
130- return __builtin_ctzl (v);
130+ return bitcount_t ( __builtin_ctzl (v) );
131131#elif UINT64_MAX == ULLONG_MAX
132- return __builtin_ctzll (v);
132+ return bitcount_t ( __builtin_ctzll (v) );
133133#else
134134 #error Cannot find a function for uint64_t
135135#endif
You can’t perform that action at this time.
0 commit comments