More strict aliasing

This commit is contained in:
Alexey Milovidov 2020-01-03 17:41:20 +03:00 committed by Amos Bird
parent d3867ac5fa
commit 3bf1e6f6c1
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4

View File

@ -29,7 +29,7 @@ protected:
using CreatorWithType = std::function<CompressionCodecPtr(const ASTPtr & parameters, DataTypePtr column_type)>; using CreatorWithType = std::function<CompressionCodecPtr(const ASTPtr & parameters, DataTypePtr column_type)>;
using SimpleCreator = std::function<CompressionCodecPtr()>; using SimpleCreator = std::function<CompressionCodecPtr()>;
using CompressionCodecsDictionary = std::unordered_map<String, CreatorWithType>; using CompressionCodecsDictionary = std::unordered_map<String, CreatorWithType>;
using CompressionCodecsCodeDictionary = std::unordered_map<UInt8, CreatorWithType>; using CompressionCodecsCodeDictionary = std::unordered_map<uint8_t, CreatorWithType>;
public: public:
static CompressionCodecFactory & instance(); static CompressionCodecFactory & instance();
@ -43,18 +43,18 @@ public:
CompressionCodecPtr get(const ASTPtr & ast, DataTypePtr column_type = nullptr) const; CompressionCodecPtr get(const ASTPtr & ast, DataTypePtr column_type = nullptr) const;
/// Get codec by method byte (no params available) /// Get codec by method byte (no params available)
CompressionCodecPtr get(const UInt8 byte_code) const; CompressionCodecPtr get(const uint8_t byte_code) const;
/// For backward compatibility with config settings /// For backward compatibility with config settings
CompressionCodecPtr get(const String & family_name, std::optional<int> level) const; CompressionCodecPtr get(const String & family_name, std::optional<int> level) const;
/// Register codec with parameters and column type /// Register codec with parameters and column type
void registerCompressionCodecWithType(const String & family_name, std::optional<UInt8> byte_code, CreatorWithType creator); void registerCompressionCodecWithType(const String & family_name, std::optional<uint8_t> byte_code, CreatorWithType creator);
/// Register codec with parameters /// Register codec with parameters
void registerCompressionCodec(const String & family_name, std::optional<UInt8> byte_code, Creator creator); void registerCompressionCodec(const String & family_name, std::optional<uint8_t> byte_code, Creator creator);
/// Register codec without parameters /// Register codec without parameters
void registerSimpleCompressionCodec(const String & family_name, std::optional<UInt8> byte_code, SimpleCreator creator); void registerSimpleCompressionCodec(const String & family_name, std::optional<uint8_t> byte_code, SimpleCreator creator);
protected: protected:
CompressionCodecPtr getImpl(const String & family_name, const ASTPtr & arguments, DataTypePtr column_type) const; CompressionCodecPtr getImpl(const String & family_name, const ASTPtr & arguments, DataTypePtr column_type) const;