mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
More strict aliasing
This commit is contained in:
parent
52153d15cc
commit
c3e80485da
@ -87,4 +87,3 @@ void Authentication::checkPassword(const String & password_, const String & user
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ StringRef ColumnNullable::serializeValueIntoArena(size_t n, Arena & arena, char
|
||||
|
||||
const char * ColumnNullable::deserializeAndInsertFromArena(const char * pos)
|
||||
{
|
||||
UInt8 val = *reinterpret_cast<const UInt8 *>(pos);
|
||||
UInt8 val = unalignedLoad<UInt8>(pos);
|
||||
pos += sizeof(val);
|
||||
|
||||
getNullMapData().push_back(val);
|
||||
|
@ -325,7 +325,7 @@ size_t ColumnUnique<ColumnType>::uniqueDeserializeAndInsertFromArena(const char
|
||||
{
|
||||
if (is_nullable)
|
||||
{
|
||||
UInt8 val = *reinterpret_cast<const UInt8 *>(pos);
|
||||
UInt8 val = unalignedLoad<UInt8>(pos);
|
||||
pos += sizeof(val);
|
||||
|
||||
if (val)
|
||||
|
@ -78,8 +78,8 @@ private:
|
||||
#endif
|
||||
|
||||
public:
|
||||
StringSearcher(const char * const needle_, const size_t needle_size_)
|
||||
: needle{reinterpret_cast<const UInt8 *>(needle_)}, needle_size{needle_size_}
|
||||
StringSearcher(const UInt8 * needle_, const size_t needle_size_)
|
||||
: needle{needle_}, needle_size{needle_size_}
|
||||
{
|
||||
if (0 == needle_size)
|
||||
return;
|
||||
@ -348,8 +348,8 @@ private:
|
||||
#endif
|
||||
|
||||
public:
|
||||
StringSearcher(const char * const needle_, const size_t needle_size)
|
||||
: needle{reinterpret_cast<const UInt8 *>(needle_)}, needle_end{needle + needle_size}
|
||||
StringSearcher(const UInt8 * needle_, const size_t needle_size)
|
||||
: needle{needle_}, needle_end{needle + needle_size}
|
||||
{
|
||||
if (0 == needle_size)
|
||||
return;
|
||||
@ -545,8 +545,8 @@ private:
|
||||
#endif
|
||||
|
||||
public:
|
||||
StringSearcher(const char * const needle_, const size_t needle_size)
|
||||
: needle{reinterpret_cast<const UInt8 *>(needle_)}, needle_end{needle + needle_size}
|
||||
StringSearcher(const UInt8 * needle_, const size_t needle_size)
|
||||
: needle{needle_}, needle_end{needle + needle_size}
|
||||
{
|
||||
if (0 == needle_size)
|
||||
return;
|
||||
@ -713,11 +713,11 @@ class TokenSearcher
|
||||
size_t needle_size;
|
||||
|
||||
public:
|
||||
TokenSearcher(const char * const needle_, const size_t needle_size_)
|
||||
TokenSearcher(const UInt8 * needle_, const size_t needle_size_)
|
||||
: searcher{needle_, needle_size_},
|
||||
needle_size(needle_size_)
|
||||
{
|
||||
if (std::any_of(reinterpret_cast<const UInt8 *>(needle_), reinterpret_cast<const UInt8 *>(needle_) + needle_size_, isTokenSeparator))
|
||||
if (std::any_of(needle_, needle_ + needle_size_, isTokenSeparator))
|
||||
{
|
||||
throw Exception{"Needle must not contain whitespace or separator characters", ErrorCodes::BAD_ARGUMENTS};
|
||||
}
|
||||
|
@ -526,7 +526,7 @@ void TrieDictionary::getItemsImpl(
|
||||
if (addr.size != 16)
|
||||
throw Exception("Expected key to be FixedString(16)", ErrorCodes::LOGICAL_ERROR);
|
||||
|
||||
uintptr_t slot = btrie_find_a6(trie, reinterpret_cast<const UInt8 *>(addr.data));
|
||||
uintptr_t slot = btrie_find_a6(trie, reinterpret_cast<const uint8_t *>(addr.data));
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic warning "-Wold-style-cast"
|
||||
set_value(i, slot != BTRIE_NULL ? static_cast<OutputType>(vec[slot]) : get_default(i));
|
||||
|
Loading…
Reference in New Issue
Block a user