Merge pull request #64110 from rschu1ze/redundant-inline

Throw out some `inline`s
This commit is contained in:
Robert Schulze 2024-05-28 09:55:56 +00:00 committed by GitHub
commit 2680683863
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
151 changed files with 469 additions and 471 deletions

View File

@ -37,6 +37,7 @@ Checks: [
'-cert-oop54-cpp',
'-cert-oop57-cpp',
'-clang-analyzer-optin.core.EnumCastOutOfRange', # https://github.com/abseil/abseil-cpp/issues/1667
'-clang-analyzer-optin.performance.Padding',
'-clang-analyzer-unix.Malloc',
@ -94,6 +95,7 @@ Checks: [
'-modernize-pass-by-value',
'-modernize-return-braced-init-list',
'-modernize-use-auto',
'-modernize-use-constraints', # This is a good check, but clang-tidy crashes, see https://github.com/llvm/llvm-project/issues/91872
'-modernize-use-default-member-init',
'-modernize-use-emplace',
'-modernize-use-nodiscard',
@ -121,7 +123,8 @@ Checks: [
'-readability-magic-numbers',
'-readability-named-parameter',
'-readability-redundant-declaration',
'-readability-redundant-inline-specifier',
'-readability-redundant-inline-specifier', # useful but incompatible with __attribute((always_inline))__ (aka. ALWAYS_INLINE, base/base/defines.h).
# ALWAYS_INLINE only has an effect if combined with `inline`: https://godbolt.org/z/Eefd74qdM
'-readability-redundant-member-init', # Useful but triggers another problem. Imagine a struct S with multiple String members. Structs are often instantiated via designated
# initializer S s{.s1 = [...], .s2 = [...], [...]}. In this case, compiler warning `missing-field-initializers` requires to specify all members which are not in-struct
# initialized (example: s1 in struct S { String s1; String s2{};}; is not in-struct initialized, therefore it must be specified at instantiation time). As explicitly
@ -132,12 +135,7 @@ Checks: [
'-readability-uppercase-literal-suffix',
'-readability-use-anyofallof',
'-zircon-*',
# This is a good check, but clang-tidy crashes, see https://github.com/llvm/llvm-project/issues/91872
'-modernize-use-constraints',
# https://github.com/abseil/abseil-cpp/issues/1667
'-clang-analyzer-optin.core.EnumCastOutOfRange'
'-zircon-*'
]
WarningsAsErrors: '*'

View File

@ -86,7 +86,7 @@ public:
}
/// Return object into pool. Client must return same object that was borrowed.
inline void returnObject(T && object_to_return)
void returnObject(T && object_to_return)
{
{
std::lock_guard lock(objects_mutex);
@ -99,20 +99,20 @@ public:
}
/// Max pool size
inline size_t maxSize() const
size_t maxSize() const
{
return max_size;
}
/// Allocated objects size by the pool. If allocatedObjectsSize == maxSize then pool is full.
inline size_t allocatedObjectsSize() const
size_t allocatedObjectsSize() const
{
std::lock_guard lock(objects_mutex);
return allocated_objects_size;
}
/// Returns allocatedObjectsSize == maxSize
inline bool isFull() const
bool isFull() const
{
std::lock_guard lock(objects_mutex);
return allocated_objects_size == max_size;
@ -120,7 +120,7 @@ public:
/// Borrowed objects size. If borrowedObjectsSize == allocatedObjectsSize and pool is full.
/// Then client will wait during borrowObject function call.
inline size_t borrowedObjectsSize() const
size_t borrowedObjectsSize() const
{
std::lock_guard lock(objects_mutex);
return borrowed_objects_size;
@ -129,7 +129,7 @@ public:
private:
template <typename FactoryFunc>
inline T allocateObjectForBorrowing(const std::unique_lock<std::mutex> &, FactoryFunc && func)
T allocateObjectForBorrowing(const std::unique_lock<std::mutex> &, FactoryFunc && func)
{
++allocated_objects_size;
++borrowed_objects_size;
@ -137,7 +137,7 @@ private:
return std::forward<FactoryFunc>(func)();
}
inline T borrowFromObjects(const std::unique_lock<std::mutex> &)
T borrowFromObjects(const std::unique_lock<std::mutex> &)
{
T dst;
detail::moveOrCopyIfThrow(std::move(objects.back()), dst);

View File

@ -23,7 +23,7 @@ public:
void handleRequest(HTTPServerRequest & request, HTTPServerResponse & response, const ProfileEvents::Event & write_event) override;
private:
static constexpr inline auto FORMAT = "RowBinary";
static constexpr auto FORMAT = "RowBinary";
const size_t keep_alive_timeout;
LoggerPtr log;

View File

@ -56,10 +56,10 @@ private:
std::condition_variable cond;
std::optional<ThreadFromGlobalPool> thread;
static inline constexpr auto profile_events_path_prefix = "ClickHouse.ProfileEvents.";
static inline constexpr auto profile_events_cumulative_path_prefix = "ClickHouse.ProfileEventsCumulative.";
static inline constexpr auto current_metrics_path_prefix = "ClickHouse.Metrics.";
static inline constexpr auto asynchronous_metrics_path_prefix = "ClickHouse.AsynchronousMetrics.";
static constexpr auto profile_events_path_prefix = "ClickHouse.ProfileEvents.";
static constexpr auto profile_events_cumulative_path_prefix = "ClickHouse.ProfileEventsCumulative.";
static constexpr auto current_metrics_path_prefix = "ClickHouse.Metrics.";
static constexpr auto asynchronous_metrics_path_prefix = "ClickHouse.AsynchronousMetrics.";
};
}

View File

@ -341,7 +341,7 @@ public:
value[i] = Node::read(buf, arena);
}
inline std::optional<size_t> getBaseIndex(Data & data) const
std::optional<size_t> getBaseIndex(Data & data) const
{
if (data.value.size() == 0)
return {};

View File

@ -73,7 +73,7 @@ private:
using Base = AggregateFunctionNullBase<result_is_nullable, serialize_flag,
AggregateFunctionIfNullUnary<result_is_nullable, serialize_flag>>;
inline bool singleFilter(const IColumn ** columns, size_t row_num) const
bool singleFilter(const IColumn ** columns, size_t row_num) const
{
const IColumn * filter_column = columns[num_arguments - 1];
@ -261,7 +261,7 @@ public:
filter_is_only_null = arguments.back()->onlyNull();
}
static inline bool singleFilter(const IColumn ** columns, size_t row_num, size_t num_arguments)
static bool singleFilter(const IColumn ** columns, size_t row_num, size_t num_arguments)
{
return assert_cast<const ColumnUInt8 &>(*columns[num_arguments - 1]).getData()[row_num];
}

View File

@ -138,7 +138,7 @@ class QuantileTDigest
compress();
}
inline bool canBeMerged(const BetterFloat & l_mean, const Value & r_mean)
bool canBeMerged(const BetterFloat & l_mean, const Value & r_mean)
{
return l_mean == r_mean || (!std::isinf(l_mean) && !std::isinf(r_mean));
}

View File

@ -262,7 +262,7 @@ namespace detail
UInt64 count_big[BIG_SIZE];
/// Get value of quantile by index in array `count_big`.
static inline UInt16 indexInBigToValue(size_t i)
static UInt16 indexInBigToValue(size_t i)
{
return (i * BIG_PRECISION) + SMALL_THRESHOLD
+ (intHash32<0>(i) % BIG_PRECISION - (BIG_PRECISION / 2)); /// A small randomization so that it is not noticeable that all the values are even.

View File

@ -24,14 +24,14 @@ private:
std::unique_ptr<datasketches::update_theta_sketch> sk_update;
std::unique_ptr<datasketches::theta_union> sk_union;
inline datasketches::update_theta_sketch * getSkUpdate()
datasketches::update_theta_sketch * getSkUpdate()
{
if (!sk_update)
sk_update = std::make_unique<datasketches::update_theta_sketch>(datasketches::update_theta_sketch::builder().build());
return sk_update.get();
}
inline datasketches::theta_union * getSkUnion()
datasketches::theta_union * getSkUnion()
{
if (!sk_union)
sk_union = std::make_unique<datasketches::theta_union>(datasketches::theta_union::builder().build());

View File

@ -38,7 +38,7 @@ bool isAllArgumentsContiguousInMemory(const DataTypes & argument_types);
template <>
struct UniqVariadicHash<false, false>
{
static inline UInt64 apply(size_t num_args, const IColumn ** columns, size_t row_num)
static UInt64 apply(size_t num_args, const IColumn ** columns, size_t row_num)
{
UInt64 hash;
@ -65,7 +65,7 @@ struct UniqVariadicHash<false, false>
template <>
struct UniqVariadicHash<false, true>
{
static inline UInt64 apply(size_t num_args, const IColumn ** columns, size_t row_num)
static UInt64 apply(size_t num_args, const IColumn ** columns, size_t row_num)
{
UInt64 hash;
@ -94,7 +94,7 @@ struct UniqVariadicHash<false, true>
template <>
struct UniqVariadicHash<true, false>
{
static inline UInt128 apply(size_t num_args, const IColumn ** columns, size_t row_num)
static UInt128 apply(size_t num_args, const IColumn ** columns, size_t row_num)
{
const IColumn ** column = columns;
const IColumn ** columns_end = column + num_args;
@ -114,7 +114,7 @@ struct UniqVariadicHash<true, false>
template <>
struct UniqVariadicHash<true, true>
{
static inline UInt128 apply(size_t num_args, const IColumn ** columns, size_t row_num)
static UInt128 apply(size_t num_args, const IColumn ** columns, size_t row_num)
{
const auto & tuple_columns = assert_cast<const ColumnTuple *>(columns[0])->getColumns();

View File

@ -105,14 +105,14 @@ private:
}
}
inline size_t buf_size() const { return 1ULL << size_degree; } /// NOLINT
inline size_t max_fill() const { return 1ULL << (size_degree - 1); } /// NOLINT
inline size_t mask() const { return buf_size() - 1; }
size_t buf_size() const { return 1ULL << size_degree; } /// NOLINT
size_t max_fill() const { return 1ULL << (size_degree - 1); } /// NOLINT
size_t mask() const { return buf_size() - 1; }
inline size_t place(HashValue x) const { return (x >> UNIQUES_HASH_BITS_FOR_SKIP) & mask(); }
size_t place(HashValue x) const { return (x >> UNIQUES_HASH_BITS_FOR_SKIP) & mask(); }
/// The value is divided by 2 ^ skip_degree
inline bool good(HashValue hash) const { return hash == ((hash >> skip_degree) << skip_degree); }
bool good(HashValue hash) const { return hash == ((hash >> skip_degree) << skip_degree); }
HashValue hash(Value key) const { return static_cast<HashValue>(Hash()(key)); }

View File

@ -173,13 +173,13 @@ private:
return arithmetic_function_clone;
}
inline void resolveOrdinaryFunctionNode(FunctionNode & function_node, const String & function_name) const
void resolveOrdinaryFunctionNode(FunctionNode & function_node, const String & function_name) const
{
auto function = FunctionFactory::instance().get(function_name, getContext());
function_node.resolveAsFunction(function->build(function_node.getArgumentColumns()));
}
static inline void resolveAggregateFunctionNode(FunctionNode & function_node, const QueryTreeNodePtr & argument, const String & aggregate_function_name)
static void resolveAggregateFunctionNode(FunctionNode & function_node, const QueryTreeNodePtr & argument, const String & aggregate_function_name)
{
auto function_aggregate_function = function_node.getAggregateFunction();

View File

@ -184,7 +184,7 @@ private:
return result_function;
}
inline QueryTreeNodePtr makeEqualsFunction(QueryTreeNodePtr lhs_argument, QueryTreeNodePtr rhs_argument) const
QueryTreeNodePtr makeEqualsFunction(QueryTreeNodePtr lhs_argument, QueryTreeNodePtr rhs_argument) const
{
return makeComparisonFunction(std::move(lhs_argument), std::move(rhs_argument), "equals");
}

View File

@ -215,7 +215,7 @@ public:
}
private:
inline void resolveOrdinaryFunctionNode(FunctionNode & function_node, const String & function_name) const
void resolveOrdinaryFunctionNode(FunctionNode & function_node, const String & function_name) const
{
auto function = FunctionFactory::instance().get(function_name, getContext());
function_node.resolveAsFunction(function->build(function_node.getArgumentColumns()));

View File

@ -59,7 +59,7 @@ public:
}
}
private:
static inline void resolveAsCountAggregateFunction(FunctionNode & function_node)
static void resolveAsCountAggregateFunction(FunctionNode & function_node)
{
AggregateFunctionProperties properties;
auto aggregate_function = AggregateFunctionFactory::instance().get("count", NullsAction::EMPTY, {}, {}, properties);

View File

@ -108,7 +108,7 @@ public:
}
private:
static inline void resolveAsAggregateFunctionWithIf(FunctionNode & function_node, const DataTypes & argument_types)
static void resolveAsAggregateFunctionWithIf(FunctionNode & function_node, const DataTypes & argument_types)
{
auto result_type = function_node.getResultType();

View File

@ -110,7 +110,7 @@ private:
function_node.resolveAsFunction(function->build(function_node.getArgumentColumns()));
}
static inline void resolveAsAggregateFunctionNode(FunctionNode & function_node, const DataTypePtr & argument_type)
static void resolveAsAggregateFunctionNode(FunctionNode & function_node, const DataTypePtr & argument_type)
{
AggregateFunctionProperties properties;
const auto aggregate_function = AggregateFunctionFactory::instance().get(function_node.getFunctionName(),

View File

@ -156,7 +156,7 @@ public:
}
private:
static inline void resolveAsCountIfAggregateFunction(FunctionNode & function_node, const DataTypePtr & argument_type)
static void resolveAsCountIfAggregateFunction(FunctionNode & function_node, const DataTypePtr & argument_type)
{
AggregateFunctionProperties properties;
auto aggregate_function = AggregateFunctionFactory::instance().get(
@ -165,7 +165,7 @@ private:
function_node.resolveAsAggregateFunction(std::move(aggregate_function));
}
inline QueryTreeNodePtr getMultiplyFunction(QueryTreeNodePtr left, QueryTreeNodePtr right)
QueryTreeNodePtr getMultiplyFunction(QueryTreeNodePtr left, QueryTreeNodePtr right)
{
auto multiply_function_node = std::make_shared<FunctionNode>("multiply");
auto & multiply_arguments_nodes = multiply_function_node->getArguments().getNodes();

View File

@ -14,8 +14,8 @@ namespace DB
class CatBoostLibraryBridgeHelper final : public LibraryBridgeHelper
{
public:
static constexpr inline auto PING_HANDLER = "/catboost_ping";
static constexpr inline auto MAIN_HANDLER = "/catboost_request";
static constexpr auto PING_HANDLER = "/catboost_ping";
static constexpr auto MAIN_HANDLER = "/catboost_request";
explicit CatBoostLibraryBridgeHelper(
ContextPtr context_,
@ -38,11 +38,11 @@ protected:
bool bridgeHandShake() override;
private:
static constexpr inline auto CATBOOST_LIST_METHOD = "catboost_list";
static constexpr inline auto CATBOOST_REMOVEMODEL_METHOD = "catboost_removeModel";
static constexpr inline auto CATBOOST_REMOVEALLMODELS_METHOD = "catboost_removeAllModels";
static constexpr inline auto CATBOOST_GETTREECOUNT_METHOD = "catboost_GetTreeCount";
static constexpr inline auto CATBOOST_LIB_EVALUATE_METHOD = "catboost_libEvaluate";
static constexpr auto CATBOOST_LIST_METHOD = "catboost_list";
static constexpr auto CATBOOST_REMOVEMODEL_METHOD = "catboost_removeModel";
static constexpr auto CATBOOST_REMOVEALLMODELS_METHOD = "catboost_removeAllModels";
static constexpr auto CATBOOST_GETTREECOUNT_METHOD = "catboost_GetTreeCount";
static constexpr auto CATBOOST_LIB_EVALUATE_METHOD = "catboost_libEvaluate";
Poco::URI createRequestURI(const String & method) const;

View File

@ -25,8 +25,8 @@ public:
String dict_attributes;
};
static constexpr inline auto PING_HANDLER = "/extdict_ping";
static constexpr inline auto MAIN_HANDLER = "/extdict_request";
static constexpr auto PING_HANDLER = "/extdict_ping";
static constexpr auto MAIN_HANDLER = "/extdict_request";
ExternalDictionaryLibraryBridgeHelper(ContextPtr context_, const Block & sample_block, const Field & dictionary_id_, const LibraryInitData & library_data_);
@ -62,14 +62,14 @@ protected:
ReadWriteBufferFromHTTP::OutStreamCallback getInitLibraryCallback() const;
private:
static constexpr inline auto EXT_DICT_LIB_NEW_METHOD = "extDict_libNew";
static constexpr inline auto EXT_DICT_LIB_CLONE_METHOD = "extDict_libClone";
static constexpr inline auto EXT_DICT_LIB_DELETE_METHOD = "extDict_libDelete";
static constexpr inline auto EXT_DICT_LOAD_ALL_METHOD = "extDict_loadAll";
static constexpr inline auto EXT_DICT_LOAD_IDS_METHOD = "extDict_loadIds";
static constexpr inline auto EXT_DICT_LOAD_KEYS_METHOD = "extDict_loadKeys";
static constexpr inline auto EXT_DICT_IS_MODIFIED_METHOD = "extDict_isModified";
static constexpr inline auto EXT_DICT_SUPPORTS_SELECTIVE_LOAD_METHOD = "extDict_supportsSelectiveLoad";
static constexpr auto EXT_DICT_LIB_NEW_METHOD = "extDict_libNew";
static constexpr auto EXT_DICT_LIB_CLONE_METHOD = "extDict_libClone";
static constexpr auto EXT_DICT_LIB_DELETE_METHOD = "extDict_libDelete";
static constexpr auto EXT_DICT_LOAD_ALL_METHOD = "extDict_loadAll";
static constexpr auto EXT_DICT_LOAD_IDS_METHOD = "extDict_loadIds";
static constexpr auto EXT_DICT_LOAD_KEYS_METHOD = "extDict_loadKeys";
static constexpr auto EXT_DICT_IS_MODIFIED_METHOD = "extDict_isModified";
static constexpr auto EXT_DICT_SUPPORTS_SELECTIVE_LOAD_METHOD = "extDict_supportsSelectiveLoad";
Poco::URI createRequestURI(const String & method) const;

View File

@ -16,9 +16,9 @@ class IBridgeHelper: protected WithContext
{
public:
static constexpr inline auto DEFAULT_HOST = "127.0.0.1";
static constexpr inline auto DEFAULT_FORMAT = "RowBinary";
static constexpr inline auto PING_OK_ANSWER = "Ok.";
static constexpr auto DEFAULT_HOST = "127.0.0.1";
static constexpr auto DEFAULT_FORMAT = "RowBinary";
static constexpr auto PING_OK_ANSWER = "Ok.";
static const inline std::string PING_METHOD = Poco::Net::HTTPRequest::HTTP_GET;
static const inline std::string MAIN_METHOD = Poco::Net::HTTPRequest::HTTP_POST;

View File

@ -37,7 +37,7 @@ protected:
Poco::URI createBaseURI() const override;
static constexpr inline size_t DEFAULT_PORT = 9012;
static constexpr size_t DEFAULT_PORT = 9012;
const Poco::Util::AbstractConfiguration & config;
LoggerPtr log;

View File

@ -52,12 +52,12 @@ class XDBCBridgeHelper : public IXDBCBridgeHelper
{
public:
static constexpr inline auto DEFAULT_PORT = BridgeHelperMixin::DEFAULT_PORT;
static constexpr inline auto PING_HANDLER = "/ping";
static constexpr inline auto MAIN_HANDLER = "/";
static constexpr inline auto COL_INFO_HANDLER = "/columns_info";
static constexpr inline auto IDENTIFIER_QUOTE_HANDLER = "/identifier_quote";
static constexpr inline auto SCHEMA_ALLOWED_HANDLER = "/schema_allowed";
static constexpr auto DEFAULT_PORT = BridgeHelperMixin::DEFAULT_PORT;
static constexpr auto PING_HANDLER = "/ping";
static constexpr auto MAIN_HANDLER = "/";
static constexpr auto COL_INFO_HANDLER = "/columns_info";
static constexpr auto IDENTIFIER_QUOTE_HANDLER = "/identifier_quote";
static constexpr auto SCHEMA_ALLOWED_HANDLER = "/schema_allowed";
XDBCBridgeHelper(
ContextPtr context_,
@ -256,7 +256,7 @@ protected:
struct JDBCBridgeMixin
{
static constexpr inline auto DEFAULT_PORT = 9019;
static constexpr auto DEFAULT_PORT = 9019;
static String configPrefix()
{
@ -287,7 +287,7 @@ struct JDBCBridgeMixin
struct ODBCBridgeMixin
{
static constexpr inline auto DEFAULT_PORT = 9018;
static constexpr auto DEFAULT_PORT = 9018;
static String configPrefix()
{

View File

@ -69,9 +69,9 @@ union CPUInfo
UInt32 edx;
} registers;
inline explicit CPUInfo(UInt32 op) noexcept { cpuid(op, info); }
explicit CPUInfo(UInt32 op) noexcept { cpuid(op, info); }
inline CPUInfo(UInt32 op, UInt32 sub_op) noexcept { cpuid(op, sub_op, info); }
CPUInfo(UInt32 op, UInt32 sub_op) noexcept { cpuid(op, sub_op, info); }
};
inline bool haveRDTSCP() noexcept

View File

@ -453,7 +453,7 @@ protected:
/// Return the columns which actually contain the values of the keys.
/// For a given key column, if it is nullable, we return its nested
/// column. Otherwise we return the key column itself.
inline const ColumnRawPtrs & getActualColumns() const
const ColumnRawPtrs & getActualColumns() const
{
return actual_columns;
}

View File

@ -292,13 +292,13 @@ private:
}
template <typename T>
inline T & getContainer()
T & getContainer()
{
return *reinterpret_cast<T *>(address & mask);
}
template <typename T>
inline const T & getContainer() const
const T & getContainer() const
{
return *reinterpret_cast<T *>(address & mask);
}
@ -309,7 +309,7 @@ private:
address |= static_cast<UInt8>(t);
}
inline details::ContainerType getContainerType() const
details::ContainerType getContainerType() const
{
return static_cast<details::ContainerType>(address & ~mask);
}

View File

@ -116,7 +116,7 @@ public:
/** Return the current cell number and the corresponding content.
*/
inline std::pair<BucketIndex, UInt8> get() const
std::pair<BucketIndex, UInt8> get() const
{
if ((current_bucket_index == 0) || is_eof)
throw Exception(ErrorCodes::NO_AVAILABLE_DATA, "No available data.");

View File

@ -37,7 +37,7 @@ namespace fs = std::filesystem;
class CounterInFile
{
private:
static inline constexpr size_t SMALL_READ_WRITE_BUFFER_SIZE = 16;
static constexpr size_t SMALL_READ_WRITE_BUFFER_SIZE = 16;
public:
/// path - the name of the file, including the path

View File

@ -64,7 +64,7 @@ public:
static ProfileEvents::Counters & getProfileEvents();
inline ALWAYS_INLINE static MemoryTracker * getMemoryTracker()
{
if (unlikely(!current_thread))
if (!current_thread) [[unlikely]]
return nullptr;
return &current_thread->memory_tracker;
}

View File

@ -261,7 +261,7 @@ public:
return true;
}
inline const value_type & get() const
const value_type & get() const
{
if (!is_initialized || is_eof)
throw DB::Exception(DB::ErrorCodes::NO_AVAILABLE_DATA, "No available data");

View File

@ -844,7 +844,7 @@ public:
return true;
}
inline const value_type & get() const
const value_type & get() const
{
if (!is_initialized || is_eof)
throw DB::Exception(DB::ErrorCodes::NO_AVAILABLE_DATA, "No available data");

View File

@ -69,7 +69,7 @@ struct PackedHashMapCell : public HashMapCell<Key, TMapped, Hash, TState, Packed
bool isZero(const State & state) const { return isZero(this->value.first, state); }
static bool isZero(const Key key, const State & /*state*/) { return ZeroTraits::check(key); }
static inline bool bitEqualsByValue(key_type a, key_type b) { return a == b; }
static bool bitEqualsByValue(key_type a, key_type b) { return a == b; }
template <size_t I>
auto get() const

View File

@ -112,7 +112,7 @@ public:
return true;
}
inline const value_type & get() const
const value_type & get() const
{
if (!is_initialized || is_eof)
throw DB::Exception(DB::ErrorCodes::NO_AVAILABLE_DATA, "No available data");

View File

@ -128,13 +128,13 @@ public:
{
}
inline void update(UInt8 cur_rank, UInt8 new_rank)
void update(UInt8 cur_rank, UInt8 new_rank)
{
denominator -= static_cast<T>(1.0) / (1ULL << cur_rank);
denominator += static_cast<T>(1.0) / (1ULL << new_rank);
}
inline void update(UInt8 rank)
void update(UInt8 rank)
{
denominator += static_cast<T>(1.0) / (1ULL << rank);
}
@ -166,13 +166,13 @@ public:
rank_count[0] = static_cast<UInt32>(initial_value);
}
inline void update(UInt8 cur_rank, UInt8 new_rank)
void update(UInt8 cur_rank, UInt8 new_rank)
{
--rank_count[cur_rank];
++rank_count[new_rank];
}
inline void update(UInt8 rank)
void update(UInt8 rank)
{
++rank_count[rank];
}
@ -429,13 +429,13 @@ public:
private:
/// Extract subset of bits in [begin, end[ range.
inline HashValueType extractBitSequence(HashValueType val, UInt8 begin, UInt8 end) const
HashValueType extractBitSequence(HashValueType val, UInt8 begin, UInt8 end) const
{
return (val >> begin) & ((1ULL << (end - begin)) - 1);
}
/// Rank is number of trailing zeros.
inline UInt8 calculateRank(HashValueType val) const
UInt8 calculateRank(HashValueType val) const
{
if (unlikely(val == 0))
return max_rank;
@ -448,7 +448,7 @@ private:
return zeros_plus_one;
}
inline HashValueType getHash(Value key) const
HashValueType getHash(Value key) const
{
/// NOTE: this should be OK, since value is the same as key for HLL.
return static_cast<HashValueType>(
@ -496,7 +496,7 @@ private:
throw Poco::Exception("Internal error", DB::ErrorCodes::LOGICAL_ERROR);
}
inline double applyCorrection(double raw_estimate) const
double applyCorrection(double raw_estimate) const
{
double fixed_estimate;
@ -525,7 +525,7 @@ private:
/// Correction used in HyperLogLog++ algorithm.
/// Source: "HyperLogLog in Practice: Algorithmic Engineering of a State of The Art Cardinality Estimation Algorithm"
/// (S. Heule et al., Proceedings of the EDBT 2013 Conference).
inline double applyBiasCorrection(double raw_estimate) const
double applyBiasCorrection(double raw_estimate) const
{
double fixed_estimate;
@ -540,7 +540,7 @@ private:
/// Calculation of unique values using LinearCounting algorithm.
/// Source: "A Linear-time Probabilistic Counting Algorithm for Database Applications"
/// (Whang et al., ACM Trans. Database Syst., pp. 208-229, 1990).
inline double applyLinearCorrection(double raw_estimate) const
double applyLinearCorrection(double raw_estimate) const
{
double fixed_estimate;

View File

@ -23,7 +23,7 @@ struct Interval
Interval(IntervalStorageType left_, IntervalStorageType right_) : left(left_), right(right_) { }
inline bool contains(IntervalStorageType point) const { return left <= point && point <= right; }
bool contains(IntervalStorageType point) const { return left <= point && point <= right; }
};
template <typename IntervalStorageType>
@ -290,7 +290,7 @@ private:
IntervalStorageType middle_element;
inline bool hasValue() const { return sorted_intervals_range_size != 0; }
bool hasValue() const { return sorted_intervals_range_size != 0; }
};
using IntervalWithEmptyValue = Interval;
@ -585,7 +585,7 @@ private:
}
}
inline size_t findFirstIteratorNodeIndex() const
size_t findFirstIteratorNodeIndex() const
{
size_t nodes_size = nodes.size();
size_t result_index = 0;
@ -602,7 +602,7 @@ private:
return result_index;
}
inline size_t findLastIteratorNodeIndex() const
size_t findLastIteratorNodeIndex() const
{
if (unlikely(nodes.empty()))
return 0;
@ -618,7 +618,7 @@ private:
return result_index;
}
inline void increaseIntervalsSize()
void increaseIntervalsSize()
{
/// Before tree is build we store all intervals size in our first node to allow tree iteration.
++intervals_size;
@ -630,7 +630,7 @@ private:
size_t intervals_size = 0;
bool tree_is_built = false;
static inline const Interval & getInterval(const IntervalWithValue & interval_with_value)
static const Interval & getInterval(const IntervalWithValue & interval_with_value)
{
if constexpr (is_empty_value)
return interval_with_value;
@ -639,7 +639,7 @@ private:
}
template <typename IntervalCallback>
static inline bool callCallback(const IntervalWithValue & interval, IntervalCallback && callback)
static bool callCallback(const IntervalWithValue & interval, IntervalCallback && callback)
{
if constexpr (is_empty_value)
return callback(interval);
@ -647,7 +647,7 @@ private:
return callback(interval.first, interval.second);
}
static inline void
static void
intervalsToPoints(const std::vector<IntervalWithValue> & intervals, std::vector<IntervalStorageType> & temporary_points_storage)
{
for (const auto & interval_with_value : intervals)
@ -658,7 +658,7 @@ private:
}
}
static inline IntervalStorageType pointsMedian(std::vector<IntervalStorageType> & points)
static IntervalStorageType pointsMedian(std::vector<IntervalStorageType> & points)
{
size_t size = points.size();
size_t middle_element_index = size / 2;

View File

@ -26,62 +26,62 @@ class SimdJSONBasicFormatter
{
public:
explicit SimdJSONBasicFormatter(PaddedPODArray<UInt8> & buffer_) : buffer(buffer_) {}
inline void comma() { oneChar(','); }
void comma() { oneChar(','); }
/** Start an array, prints [ **/
inline void startArray() { oneChar('['); }
void startArray() { oneChar('['); }
/** End an array, prints ] **/
inline void endArray() { oneChar(']'); }
void endArray() { oneChar(']'); }
/** Start an array, prints { **/
inline void startObject() { oneChar('{'); }
void startObject() { oneChar('{'); }
/** Start an array, prints } **/
inline void endObject() { oneChar('}'); }
void endObject() { oneChar('}'); }
/** Prints a true **/
inline void trueAtom()
void trueAtom()
{
const char * s = "true";
buffer.insert(s, s + 4);
}
/** Prints a false **/
inline void falseAtom()
void falseAtom()
{
const char * s = "false";
buffer.insert(s, s + 5);
}
/** Prints a null **/
inline void nullAtom()
void nullAtom()
{
const char * s = "null";
buffer.insert(s, s + 4);
}
/** Prints a number **/
inline void number(int64_t x)
void number(int64_t x)
{
char number_buffer[24];
auto res = std::to_chars(number_buffer, number_buffer + sizeof(number_buffer), x);
buffer.insert(number_buffer, res.ptr);
}
/** Prints a number **/
inline void number(uint64_t x)
void number(uint64_t x)
{
char number_buffer[24];
auto res = std::to_chars(number_buffer, number_buffer + sizeof(number_buffer), x);
buffer.insert(number_buffer, res.ptr);
}
/** Prints a number **/
inline void number(double x)
void number(double x)
{
char number_buffer[24];
auto res = std::to_chars(number_buffer, number_buffer + sizeof(number_buffer), x);
buffer.insert(number_buffer, res.ptr);
}
/** Prints a key (string + colon) **/
inline void key(std::string_view unescaped)
void key(std::string_view unescaped)
{
string(unescaped);
oneChar(':');
}
/** Prints a string. The string is escaped as needed. **/
inline void string(std::string_view unescaped)
void string(std::string_view unescaped)
{
oneChar('\"');
size_t i = 0;
@ -165,7 +165,7 @@ public:
oneChar('\"');
}
inline void oneChar(char c)
void oneChar(char c)
{
buffer.push_back(c);
}
@ -182,7 +182,7 @@ class SimdJSONElementFormatter
public:
explicit SimdJSONElementFormatter(PaddedPODArray<UInt8> & buffer_) : format(buffer_) {}
/** Append an element to the builder (to be printed) **/
inline void append(simdjson::dom::element value)
void append(simdjson::dom::element value)
{
switch (value.type())
{
@ -224,7 +224,7 @@ public:
}
}
/** Append an array to the builder (to be printed) **/
inline void append(simdjson::dom::array value)
void append(simdjson::dom::array value)
{
format.startArray();
auto iter = value.begin();
@ -241,7 +241,7 @@ public:
format.endArray();
}
inline void append(simdjson::dom::object value)
void append(simdjson::dom::object value)
{
format.startObject();
auto pair = value.begin();
@ -258,7 +258,7 @@ public:
format.endObject();
}
inline void append(simdjson::dom::key_value_pair kv)
void append(simdjson::dom::key_value_pair kv)
{
format.key(kv.key);
append(kv.value);

View File

@ -284,7 +284,7 @@ public:
}
template <typename It1, typename It2>
inline void assertNotIntersects(It1 from_begin [[maybe_unused]], It2 from_end [[maybe_unused]])
void assertNotIntersects(It1 from_begin [[maybe_unused]], It2 from_end [[maybe_unused]])
{
#if !defined(NDEBUG)
const char * ptr_begin = reinterpret_cast<const char *>(&*from_begin);

View File

@ -174,7 +174,7 @@ public:
items.emplace_back(std::make_shared<PooledObject>(allocObject(), *this));
}
inline size_t size()
size_t size()
{
std::lock_guard lock(mutex);
return items.size();

View File

@ -385,7 +385,7 @@ private:
* PASS is counted from least significant (0), so the first pass is NUM_PASSES - 1.
*/
template <size_t PASS>
static inline void radixSortMSDInternal(Element * arr, size_t size, size_t limit)
static void radixSortMSDInternal(Element * arr, size_t size, size_t limit)
{
/// The beginning of every i-1-th bucket. 0th element will be equal to 1st.
/// Last element will point to array end.
@ -528,7 +528,7 @@ private:
// A helper to choose sorting algorithm based on array length
template <size_t PASS>
static inline void radixSortMSDInternalHelper(Element * arr, size_t size, size_t limit)
static void radixSortMSDInternalHelper(Element * arr, size_t size, size_t limit)
{
if (size <= INSERTION_SORT_THRESHOLD)
insertionSortInternal(arr, size);

View File

@ -131,12 +131,12 @@ public:
~SpaceSaving() { destroyElements(); }
inline size_t size() const
size_t size() const
{
return counter_list.size();
}
inline size_t capacity() const
size_t capacity() const
{
return m_capacity;
}

View File

@ -107,7 +107,7 @@ struct RUsageCounters
}
private:
static inline UInt64 getClockMonotonic()
static UInt64 getClockMonotonic()
{
struct timespec ts;
if (0 != clock_gettime(CLOCK_MONOTONIC, &ts))

View File

@ -54,16 +54,16 @@ namespace VolnitskyTraits
/// min haystack size to use main algorithm instead of fallback
static constexpr size_t min_haystack_size_for_algorithm = 20000;
static inline bool isFallbackNeedle(const size_t needle_size, size_t haystack_size_hint = 0)
static bool isFallbackNeedle(const size_t needle_size, size_t haystack_size_hint = 0)
{
return needle_size < 2 * sizeof(Ngram) || needle_size >= std::numeric_limits<Offset>::max()
|| (haystack_size_hint && haystack_size_hint < min_haystack_size_for_algorithm);
}
static inline Ngram toNGram(const UInt8 * const pos) { return unalignedLoad<Ngram>(pos); }
static Ngram toNGram(const UInt8 * const pos) { return unalignedLoad<Ngram>(pos); }
template <typename Callback>
static inline bool putNGramASCIICaseInsensitive(const UInt8 * pos, int offset, Callback && putNGramBase)
static bool putNGramASCIICaseInsensitive(const UInt8 * pos, int offset, Callback && putNGramBase)
{
struct Chars
{
@ -115,7 +115,7 @@ namespace VolnitskyTraits
}
template <typename Callback>
static inline bool putNGramUTF8CaseInsensitive(
static bool putNGramUTF8CaseInsensitive(
const UInt8 * pos, int offset, const UInt8 * begin, size_t size, Callback && putNGramBase)
{
const UInt8 * end = begin + size;
@ -349,7 +349,7 @@ namespace VolnitskyTraits
}
template <bool CaseSensitive, bool ASCII, typename Callback>
static inline bool putNGram(const UInt8 * pos, int offset, [[maybe_unused]] const UInt8 * begin, size_t size, Callback && putNGramBase)
static bool putNGram(const UInt8 * pos, int offset, [[maybe_unused]] const UInt8 * begin, size_t size, Callback && putNGramBase)
{
if constexpr (CaseSensitive)
{
@ -580,7 +580,7 @@ public:
return true;
}
inline bool searchOne(const UInt8 * haystack, const UInt8 * haystack_end) const
bool searchOne(const UInt8 * haystack, const UInt8 * haystack_end) const
{
const size_t fallback_size = fallback_needles.size();
for (size_t i = 0; i < fallback_size; ++i)
@ -609,7 +609,7 @@ public:
return false;
}
inline size_t searchOneFirstIndex(const UInt8 * haystack, const UInt8 * haystack_end) const
size_t searchOneFirstIndex(const UInt8 * haystack, const UInt8 * haystack_end) const
{
const size_t fallback_size = fallback_needles.size();
@ -647,7 +647,7 @@ public:
}
template <typename CountCharsCallback>
inline UInt64 searchOneFirstPosition(const UInt8 * haystack, const UInt8 * haystack_end, const CountCharsCallback & count_chars) const
UInt64 searchOneFirstPosition(const UInt8 * haystack, const UInt8 * haystack_end, const CountCharsCallback & count_chars) const
{
const size_t fallback_size = fallback_needles.size();
@ -682,7 +682,7 @@ public:
}
template <typename CountCharsCallback, typename AnsType>
inline void searchOneAll(const UInt8 * haystack, const UInt8 * haystack_end, AnsType * answer, const CountCharsCallback & count_chars) const
void searchOneAll(const UInt8 * haystack, const UInt8 * haystack_end, AnsType * answer, const CountCharsCallback & count_chars) const
{
const size_t fallback_size = fallback_needles.size();
for (size_t i = 0; i < fallback_size; ++i)

View File

@ -491,12 +491,12 @@ public:
incrementErrorMetrics(code);
}
inline static Exception createDeprecated(const std::string & msg, Error code_)
static Exception createDeprecated(const std::string & msg, Error code_)
{
return Exception(msg, code_, 0);
}
inline static Exception fromPath(Error code_, const std::string & path)
static Exception fromPath(Error code_, const std::string & path)
{
return Exception(code_, "Coordination error: {}, path {}", errorMessage(code_), path);
}
@ -504,7 +504,7 @@ public:
/// Message must be a compile-time constant
template <typename T>
requires std::is_convertible_v<T, String>
inline static Exception fromMessage(Error code_, T && message)
static Exception fromMessage(Error code_, T && message)
{
return Exception(std::forward<T>(message), code_);
}

View File

@ -855,13 +855,13 @@ template <> struct Field::EnumToType<Field::Types::AggregateFunctionState> { usi
template <> struct Field::EnumToType<Field::Types::CustomType> { using Type = CustomType; };
template <> struct Field::EnumToType<Field::Types::Bool> { using Type = UInt64; };
inline constexpr bool isInt64OrUInt64FieldType(Field::Types::Which t)
constexpr bool isInt64OrUInt64FieldType(Field::Types::Which t)
{
return t == Field::Types::Int64
|| t == Field::Types::UInt64;
}
inline constexpr bool isInt64OrUInt64orBoolFieldType(Field::Types::Which t)
constexpr bool isInt64OrUInt64orBoolFieldType(Field::Types::Which t)
{
return t == Field::Types::Int64
|| t == Field::Types::UInt64

View File

@ -19,16 +19,16 @@ enum class JoinKind : uint8_t
const char * toString(JoinKind kind);
inline constexpr bool isLeft(JoinKind kind) { return kind == JoinKind::Left; }
inline constexpr bool isRight(JoinKind kind) { return kind == JoinKind::Right; }
inline constexpr bool isInner(JoinKind kind) { return kind == JoinKind::Inner; }
inline constexpr bool isFull(JoinKind kind) { return kind == JoinKind::Full; }
inline constexpr bool isCrossOrComma(JoinKind kind) { return kind == JoinKind::Comma || kind == JoinKind::Cross; }
inline constexpr bool isRightOrFull(JoinKind kind) { return kind == JoinKind::Right || kind == JoinKind::Full; }
inline constexpr bool isLeftOrFull(JoinKind kind) { return kind == JoinKind::Left || kind == JoinKind::Full; }
inline constexpr bool isInnerOrRight(JoinKind kind) { return kind == JoinKind::Inner || kind == JoinKind::Right; }
inline constexpr bool isInnerOrLeft(JoinKind kind) { return kind == JoinKind::Inner || kind == JoinKind::Left; }
inline constexpr bool isPaste(JoinKind kind) { return kind == JoinKind::Paste; }
constexpr bool isLeft(JoinKind kind) { return kind == JoinKind::Left; }
constexpr bool isRight(JoinKind kind) { return kind == JoinKind::Right; }
constexpr bool isInner(JoinKind kind) { return kind == JoinKind::Inner; }
constexpr bool isFull(JoinKind kind) { return kind == JoinKind::Full; }
constexpr bool isCrossOrComma(JoinKind kind) { return kind == JoinKind::Comma || kind == JoinKind::Cross; }
constexpr bool isRightOrFull(JoinKind kind) { return kind == JoinKind::Right || kind == JoinKind::Full; }
constexpr bool isLeftOrFull(JoinKind kind) { return kind == JoinKind::Left || kind == JoinKind::Full; }
constexpr bool isInnerOrRight(JoinKind kind) { return kind == JoinKind::Inner || kind == JoinKind::Right; }
constexpr bool isInnerOrLeft(JoinKind kind) { return kind == JoinKind::Inner || kind == JoinKind::Left; }
constexpr bool isPaste(JoinKind kind) { return kind == JoinKind::Paste; }
/// Allows more optimal JOIN for typical cases.
enum class JoinStrictness : uint8_t
@ -66,7 +66,7 @@ enum class ASOFJoinInequality : uint8_t
const char * toString(ASOFJoinInequality asof_join_inequality);
inline constexpr ASOFJoinInequality getASOFJoinInequality(std::string_view func_name)
constexpr ASOFJoinInequality getASOFJoinInequality(std::string_view func_name)
{
ASOFJoinInequality inequality = ASOFJoinInequality::None;
@ -82,7 +82,7 @@ inline constexpr ASOFJoinInequality getASOFJoinInequality(std::string_view func_
return inequality;
}
inline constexpr ASOFJoinInequality reverseASOFJoinInequality(ASOFJoinInequality inequality)
constexpr ASOFJoinInequality reverseASOFJoinInequality(ASOFJoinInequality inequality)
{
if (inequality == ASOFJoinInequality::Less)
return ASOFJoinInequality::Greater;

View File

@ -40,7 +40,7 @@ class BaseDaemon : public Poco::Util::ServerApplication, public Loggers
friend class SignalListener;
public:
static inline constexpr char DEFAULT_GRAPHITE_CONFIG_NAME[] = "graphite";
static constexpr char DEFAULT_GRAPHITE_CONFIG_NAME[] = "graphite";
BaseDaemon();
~BaseDaemon() override;

View File

@ -147,7 +147,7 @@ public:
static T getScaleMultiplier(UInt32 scale);
inline DecimalUtils::DataTypeDecimalTrait<T> getTrait() const
DecimalUtils::DataTypeDecimalTrait<T> getTrait() const
{
return {precision, scale};
}

View File

@ -754,7 +754,7 @@ private:
std::vector<Attribute> attributes;
inline void setCellDeadline(Cell & cell, TimePoint now)
void setCellDeadline(Cell & cell, TimePoint now)
{
if (configuration.lifetime.min_sec == 0 && configuration.lifetime.max_sec == 0)
{
@ -774,7 +774,7 @@ private:
cell.deadline = std::chrono::system_clock::to_time_t(deadline);
}
inline size_t getCellIndex(const KeyType key) const
size_t getCellIndex(const KeyType key) const
{
const size_t hash = DefaultHash<KeyType>()(key);
const size_t index = hash & size_overlap_mask;
@ -783,7 +783,7 @@ private:
using KeyStateAndCellIndex = std::pair<KeyState::State, size_t>;
inline KeyStateAndCellIndex getKeyStateAndCellIndex(const KeyType key, const time_t now) const
KeyStateAndCellIndex getKeyStateAndCellIndex(const KeyType key, const time_t now) const
{
size_t place_value = getCellIndex(key);
const size_t place_value_end = place_value + max_collision_length;
@ -810,7 +810,7 @@ private:
return std::make_pair(KeyState::not_found, place_value & size_overlap_mask);
}
inline size_t getCellIndexForInsert(const KeyType & key) const
size_t getCellIndexForInsert(const KeyType & key) const
{
size_t place_value = getCellIndex(key);
const size_t place_value_end = place_value + max_collision_length;

View File

@ -44,7 +44,7 @@ public:
{
}
inline bool isConstant() const { return default_values_column == nullptr; }
bool isConstant() const { return default_values_column == nullptr; }
Field getDefaultValue(size_t row) const
{
@ -450,17 +450,17 @@ public:
keys_size = key_columns.front()->size();
}
inline size_t getKeysSize() const
size_t getKeysSize() const
{
return keys_size;
}
inline size_t getCurrentKeyIndex() const
size_t getCurrentKeyIndex() const
{
return current_key_index;
}
inline KeyType extractCurrentKey()
KeyType extractCurrentKey()
{
assert(current_key_index < keys_size);

View File

@ -48,14 +48,14 @@ public:
};
private:
static inline constexpr const char * languages[] =
static constexpr const char * languages[] =
{
#define M(NAME, FALLBACK, NUM) #NAME,
FOR_EACH_LANGUAGE(M)
#undef M
};
static inline constexpr Language fallbacks[] =
static constexpr Language fallbacks[] =
{
#define M(NAME, FALLBACK, NUM) Language::FALLBACK,
FOR_EACH_LANGUAGE(M)

View File

@ -26,15 +26,15 @@ struct KeyState
: state(state_)
{}
inline bool isFound() const { return state == State::found; }
inline bool isExpired() const { return state == State::expired; }
inline bool isNotFound() const { return state == State::not_found; }
inline bool isDefault() const { return is_default; }
inline void setDefault() { is_default = true; }
inline void setDefaultValue(bool is_default_value) { is_default = is_default_value; }
bool isFound() const { return state == State::found; }
bool isExpired() const { return state == State::expired; }
bool isNotFound() const { return state == State::not_found; }
bool isDefault() const { return is_default; }
void setDefault() { is_default = true; }
void setDefaultValue(bool is_default_value) { is_default = is_default_value; }
/// Valid only if keyState is found or expired
inline size_t getFetchedColumnIndex() const { return fetched_column_index; }
inline void setFetchedColumnIndex(size_t fetched_column_index_value) { fetched_column_index = fetched_column_index_value; }
size_t getFetchedColumnIndex() const { return fetched_column_index; }
void setFetchedColumnIndex(size_t fetched_column_index_value) { fetched_column_index = fetched_column_index_value; }
private:
State state = not_found;
size_t fetched_column_index = 0;

View File

@ -66,7 +66,7 @@ namespace
return buf;
}
inline UInt8 prefixIPv6() const
UInt8 prefixIPv6() const
{
return isv6 ? prefix : prefix + 96;
}

View File

@ -474,7 +474,7 @@ public:
}
// Checks if no more values can be added for a given attribute
inline bool full(const String & attr_name, std::unordered_set<String> * const defaults = nullptr) const
bool full(const String & attr_name, std::unordered_set<String> * const defaults = nullptr) const
{
if (collect_values_limit)
{
@ -490,7 +490,7 @@ public:
}
// Returns the number of full attributes
inline size_t attributesFull() const { return n_full_attributes; }
size_t attributesFull() const { return n_full_attributes; }
};
std::pair<String, bool> processBackRefs(const String & data, const re2::RE2 & searcher, const std::vector<StringPiece> & pieces)

View File

@ -134,7 +134,7 @@ public:
/// Reset block with new block_data
/// block_data must be filled with zeroes if it is new block
inline void reset(char * new_block_data)
void reset(char * new_block_data)
{
block_data = new_block_data;
current_block_offset = block_header_size;
@ -142,13 +142,13 @@ public:
}
/// Check if it is enough place to write key in block
inline bool enoughtPlaceToWriteKey(const SSDCacheSimpleKey & cache_key) const
bool enoughtPlaceToWriteKey(const SSDCacheSimpleKey & cache_key) const
{
return (current_block_offset + (sizeof(cache_key.key) + sizeof(cache_key.size) + cache_key.size)) <= block_size;
}
/// Check if it is enough place to write key in block
inline bool enoughtPlaceToWriteKey(const SSDCacheComplexKey & cache_key) const
bool enoughtPlaceToWriteKey(const SSDCacheComplexKey & cache_key) const
{
const StringRef & key = cache_key.key;
size_t complex_key_size = sizeof(key.size) + key.size;
@ -159,7 +159,7 @@ public:
/// Write key and returns offset in ssd cache block where data is written
/// It is client responsibility to check if there is enough place in block to write key
/// Returns true if key was written and false if there was not enough place to write key
inline bool writeKey(const SSDCacheSimpleKey & cache_key, size_t & offset_in_block)
bool writeKey(const SSDCacheSimpleKey & cache_key, size_t & offset_in_block)
{
assert(cache_key.size > 0);
@ -188,7 +188,7 @@ public:
return true;
}
inline bool writeKey(const SSDCacheComplexKey & cache_key, size_t & offset_in_block)
bool writeKey(const SSDCacheComplexKey & cache_key, size_t & offset_in_block)
{
assert(cache_key.size > 0);
@ -223,20 +223,20 @@ public:
return true;
}
inline size_t getKeysSize() const { return keys_size; }
size_t getKeysSize() const { return keys_size; }
/// Write keys size into block header
inline void writeKeysSize()
void writeKeysSize()
{
char * keys_size_offset_data = block_data + block_header_check_sum_size;
std::memcpy(keys_size_offset_data, &keys_size, sizeof(size_t));
}
/// Get check sum from block header
inline size_t getCheckSum() const { return unalignedLoad<size_t>(block_data); }
size_t getCheckSum() const { return unalignedLoad<size_t>(block_data); }
/// Calculate check sum in block
inline size_t calculateCheckSum() const
size_t calculateCheckSum() const
{
size_t calculated_check_sum = static_cast<size_t>(CityHash_v1_0_2::CityHash64(block_data + block_header_check_sum_size, block_size - block_header_check_sum_size));
@ -244,7 +244,7 @@ public:
}
/// Check if check sum from block header matched calculated check sum in block
inline bool checkCheckSum() const
bool checkCheckSum() const
{
size_t calculated_check_sum = calculateCheckSum();
size_t check_sum = getCheckSum();
@ -253,16 +253,16 @@ public:
}
/// Write check sum in block header
inline void writeCheckSum()
void writeCheckSum()
{
size_t check_sum = static_cast<size_t>(CityHash_v1_0_2::CityHash64(block_data + block_header_check_sum_size, block_size - block_header_check_sum_size));
std::memcpy(block_data, &check_sum, sizeof(size_t));
}
inline size_t getBlockSize() const { return block_size; }
size_t getBlockSize() const { return block_size; }
/// Returns block data
inline char * getBlockData() const { return block_data; }
char * getBlockData() const { return block_data; }
/// Read keys that were serialized in block
/// It is client responsibility to ensure that simple or complex keys were written in block
@ -405,16 +405,16 @@ public:
current_write_block.writeCheckSum();
}
inline char * getPlace(SSDCacheIndex index) const
char * getPlace(SSDCacheIndex index) const
{
return buffer.m_data + index.block_index * block_size + index.offset_in_block;
}
inline size_t getCurrentBlockIndex() const { return current_block_index; }
size_t getCurrentBlockIndex() const { return current_block_index; }
inline const char * getData() const { return buffer.m_data; }
const char * getData() const { return buffer.m_data; }
inline size_t getSizeInBytes() const { return block_size * partition_blocks_size; }
size_t getSizeInBytes() const { return block_size * partition_blocks_size; }
void readKeys(PaddedPODArray<KeyType> & keys) const
{
@ -431,7 +431,7 @@ public:
}
}
inline void reset()
void reset()
{
current_block_index = 0;
current_write_block.reset(buffer.m_data);
@ -750,9 +750,9 @@ public:
}
}
inline size_t getCurrentBlockIndex() const { return current_block_index; }
size_t getCurrentBlockIndex() const { return current_block_index; }
inline void reset()
void reset()
{
current_block_index = 0;
}
@ -788,7 +788,7 @@ private:
int fd = -1;
};
inline static int preallocateDiskSpace(int fd, size_t offset, size_t len)
static int preallocateDiskSpace(int fd, size_t offset, size_t len)
{
#if defined(OS_FREEBSD)
return posix_fallocate(fd, offset, len);
@ -797,7 +797,7 @@ private:
#endif
}
inline static char * getRequestBuffer(const iocb & request)
static char * getRequestBuffer(const iocb & request)
{
char * result = nullptr;
@ -810,7 +810,7 @@ private:
return result;
}
inline static ssize_t eventResult(io_event & event)
static ssize_t eventResult(io_event & event)
{
ssize_t bytes_written;
@ -985,9 +985,9 @@ private:
size_t in_memory_partition_index;
CellState state;
inline bool isInMemory() const { return state == in_memory; }
inline bool isOnDisk() const { return state == on_disk; }
inline bool isDefaultValue() const { return state == default_value; }
bool isInMemory() const { return state == in_memory; }
bool isOnDisk() const { return state == on_disk; }
bool isDefaultValue() const { return state == default_value; }
};
struct KeyToBlockOffset
@ -1366,7 +1366,7 @@ private:
}
}
inline void setCellDeadline(Cell & cell, TimePoint now)
void setCellDeadline(Cell & cell, TimePoint now)
{
if (configuration.lifetime.min_sec == 0 && configuration.lifetime.max_sec == 0)
{
@ -1383,7 +1383,7 @@ private:
cell.deadline = std::chrono::system_clock::to_time_t(deadline);
}
inline void eraseKeyFromIndex(KeyType key)
void eraseKeyFromIndex(KeyType key)
{
auto it = index.find(key);

View File

@ -61,12 +61,12 @@ private:
void monitorRing();
template<typename T> inline void failPromise(std::promise<T> & promise, const Exception & ex)
template<typename T> void failPromise(std::promise<T> & promise, const Exception & ex)
{
promise.set_exception(std::make_exception_ptr(ex));
}
inline std::future<Result> makeFailedResult(const Exception & ex)
std::future<Result> makeFailedResult(const Exception & ex)
{
auto promise = std::promise<Result>{};
failPromise(promise, ex);

View File

@ -68,7 +68,7 @@ struct DivideIntegralImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply(A a, B b)
static Result apply(A a, B b)
{
using CastA = std::conditional_t<is_big_int_v<B> && std::is_same_v<A, UInt8>, uint8_t, A>;
using CastB = std::conditional_t<is_big_int_v<A> && std::is_same_v<B, UInt8>, uint8_t, B>;
@ -120,7 +120,7 @@ struct ModuloImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply(A a, B b)
static Result apply(A a, B b)
{
if constexpr (std::is_floating_point_v<ResultType>)
{
@ -175,7 +175,7 @@ struct PositiveModuloImpl : ModuloImpl<A, B>
using ResultType = typename NumberTraits::ResultOfPositiveModulo<A, B>::Type;
template <typename Result = ResultType>
static inline Result apply(A a, B b)
static Result apply(A a, B b)
{
auto res = ModuloImpl<A, B>::template apply<OriginResultType>(a, b);
if constexpr (is_signed_v<A>)

View File

@ -284,7 +284,7 @@ struct BinaryOperation
private:
template <OpCase op_case>
static inline void apply(const A * __restrict a, const B * __restrict b, ResultType * __restrict c, size_t i)
static void apply(const A * __restrict a, const B * __restrict b, ResultType * __restrict c, size_t i)
{
if constexpr (op_case == OpCase::Vector)
c[i] = Op::template apply<ResultType>(a[i], b[i]);
@ -432,7 +432,7 @@ template <typename Op>
struct FixedStringReduceOperationImpl
{
template <OpCase op_case>
static void inline process(const UInt8 * __restrict a, const UInt8 * __restrict b, UInt16 * __restrict result, size_t size, size_t N)
static void process(const UInt8 * __restrict a, const UInt8 * __restrict b, UInt16 * __restrict result, size_t size, size_t N)
{
if constexpr (op_case == OpCase::Vector)
vectorVector(a, b, result, size, N);
@ -503,7 +503,7 @@ struct StringReduceOperationImpl
}
}
static inline UInt64 constConst(std::string_view a, std::string_view b)
static UInt64 constConst(std::string_view a, std::string_view b)
{
return process(
reinterpret_cast<const UInt8 *>(a.data()),
@ -643,7 +643,7 @@ public:
private:
template <OpCase op_case, typename ApplyFunc>
static inline void processWithRightNullmapImpl(const auto & a, const auto & b, ResultContainerType & c, size_t size, const NullMap * right_nullmap, ApplyFunc apply_func)
static void processWithRightNullmapImpl(const auto & a, const auto & b, ResultContainerType & c, size_t size, const NullMap * right_nullmap, ApplyFunc apply_func)
{
if (right_nullmap)
{

View File

@ -44,27 +44,27 @@ class DefaultJSONStringSerializer
public:
explicit DefaultJSONStringSerializer(ColumnString & col_str_) : col_str(col_str_) { }
inline void addRawData(const char * ptr, size_t len)
void addRawData(const char * ptr, size_t len)
{
out << std::string_view(ptr, len);
}
inline void addRawString(std::string_view str)
void addRawString(std::string_view str)
{
out << str;
}
/// serialize the json element into stringstream
inline void addElement(const Element & element)
void addElement(const Element & element)
{
out << element.getElement();
}
inline void commit()
void commit()
{
auto out_str = out.str();
col_str.insertData(out_str.data(), out_str.size());
}
inline void rollback() {}
void rollback() {}
private:
ColumnString & col_str;
std::stringstream out; // STYLE_CHECK_ALLOW_STD_STRING_STREAM
@ -82,27 +82,27 @@ public:
prev_offset = offsets.empty() ? 0 : offsets.back();
}
/// Put the data into column's buffer directly.
inline void addRawData(const char * ptr, size_t len)
void addRawData(const char * ptr, size_t len)
{
chars.insert(ptr, ptr + len);
}
inline void addRawString(std::string_view str)
void addRawString(std::string_view str)
{
chars.insert(str.data(), str.data() + str.size());
}
/// serialize the json element into column's buffer directly
inline void addElement(const Element & element)
void addElement(const Element & element)
{
formatter.append(element.getElement());
}
inline void commit()
void commit()
{
chars.push_back(0);
offsets.push_back(chars.size());
}
inline void rollback()
void rollback()
{
chars.resize(prev_offset);
}

View File

@ -59,7 +59,7 @@ enum class CipherMode : uint8_t
template <CipherMode mode>
struct KeyHolder
{
inline StringRef setKey(size_t cipher_key_size, StringRef key) const
StringRef setKey(size_t cipher_key_size, StringRef key) const
{
if (key.size != cipher_key_size)
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Invalid key size: {} expected {}", key.size, cipher_key_size);
@ -71,7 +71,7 @@ struct KeyHolder
template <>
struct KeyHolder<CipherMode::MySQLCompatibility>
{
inline StringRef setKey(size_t cipher_key_size, StringRef key)
StringRef setKey(size_t cipher_key_size, StringRef key)
{
if (key.size < cipher_key_size)
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Invalid key size: {} expected {}", key.size, cipher_key_size);

View File

@ -79,7 +79,7 @@ public:
private:
template <typename T>
inline static void writeBitmask(T x, WriteBuffer & out)
static void writeBitmask(T x, WriteBuffer & out)
{
using UnsignedT = make_unsigned_t<T>;
UnsignedT u_x = x;

View File

@ -785,7 +785,7 @@ private:
#include <emmintrin.h>
static inline void applyCIDRMask(const char * __restrict src, char * __restrict dst_lower, char * __restrict dst_upper, UInt8 bits_to_keep)
static void applyCIDRMask(const char * __restrict src, char * __restrict dst_lower, char * __restrict dst_upper, UInt8 bits_to_keep)
{
__m128i mask = _mm_loadu_si128(reinterpret_cast<const __m128i *>(getCIDRMaskIPv6(bits_to_keep).data()));
__m128i lower = _mm_and_si128(_mm_loadu_si128(reinterpret_cast<const __m128i *>(src)), mask);
@ -916,7 +916,7 @@ public:
class FunctionIPv4CIDRToRange : public IFunction
{
private:
static inline std::pair<UInt32, UInt32> applyCIDRMask(UInt32 src, UInt8 bits_to_keep)
static std::pair<UInt32, UInt32> applyCIDRMask(UInt32 src, UInt8 bits_to_keep)
{
if (bits_to_keep >= 8 * sizeof(UInt32))
return { src, src };

View File

@ -83,7 +83,7 @@ private:
using BucketsType = typename Impl::BucketsType;
template <typename T>
inline BucketsType checkBucketsRange(T buckets) const
BucketsType checkBucketsRange(T buckets) const
{
if (unlikely(buckets <= 0))
throw Exception(ErrorCodes::BAD_ARGUMENTS, "The second argument of function {} (number of buckets) must be positive number", getName());

View File

@ -170,7 +170,7 @@ public:
: vec(in[in.size() - N]->getData()), next(in) {}
/// Returns a combination of values in the i-th row of all columns stored in the constructor.
inline ResultValueType apply(const size_t i) const
ResultValueType apply(const size_t i) const
{
const auto a = !!vec[i];
return Op::apply(a, next.apply(i));
@ -190,7 +190,7 @@ public:
explicit AssociativeApplierImpl(const UInt8ColumnPtrs & in)
: vec(in[in.size() - 1]->getData()) {}
inline ResultValueType apply(const size_t i) const { return !!vec[i]; }
ResultValueType apply(const size_t i) const { return !!vec[i]; }
private:
const UInt8Container & vec;
@ -291,7 +291,7 @@ public:
}
/// Returns a combination of values in the i-th row of all columns stored in the constructor.
inline ResultValueType apply(const size_t i) const
ResultValueType apply(const size_t i) const
{
return Op::ternaryApply(vec[i], next.apply(i));
}
@ -315,7 +315,7 @@ public:
TernaryValueBuilder::build(in[in.size() - 1], vec.data());
}
inline ResultValueType apply(const size_t i) const { return vec[i]; }
ResultValueType apply(const size_t i) const { return vec[i]; }
private:
UInt8Container vec;

View File

@ -84,47 +84,47 @@ struct AndImpl
{
using ResultType = UInt8;
static inline constexpr bool isSaturable() { return true; }
static constexpr bool isSaturable() { return true; }
/// Final value in two-valued logic (no further operations with True, False will change this value)
static inline constexpr bool isSaturatedValue(bool a) { return !a; }
static constexpr bool isSaturatedValue(bool a) { return !a; }
/// Final value in three-valued logic (no further operations with True, False, Null will change this value)
static inline constexpr bool isSaturatedValueTernary(UInt8 a) { return a == Ternary::False; }
static constexpr bool isSaturatedValueTernary(UInt8 a) { return a == Ternary::False; }
static inline constexpr ResultType apply(UInt8 a, UInt8 b) { return a & b; }
static constexpr ResultType apply(UInt8 a, UInt8 b) { return a & b; }
static inline constexpr ResultType ternaryApply(UInt8 a, UInt8 b) { return std::min(a, b); }
static constexpr ResultType ternaryApply(UInt8 a, UInt8 b) { return std::min(a, b); }
/// Will use three-valued logic for NULLs (see above) or default implementation (any operation with NULL returns NULL).
static inline constexpr bool specialImplementationForNulls() { return true; }
static constexpr bool specialImplementationForNulls() { return true; }
};
struct OrImpl
{
using ResultType = UInt8;
static inline constexpr bool isSaturable() { return true; }
static inline constexpr bool isSaturatedValue(bool a) { return a; }
static inline constexpr bool isSaturatedValueTernary(UInt8 a) { return a == Ternary::True; }
static inline constexpr ResultType apply(UInt8 a, UInt8 b) { return a | b; }
static inline constexpr ResultType ternaryApply(UInt8 a, UInt8 b) { return std::max(a, b); }
static inline constexpr bool specialImplementationForNulls() { return true; }
static constexpr bool isSaturable() { return true; }
static constexpr bool isSaturatedValue(bool a) { return a; }
static constexpr bool isSaturatedValueTernary(UInt8 a) { return a == Ternary::True; }
static constexpr ResultType apply(UInt8 a, UInt8 b) { return a | b; }
static constexpr ResultType ternaryApply(UInt8 a, UInt8 b) { return std::max(a, b); }
static constexpr bool specialImplementationForNulls() { return true; }
};
struct XorImpl
{
using ResultType = UInt8;
static inline constexpr bool isSaturable() { return false; }
static inline constexpr bool isSaturatedValue(bool) { return false; }
static inline constexpr bool isSaturatedValueTernary(UInt8) { return false; }
static inline constexpr ResultType apply(UInt8 a, UInt8 b) { return a != b; }
static inline constexpr ResultType ternaryApply(UInt8 a, UInt8 b) { return a != b; }
static inline constexpr bool specialImplementationForNulls() { return false; }
static constexpr bool isSaturable() { return false; }
static constexpr bool isSaturatedValue(bool) { return false; }
static constexpr bool isSaturatedValueTernary(UInt8) { return false; }
static constexpr ResultType apply(UInt8 a, UInt8 b) { return a != b; }
static constexpr ResultType ternaryApply(UInt8 a, UInt8 b) { return a != b; }
static constexpr bool specialImplementationForNulls() { return false; }
#if USE_EMBEDDED_COMPILER
static inline llvm::Value * apply(llvm::IRBuilder<> & builder, llvm::Value * a, llvm::Value * b)
static llvm::Value * apply(llvm::IRBuilder<> & builder, llvm::Value * a, llvm::Value * b)
{
return builder.CreateXor(a, b);
}
@ -136,13 +136,13 @@ struct NotImpl
{
using ResultType = UInt8;
static inline ResultType apply(A a)
static ResultType apply(A a)
{
return !static_cast<bool>(a);
}
#if USE_EMBEDDED_COMPILER
static inline llvm::Value * apply(llvm::IRBuilder<> & builder, llvm::Value * a)
static llvm::Value * apply(llvm::IRBuilder<> & builder, llvm::Value * a)
{
return builder.CreateNot(a);
}

View File

@ -296,7 +296,7 @@ class FloatRoundingComputation : public BaseFloatRoundingComputation<T>
using Base = BaseFloatRoundingComputation<T>;
public:
static inline void compute(const T * __restrict in, const typename Base::VectorType & scale, T * __restrict out)
static void compute(const T * __restrict in, const typename Base::VectorType & scale, T * __restrict out)
{
auto val = Base::load(in);

View File

@ -275,7 +275,7 @@ struct NgramDistanceImpl
}
template <class Callback, class... Args>
static inline auto dispatchSearcher(Callback callback, Args &&... args)
static auto dispatchSearcher(Callback callback, Args &&... args)
{
if constexpr (!UTF8)
return callback(std::forward<Args>(args)..., readASCIICodePoints, calculateASCIIHash);

View File

@ -97,7 +97,7 @@ template<> \
template <> \
struct AddTime<IntervalKind::Kind::INTERVAL_KIND> \
{ \
static inline auto execute(UInt16 d, Int64 delta, const DateLUTImpl & time_zone) \
static auto execute(UInt16 d, Int64 delta, const DateLUTImpl & time_zone) \
{ \
return time_zone.add##INTERVAL_KIND##s(ExtendedDayNum(d), delta); \
} \
@ -110,7 +110,7 @@ template<> \
template <>
struct AddTime<IntervalKind::Kind::Week>
{
static inline NO_SANITIZE_UNDEFINED ExtendedDayNum execute(UInt16 d, UInt64 delta, const DateLUTImpl &)
static NO_SANITIZE_UNDEFINED ExtendedDayNum execute(UInt16 d, UInt64 delta, const DateLUTImpl &)
{
return ExtendedDayNum(static_cast<Int32>(d + delta * 7));
}
@ -120,7 +120,7 @@ template<> \
template <> \
struct AddTime<IntervalKind::Kind::INTERVAL_KIND> \
{ \
static inline NO_SANITIZE_UNDEFINED UInt32 execute(UInt32 t, Int64 delta, const DateLUTImpl &) \
static NO_SANITIZE_UNDEFINED UInt32 execute(UInt32 t, Int64 delta, const DateLUTImpl &) \
{ return static_cast<UInt32>(t + delta * (INTERVAL)); } \
};
ADD_TIME(Day, 86400)
@ -133,7 +133,7 @@ template<> \
template <> \
struct AddTime<IntervalKind::Kind::INTERVAL_KIND> \
{ \
static inline NO_SANITIZE_UNDEFINED Int64 execute(Int64 t, UInt64 delta, const UInt32 scale) \
static NO_SANITIZE_UNDEFINED Int64 execute(Int64 t, UInt64 delta, const UInt32 scale) \
{ \
if (scale < (DEF_SCALE)) \
{ \

View File

@ -26,7 +26,7 @@ struct GCDLCMImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply(A a, B b)
static Result apply(A a, B b)
{
throwIfDivisionLeadsToFPE(typename NumberTraits::ToInteger<A>::Type(a), typename NumberTraits::ToInteger<B>::Type(b));
throwIfDivisionLeadsToFPE(typename NumberTraits::ToInteger<B>::Type(b), typename NumberTraits::ToInteger<A>::Type(a));

View File

@ -20,12 +20,12 @@ namespace ErrorCodes
namespace
{
inline constexpr bool is_leap_year(int32_t year)
constexpr bool is_leap_year(int32_t year)
{
return (year % 4 == 0) && ((year % 400 == 0) || (year % 100 != 0));
}
inline constexpr uint8_t monthLength(bool is_leap_year, uint8_t month)
constexpr uint8_t monthLength(bool is_leap_year, uint8_t month)
{
switch (month)
{
@ -49,7 +49,7 @@ namespace
/** Integer division truncated toward negative infinity.
*/
template <typename I, typename J>
inline constexpr I div(I x, J y)
constexpr I div(I x, J y)
{
const auto y_cast = static_cast<I>(y);
if (x > 0 && y_cast < 0)
@ -63,7 +63,7 @@ namespace
/** Integer modulus, satisfying div(x, y)*y + mod(x, y) == x.
*/
template <typename I, typename J>
inline constexpr I mod(I x, J y)
constexpr I mod(I x, J y)
{
const auto y_cast = static_cast<I>(y);
const auto r = x % y_cast;
@ -76,7 +76,7 @@ namespace
/** Like std::min(), but the type of operands may differ.
*/
template <typename I, typename J>
inline constexpr I min(I x, J y)
constexpr I min(I x, J y)
{
const auto y_cast = static_cast<I>(y);
return x < y_cast ? x : y_cast;

View File

@ -53,7 +53,7 @@ public:
{}
template <typename ... Args>
inline auto NO_SANITIZE_UNDEFINED execute(const DateTime64 & t, Args && ... args) const
auto NO_SANITIZE_UNDEFINED execute(const DateTime64 & t, Args && ... args) const
{
/// Type conversion from float to integer may be required.
/// We are Ok with implementation specific result for out of range and denormals conversion.
@ -90,14 +90,14 @@ public:
template <typename T, typename... Args>
requires(!std::same_as<T, DateTime64>)
inline auto execute(const T & t, Args &&... args) const
auto execute(const T & t, Args &&... args) const
{
return wrapped_transform.execute(t, std::forward<Args>(args)...);
}
template <typename ... Args>
inline auto NO_SANITIZE_UNDEFINED executeExtendedResult(const DateTime64 & t, Args && ... args) const
auto NO_SANITIZE_UNDEFINED executeExtendedResult(const DateTime64 & t, Args && ... args) const
{
/// Type conversion from float to integer may be required.
/// We are Ok with implementation specific result for out of range and denormals conversion.
@ -131,7 +131,7 @@ public:
template <typename T, typename ... Args>
requires (!std::same_as<T, DateTime64>)
inline auto executeExtendedResult(const T & t, Args && ... args) const
auto executeExtendedResult(const T & t, Args && ... args) const
{
return wrapped_transform.executeExtendedResult(t, std::forward<Args>(args)...);
}

View File

@ -12,7 +12,7 @@ struct AbsImpl
using ResultType = std::conditional_t<is_decimal<A>, A, typename NumberTraits::ResultOfAbs<A>::Type>;
static constexpr bool allow_string_or_fixed_string = false;
static inline NO_SANITIZE_UNDEFINED ResultType apply(A a)
static NO_SANITIZE_UNDEFINED ResultType apply(A a)
{
if constexpr (is_decimal<A>)
return a < A(0) ? A(-a) : a;

View File

@ -322,7 +322,7 @@ private:
}
template <bool IsConst>
static inline void invokeCheckNullMaps(
static void invokeCheckNullMaps(
const ColumnString::Chars & data, const ColumnArray::Offsets & offsets,
const ColumnString::Offsets & str_offsets, const ColumnString::Chars & values,
OffsetT<IsConst> item_offsets,
@ -339,7 +339,7 @@ private:
}
public:
static inline void process(
static void process(
const ColumnString::Chars & data, const ColumnArray::Offsets & offsets,
const ColumnString::Offsets & string_offsets, const ColumnString::Chars & item_values,
Offset item_offsets, PaddedPODArray<ResultType> & result,
@ -348,7 +348,7 @@ public:
invokeCheckNullMaps<true>(data, offsets, string_offsets, item_values, item_offsets, result, data_map, item_map);
}
static inline void process(
static void process(
const ColumnString::Chars & data, const ColumnArray::Offsets & offsets,
const ColumnString::Offsets & string_offsets, const ColumnString::Chars & item_values,
const ColumnString::Offsets & item_offsets, PaddedPODArray<ResultType> & result,
@ -467,10 +467,10 @@ private:
NullMaps maps;
ResultColumnPtr result { ResultColumnType::create() };
inline void moveResult() { result_column = std::move(result); }
void moveResult() { result_column = std::move(result); }
};
static inline bool allowArguments(const DataTypePtr & inner_type, const DataTypePtr & arg)
static bool allowArguments(const DataTypePtr & inner_type, const DataTypePtr & arg)
{
auto inner_type_decayed = removeNullable(removeLowCardinality(inner_type));
auto arg_decayed = removeNullable(removeLowCardinality(arg));
@ -633,7 +633,7 @@ private:
* (s1, s1, s2, ...), (s2, s1, s2, ...), (s3, s1, s2, ...)
*/
template <typename... Integral>
static inline ColumnPtr executeIntegral(const ColumnsWithTypeAndName & arguments)
static ColumnPtr executeIntegral(const ColumnsWithTypeAndName & arguments)
{
const ColumnArray * const left = checkAndGetColumn<ColumnArray>(arguments[0].column.get());
@ -658,14 +658,14 @@ private:
}
template <typename... Integral>
static inline bool executeIntegral(ExecutionData& data)
static bool executeIntegral(ExecutionData& data)
{
return (executeIntegralExpanded<Integral, Integral...>(data) || ...);
}
/// Invoke executeIntegralImpl with such parameters: (A, other1), (A, other2), ...
template <typename A, typename... Other>
static inline bool executeIntegralExpanded(ExecutionData& data)
static bool executeIntegralExpanded(ExecutionData& data)
{
return (executeIntegralImpl<A, Other>(data) || ...);
}

View File

@ -25,19 +25,19 @@ struct L1Norm
struct ConstParams {};
template <typename ResultType>
inline static ResultType accumulate(ResultType result, ResultType value, const ConstParams &)
static ResultType accumulate(ResultType result, ResultType value, const ConstParams &)
{
return result + fabs(value);
}
template <typename ResultType>
inline static ResultType combine(ResultType result, ResultType other_result, const ConstParams &)
static ResultType combine(ResultType result, ResultType other_result, const ConstParams &)
{
return result + other_result;
}
template <typename ResultType>
inline static ResultType finalize(ResultType result, const ConstParams &)
static ResultType finalize(ResultType result, const ConstParams &)
{
return result;
}
@ -50,19 +50,19 @@ struct L2Norm
struct ConstParams {};
template <typename ResultType>
inline static ResultType accumulate(ResultType result, ResultType value, const ConstParams &)
static ResultType accumulate(ResultType result, ResultType value, const ConstParams &)
{
return result + value * value;
}
template <typename ResultType>
inline static ResultType combine(ResultType result, ResultType other_result, const ConstParams &)
static ResultType combine(ResultType result, ResultType other_result, const ConstParams &)
{
return result + other_result;
}
template <typename ResultType>
inline static ResultType finalize(ResultType result, const ConstParams &)
static ResultType finalize(ResultType result, const ConstParams &)
{
return sqrt(result);
}
@ -73,7 +73,7 @@ struct L2SquaredNorm : L2Norm
static constexpr auto name = "L2Squared";
template <typename ResultType>
inline static ResultType finalize(ResultType result, const ConstParams &)
static ResultType finalize(ResultType result, const ConstParams &)
{
return result;
}
@ -91,19 +91,19 @@ struct LpNorm
};
template <typename ResultType>
inline static ResultType accumulate(ResultType result, ResultType value, const ConstParams & params)
static ResultType accumulate(ResultType result, ResultType value, const ConstParams & params)
{
return result + static_cast<ResultType>(std::pow(fabs(value), params.power));
}
template <typename ResultType>
inline static ResultType combine(ResultType result, ResultType other_result, const ConstParams &)
static ResultType combine(ResultType result, ResultType other_result, const ConstParams &)
{
return result + other_result;
}
template <typename ResultType>
inline static ResultType finalize(ResultType result, const ConstParams & params)
static ResultType finalize(ResultType result, const ConstParams & params)
{
return static_cast<ResultType>(std::pow(result, params.inverted_power));
}
@ -116,19 +116,19 @@ struct LinfNorm
struct ConstParams {};
template <typename ResultType>
inline static ResultType accumulate(ResultType result, ResultType value, const ConstParams &)
static ResultType accumulate(ResultType result, ResultType value, const ConstParams &)
{
return fmax(result, fabs(value));
}
template <typename ResultType>
inline static ResultType combine(ResultType result, ResultType other_result, const ConstParams &)
static ResultType combine(ResultType result, ResultType other_result, const ConstParams &)
{
return fmax(result, other_result);
}
template <typename ResultType>
inline static ResultType finalize(ResultType result, const ConstParams &)
static ResultType finalize(ResultType result, const ConstParams &)
{
return result;
}

View File

@ -20,7 +20,7 @@ struct BitAndImpl
static constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply(A a, B b)
static Result apply(A a, B b)
{
return static_cast<Result>(a) & static_cast<Result>(b);
}
@ -28,7 +28,7 @@ struct BitAndImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
{
if (!left->getType()->isIntegerTy())
throw Exception(ErrorCodes::LOGICAL_ERROR, "BitAndImpl expected an integral type");

View File

@ -25,7 +25,7 @@ struct BitBoolMaskAndImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply([[maybe_unused]] A left, [[maybe_unused]] B right)
static Result apply([[maybe_unused]] A left, [[maybe_unused]] B right)
{
// Should be a logical error, but this function is callable from SQL.
// Need to investigate this.

View File

@ -25,7 +25,7 @@ struct BitBoolMaskOrImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply([[maybe_unused]] A left, [[maybe_unused]] B right)
static Result apply([[maybe_unused]] A left, [[maybe_unused]] B right)
{
if constexpr (!std::is_same_v<A, ResultType> || !std::is_same_v<B, ResultType>)
// Should be a logical error, but this function is callable from SQL.

View File

@ -13,7 +13,7 @@ struct BitCountImpl
using ResultType = std::conditional_t<(sizeof(A) * 8 >= 256), UInt16, UInt8>;
static constexpr bool allow_string_or_fixed_string = true;
static inline ResultType apply(A a)
static ResultType apply(A a)
{
/// We count bits in the value representation in memory. For example, we support floats.
/// We need to avoid sign-extension when converting signed numbers to larger type. So, uint8_t(-1) has 8 bits.

View File

@ -19,7 +19,7 @@ struct BitHammingDistanceImpl
static constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline NO_SANITIZE_UNDEFINED Result apply(A a, B b)
static NO_SANITIZE_UNDEFINED Result apply(A a, B b)
{
/// Note: it's unspecified if signed integers should be promoted with sign-extension or with zero-fill.
/// This behavior can change in the future.

View File

@ -19,7 +19,7 @@ struct BitNotImpl
using ResultType = typename NumberTraits::ResultOfBitNot<A>::Type;
static constexpr bool allow_string_or_fixed_string = true;
static inline ResultType NO_SANITIZE_UNDEFINED apply(A a)
static ResultType NO_SANITIZE_UNDEFINED apply(A a)
{
return ~static_cast<ResultType>(a);
}
@ -27,7 +27,7 @@ struct BitNotImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * arg, bool)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * arg, bool)
{
if (!arg->getType()->isIntegerTy())
throw Exception(ErrorCodes::LOGICAL_ERROR, "BitNotImpl expected an integral type");

View File

@ -19,7 +19,7 @@ struct BitOrImpl
static constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply(A a, B b)
static Result apply(A a, B b)
{
return static_cast<Result>(a) | static_cast<Result>(b);
}
@ -27,7 +27,7 @@ struct BitOrImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
{
if (!left->getType()->isIntegerTy())
throw Exception(ErrorCodes::LOGICAL_ERROR, "BitOrImpl expected an integral type");

View File

@ -20,7 +20,7 @@ struct BitRotateLeftImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline NO_SANITIZE_UNDEFINED Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
static NO_SANITIZE_UNDEFINED Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
{
if constexpr (is_big_int_v<A> || is_big_int_v<B>)
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Bit rotate is not implemented for big integers");
@ -32,7 +32,7 @@ struct BitRotateLeftImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
{
if (!left->getType()->isIntegerTy())
throw Exception(ErrorCodes::LOGICAL_ERROR, "BitRotateLeftImpl expected an integral type");

View File

@ -20,7 +20,7 @@ struct BitRotateRightImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline NO_SANITIZE_UNDEFINED Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
static NO_SANITIZE_UNDEFINED Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
{
if constexpr (is_big_int_v<A> || is_big_int_v<B>)
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Bit rotate is not implemented for big integers");
@ -32,7 +32,7 @@ struct BitRotateRightImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
{
if (!left->getType()->isIntegerTy())
throw Exception(ErrorCodes::LOGICAL_ERROR, "BitRotateRightImpl expected an integral type");

View File

@ -20,7 +20,7 @@ struct BitShiftLeftImpl
static const constexpr bool allow_string_integer = true;
template <typename Result = ResultType>
static inline NO_SANITIZE_UNDEFINED Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
static NO_SANITIZE_UNDEFINED Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
{
if constexpr (is_big_int_v<B>)
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "BitShiftLeft is not implemented for big integers as second argument");
@ -145,7 +145,7 @@ struct BitShiftLeftImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
{
if (!left->getType()->isIntegerTy())
throw Exception(ErrorCodes::LOGICAL_ERROR, "BitShiftLeftImpl expected an integral type");

View File

@ -21,7 +21,7 @@ struct BitShiftRightImpl
static const constexpr bool allow_string_integer = true;
template <typename Result = ResultType>
static inline NO_SANITIZE_UNDEFINED Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
static NO_SANITIZE_UNDEFINED Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
{
if constexpr (is_big_int_v<B>)
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "BitShiftRight is not implemented for big integers as second argument");
@ -31,7 +31,7 @@ struct BitShiftRightImpl
return static_cast<Result>(a) >> static_cast<Result>(b);
}
static inline NO_SANITIZE_UNDEFINED void bitShiftRightForBytes(const UInt8 * op_pointer, const UInt8 * begin, UInt8 * out, const size_t shift_right_bits)
static NO_SANITIZE_UNDEFINED void bitShiftRightForBytes(const UInt8 * op_pointer, const UInt8 * begin, UInt8 * out, const size_t shift_right_bits)
{
while (op_pointer > begin)
{
@ -123,7 +123,7 @@ struct BitShiftRightImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool is_signed)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool is_signed)
{
if (!left->getType()->isIntegerTy())
throw Exception(ErrorCodes::LOGICAL_ERROR, "BitShiftRightImpl expected an integral type");

View File

@ -21,7 +21,7 @@ struct BitSwapLastTwoImpl
using ResultType = UInt8;
static constexpr const bool allow_string_or_fixed_string = false;
static inline ResultType NO_SANITIZE_UNDEFINED apply([[maybe_unused]] A a)
static ResultType NO_SANITIZE_UNDEFINED apply([[maybe_unused]] A a)
{
if constexpr (!std::is_same_v<A, ResultType>)
// Should be a logical error, but this function is callable from SQL.
@ -35,7 +35,7 @@ struct BitSwapLastTwoImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * arg, bool)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * arg, bool)
{
if (!arg->getType()->isIntegerTy())
throw Exception(ErrorCodes::LOGICAL_ERROR, "__bitSwapLastTwo expected an integral type");

View File

@ -21,7 +21,7 @@ struct BitTestImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
NO_SANITIZE_UNDEFINED static inline Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
NO_SANITIZE_UNDEFINED static Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
{
if constexpr (is_big_int_v<A> || is_big_int_v<B>)
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "bitTest is not implemented for big integers as second argument");

View File

@ -9,7 +9,7 @@ namespace
struct BitTestAllImpl
{
template <typename A, typename B>
static inline UInt8 apply(A a, B b) { return (a & b) == b; }
static UInt8 apply(A a, B b) { return (a & b) == b; }
};
struct NameBitTestAll { static constexpr auto name = "bitTestAll"; };

View File

@ -9,7 +9,7 @@ namespace
struct BitTestAnyImpl
{
template <typename A, typename B>
static inline UInt8 apply(A a, B b) { return (a & b) != 0; }
static UInt8 apply(A a, B b) { return (a & b) != 0; }
};
struct NameBitTestAny { static constexpr auto name = "bitTestAny"; };

View File

@ -21,7 +21,7 @@ struct BitWrapperFuncImpl
using ResultType = UInt8;
static constexpr const bool allow_string_or_fixed_string = false;
static inline ResultType NO_SANITIZE_UNDEFINED apply(A a [[maybe_unused]])
static ResultType NO_SANITIZE_UNDEFINED apply(A a [[maybe_unused]])
{
// Should be a logical error, but this function is callable from SQL.
// Need to investigate this.

View File

@ -19,7 +19,7 @@ struct BitXorImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply(A a, B b)
static Result apply(A a, B b)
{
return static_cast<Result>(a) ^ static_cast<Result>(b);
}
@ -27,7 +27,7 @@ struct BitXorImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
{
if (!left->getType()->isIntegerTy())
throw Exception(ErrorCodes::LOGICAL_ERROR, "BitXorImpl expected an integral type");

View File

@ -214,7 +214,7 @@ private:
template <typename Time>
struct QuarterWriter
{
static inline void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
static void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
{
writeText(ToQuarterImpl::execute(source, timezone), buffer);
}
@ -223,7 +223,7 @@ private:
template <typename Time>
struct MonthWriter
{
static inline void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
static void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
{
const auto month = ToMonthImpl::execute(source, timezone);
static constexpr std::string_view month_names[] =
@ -249,7 +249,7 @@ private:
template <typename Time>
struct WeekWriter
{
static inline void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
static void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
{
writeText(ToISOWeekImpl::execute(source, timezone), buffer);
}
@ -258,7 +258,7 @@ private:
template <typename Time>
struct DayOfYearWriter
{
static inline void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
static void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
{
writeText(ToDayOfYearImpl::execute(source, timezone), buffer);
}
@ -267,7 +267,7 @@ private:
template <typename Time>
struct DayWriter
{
static inline void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
static void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
{
writeText(ToDayOfMonthImpl::execute(source, timezone), buffer);
}
@ -276,7 +276,7 @@ private:
template <typename Time>
struct WeekDayWriter
{
static inline void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
static void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
{
const auto day = ToDayOfWeekImpl::execute(source, 0, timezone);
static constexpr std::string_view day_names[] =
@ -297,7 +297,7 @@ private:
template <typename Time>
struct HourWriter
{
static inline void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
static void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
{
writeText(ToHourImpl::execute(source, timezone), buffer);
}
@ -306,7 +306,7 @@ private:
template <typename Time>
struct MinuteWriter
{
static inline void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
static void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
{
writeText(ToMinuteImpl::execute(source, timezone), buffer);
}
@ -315,7 +315,7 @@ private:
template <typename Time>
struct SecondWriter
{
static inline void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
static void write(WriteBuffer & buffer, Time source, const DateLUTImpl & timezone)
{
writeText(ToSecondImpl::execute(source, timezone), buffer);
}

View File

@ -16,7 +16,7 @@ struct DivideFloatingImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline NO_SANITIZE_UNDEFINED Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
static NO_SANITIZE_UNDEFINED Result apply(A a [[maybe_unused]], B b [[maybe_unused]])
{
return static_cast<Result>(a) / b;
}
@ -24,7 +24,7 @@ struct DivideFloatingImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool)
{
if (left->getType()->isIntegerTy())
throw Exception(ErrorCodes::LOGICAL_ERROR, "DivideFloatingImpl expected a floating-point type");

View File

@ -18,7 +18,7 @@ struct DivideDecimalsImpl
static constexpr auto name = "divideDecimal";
template <typename FirstType, typename SecondType>
static inline Decimal256
static Decimal256
execute(FirstType a, SecondType b, UInt16 scale_a, UInt16 scale_b, UInt16 result_scale)
{
if (b.value == 0)

View File

@ -19,7 +19,7 @@ struct FactorialImpl
static const constexpr bool allow_decimal = false;
static const constexpr bool allow_string_or_fixed_string = false;
static inline NO_SANITIZE_UNDEFINED ResultType apply(A a)
static NO_SANITIZE_UNDEFINED ResultType apply(A a)
{
if constexpr (std::is_floating_point_v<A> || is_over_big_int<A>)
throw Exception(

View File

@ -94,13 +94,13 @@ struct Impl
}
}
static inline NO_SANITIZE_UNDEFINED size_t toIndex(T x)
static NO_SANITIZE_UNDEFINED size_t toIndex(T x)
{
/// Implementation specific behaviour on overflow or infinite value.
return static_cast<size_t>(x);
}
static inline T degDiff(T f)
static T degDiff(T f)
{
f = std::abs(f);
if (f > 180)
@ -108,7 +108,7 @@ struct Impl
return f;
}
inline T fastCos(T x)
T fastCos(T x)
{
T y = std::abs(x) * (T(COS_LUT_SIZE) / T(PI) / T(2.0));
size_t i = toIndex(y);
@ -117,7 +117,7 @@ struct Impl
return cos_lut[i] + (cos_lut[i + 1] - cos_lut[i]) * y;
}
inline T fastSin(T x)
T fastSin(T x)
{
T y = std::abs(x) * (T(COS_LUT_SIZE) / T(PI) / T(2.0));
size_t i = toIndex(y);
@ -128,7 +128,7 @@ struct Impl
/// fast implementation of asin(sqrt(x))
/// max error in floats 0.00369%, in doubles 0.00072%
inline T fastAsinSqrt(T x)
T fastAsinSqrt(T x)
{
if (x < T(0.122))
{

View File

@ -15,7 +15,7 @@ struct GreatestBaseImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply(A a, B b)
static Result apply(A a, B b)
{
return static_cast<Result>(a) > static_cast<Result>(b) ?
static_cast<Result>(a) : static_cast<Result>(b);
@ -24,7 +24,7 @@ struct GreatestBaseImpl
#if USE_EMBEDDED_COMPILER
static constexpr bool compilable = true;
static inline llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool is_signed)
static llvm::Value * compile(llvm::IRBuilder<> & b, llvm::Value * left, llvm::Value * right, bool is_signed)
{
if (!left->getType()->isIntegerTy())
{
@ -46,7 +46,7 @@ struct GreatestSpecialImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply(A a, B b)
static Result apply(A a, B b)
{
static_assert(std::is_same_v<Result, ResultType>, "ResultType != Result");
return accurate::greaterOp(a, b) ? static_cast<Result>(a) : static_cast<Result>(b);

View File

@ -108,7 +108,7 @@ public:
/// suppress asan errors generated by the following:
/// 'NEW_ADJUSTMENT_III' defined in '../contrib/h3/src/h3lib/lib/algos.c:142:24
/// 'NEW_DIGIT_III' defined in '../contrib/h3/src/h3lib/lib/algos.c:121:24
__attribute__((no_sanitize_address)) static inline UInt64 getUnidirectionalEdge(const UInt64 origin, const UInt64 dest)
__attribute__((no_sanitize_address)) static UInt64 getUnidirectionalEdge(const UInt64 origin, const UInt64 dest)
{
const UInt64 res = cellsToDirectedEdge(origin, dest);
return res;

View File

@ -19,16 +19,16 @@ public:
explicit FunctionInitialQueryID(const String & initial_query_id_) : initial_query_id(initial_query_id_) {}
inline String getName() const override { return name; }
String getName() const override { return name; }
inline size_t getNumberOfArguments() const override { return 0; }
size_t getNumberOfArguments() const override { return 0; }
DataTypePtr getReturnTypeImpl(const DataTypes & /*arguments*/) const override
{
return std::make_shared<DataTypeString>();
}
inline bool isDeterministic() const override { return false; }
bool isDeterministic() const override { return false; }
bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return false; }

View File

@ -80,7 +80,7 @@ struct DivideIntegralByConstantImpl
private:
template <OpCase op_case>
static inline void apply(const A * __restrict a, const B * __restrict b, ResultType * __restrict c, size_t i)
static void apply(const A * __restrict a, const B * __restrict b, ResultType * __restrict c, size_t i)
{
if constexpr (op_case == OpCase::Vector)
c[i] = Op::template apply<ResultType>(a[i], b[i]);

View File

@ -13,7 +13,7 @@ struct DivideIntegralOrZeroImpl
static const constexpr bool allow_string_integer = false;
template <typename Result = ResultType>
static inline Result apply(A a, B b)
static Result apply(A a, B b)
{
if (unlikely(divisionLeadsToFPE(a, b)))
return 0;

Some files were not shown because too many files have changed in this diff Show More