File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 3
3
4
4
#pragma once
5
5
6
+ #pragma warning(push)
7
+ // std::hash() doesn't test for `nullptr`, nor do we want to.
8
+ #pragma warning(disable: 26429) // Symbol '...' is never tested for nullness, it can be marked as not_null (f.23).
9
+ // Misdiagnosis: static_cast<const void*> is used to differentiate between 2 overloads of til::hasher::write.
10
+ #pragma warning(disable: 26474) // Don't cast between pointer types when the conversion could be implicit (type.1).
11
+ // We don't want to unnecessarily modify wyhash from its original.
12
+ #pragma warning(disable: 26481) // Don't use pointer arithmetic. Use span instead (bounds.1).
13
+ #pragma warning(disable: 26494) // Variable '...' is uninitialized. Always initialize an object (type.5).
14
+ #pragma warning(disable: 26496) // The variable '...' does not change after construction, mark it as const (con.4).
15
+
6
16
#if defined(_M_X64) && !defined(_M_ARM64EC)
7
17
#define TIL_HASH_X64
8
18
#elif defined(_M_ARM64) || defined(_M_ARM64EC)
@@ -229,7 +239,7 @@ namespace til
229
239
void operator ()(hasher& h, float v) const noexcept
230
240
{
231
241
v = v == 0 .0f ? 0 .0f : v; // map -0 to 0
232
- h.write (static_cast <const void *>(&v), sizeof v );
242
+ h.write (static_cast <const void *>(&v), sizeof (v) );
233
243
}
234
244
};
235
245
@@ -276,3 +286,5 @@ namespace til
276
286
return h.finalize ();
277
287
}
278
288
}
289
+
290
+ #pragma warning(pop)
You can’t perform that action at this time.
0 commit comments