Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[Feature](datatype) Add IPv4/v6 data type for doris#24965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
0b5f828ddd410fbb19475f5ab18f050900f960c27e8e0f586af9cb70a2810b84733eb5ca9ac740b8ae22958b0201f9ffccFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -83,7 +83,7 @@ class TypeInfo { | ||||||||||||||||||||||
| virtual void direct_copy(void* dest, const void* src) const = 0; | ||||||||||||||||||||||
| // Use only in zone map to cut data. | ||||||||||||||||||||||
| // Use only in zone map to cut data.StringParser::string_to_unsigned_int<uint32_t> | ||||||||||||||||||||||
| virtual void direct_copy_may_cut(void* dest, const void* src) const = 0; | ||||||||||||||||||||||
| virtual Status from_string(void* buf, const std::string& scan_key, const int precision = 0, | ||||||||||||||||||||||
| @@ -722,6 +722,16 @@ struct CppTypeTraits<FieldType::OLAP_FIELD_TYPE_DATETIME> { | ||||||||||||||||||||||
| using UnsignedCppType = uint64_t; | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
| template <> | ||||||||||||||||||||||
| struct CppTypeTraits<FieldType::OLAP_FIELD_TYPE_IPV4> { | ||||||||||||||||||||||
| using CppType = uint32_t; | ||||||||||||||||||||||
| using UnsignedCppType = uint32_t; | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
| template <> | ||||||||||||||||||||||
| struct CppTypeTraits<FieldType::OLAP_FIELD_TYPE_IPV6> { | ||||||||||||||||||||||
| using CppType = uint128_t; | ||||||||||||||||||||||
| using UnsignedCppType = uint128_t; | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
| template <> | ||||||||||||||||||||||
| struct CppTypeTraits<FieldType::OLAP_FIELD_TYPE_CHAR> { | ||||||||||||||||||||||
| using CppType = Slice; | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
| @@ -778,6 +788,8 @@ struct BaseFieldtypeTraits : public CppTypeTraits<field_type> { | ||||||||||||||||||||||
| static inline CppType get_cpp_type_value(const void* address) { | ||||||||||||||||||||||
| if constexpr (field_type == FieldType::OLAP_FIELD_TYPE_LARGEINT) { | ||||||||||||||||||||||
| return get_int128_from_unalign(address); | ||||||||||||||||||||||
| } else if constexpr (field_type == FieldType::OLAP_FIELD_TYPE_IPV6) { | ||||||||||||||||||||||
| return get_uint128_from_unalign(address); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| return *reinterpret_cast<const CppType*>(address); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| @@ -964,6 +976,101 @@ struct FieldTypeTraits<FieldType::OLAP_FIELD_TYPE_LARGEINT> | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
| template <> | ||||||||||||||||||||||
| struct FieldTypeTraits<FieldType::OLAP_FIELD_TYPE_IPV4> | ||||||||||||||||||||||
| : public BaseFieldtypeTraits<FieldType::OLAP_FIELD_TYPE_IPV4> { | ||||||||||||||||||||||
| static Status from_string(void* buf, const std::string& scan_key, const int precision, | ||||||||||||||||||||||
| const int scale) { | ||||||||||||||||||||||
| StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | ||||||||||||||||||||||
| uint32_t value = StringParser::string_to_unsigned_int<uint32_t>(scan_key.c_str(), | ||||||||||||||||||||||
| scan_key.size(), &result); | ||||||||||||||||||||||
| if (result == StringParser::PARSE_FAILURE) { | ||||||||||||||||||||||
| return Status::Error<ErrorCode::INVALID_ARGUMENT>( | ||||||||||||||||||||||
| "FieldTypeTraits<OLAP_FIELD_TYPE_IPV4>::from_string meet PARSE_FAILURE"); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| *reinterpret_cast<uint32_t*>(buf) = value; | ||||||||||||||||||||||
| return Status::OK(); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| static std::string to_string(const void* src) { | ||||||||||||||||||||||
| uint32_t value = *reinterpret_cast<const uint32_t*>(src); | ||||||||||||||||||||||
| std::stringstream ss; | ||||||||||||||||||||||
| ss << ((value >> 24) & 0xFF) << '.' << ((value >> 16) & 0xFF) << '.' | ||||||||||||||||||||||
| ||||||||||||||||||||||
| << ((value >> 8) & 0xFF) << '.' << (value & 0xFF); | ||||||||||||||||||||||
| ||||||||||||||||||||||
| return ss.str(); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
| template <> | ||||||||||||||||||||||
| struct FieldTypeTraits<FieldType::OLAP_FIELD_TYPE_IPV6> | ||||||||||||||||||||||
| : public BaseFieldtypeTraits<FieldType::OLAP_FIELD_TYPE_IPV6> { | ||||||||||||||||||||||
| static Status from_string(void* buf, const std::string& scan_key, const int precision, | ||||||||||||||||||||||
| const int scale) { | ||||||||||||||||||||||
| std::istringstream iss(scan_key); | ||||||||||||||||||||||
| std::string token; | ||||||||||||||||||||||
| uint128_t result = 0; | ||||||||||||||||||||||
| int count = 0; | ||||||||||||||||||||||
| while (std::getline(iss, token, ':')) { | ||||||||||||||||||||||
| if (token.empty()) { | ||||||||||||||||||||||
| count += 8 - count; | ||||||||||||||||||||||
| ||||||||||||||||||||||
| break; | ||||||||||||||||||||||
| ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| if (count > 8) { | ||||||||||||||||||||||
| ||||||||||||||||||||||
| return Status::Error<ErrorCode::INVALID_ARGUMENT>( | ||||||||||||||||||||||
| ||||||||||||||||||||||
| "FieldTypeTraits<OLAP_FIELD_TYPE_IPV6>::from_string meet PARSE_FAILURE"); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| uint16_t value = 0; | ||||||||||||||||||||||
| std::istringstream ss(token); | ||||||||||||||||||||||
| if (!(ss >> std::hex >> value)) { | ||||||||||||||||||||||
| return Status::Error<ErrorCode::INVALID_ARGUMENT>( | ||||||||||||||||||||||
| "FieldTypeTraits<OLAP_FIELD_TYPE_IPV6>::from_string meet PARSE_FAILURE"); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| result = (result << 16) | value; | ||||||||||||||||||||||
| ||||||||||||||||||||||
| count++; | ||||||||||||||||||||||
| ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| if (count < 8) { | ||||||||||||||||||||||
| ||||||||||||||||||||||
| return Status::Error<ErrorCode::INVALID_ARGUMENT>( | ||||||||||||||||||||||
| ||||||||||||||||||||||
| "FieldTypeTraits<OLAP_FIELD_TYPE_IPV6>::from_string meet PARSE_FAILURE"); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| *reinterpret_cast<uint128_t*>(buf) = result; | ||||||||||||||||||||||
| return Status::OK(); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| static std::string to_string(const void* src) { | ||||||||||||||||||||||
| std::stringstream result; | ||||||||||||||||||||||
sjyango marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||||||||||||||||||||||
| uint128_t ipv6 = *reinterpret_cast<const uint128_t*>(src); | ||||||||||||||||||||||
| for (int i = 0; i < 8; i++) { | ||||||||||||||||||||||
| ||||||||||||||||||||||
| uint16_t part = static_cast<uint16_t>((ipv6 >> (112 - i * 16)) & 0xFFFF); | ||||||||||||||||||||||
| ||||||||||||||||||||||
| uint16_tpart=static_cast<uint16_t>((ipv6 >> (112-i*16)) &0xFFFF); | |
| autopart=static_cast<uint16_t>((ipv6 >> (112-i*16)) &0xFFFF); |
ghostOct 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 112 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
uint16_t part = static_cast<uint16_t>((ipv6 >> (112 - i * 16)) & 0xFFFF);
^ghostOct 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 16 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
uint16_t part = static_cast<uint16_t>((ipv6 >> (112 - i * 16)) & 0xFFFF);
^ghostOct 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 0xFFFF is a magic number; consider replacing it with a named constant [readability-magic-numbers]
uint16_t part = static_cast<uint16_t>((ipv6 >> (112 - i * 16)) & 0xFFFF);
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 8 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
for (int i = 0; i < 8; i++) {
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
| result << std::to_string(part); | |
| auto part=static_cast<uint16_t>((ipv6 >> (112-i*16)) &0xFFFF); |
ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 112 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
uint16_t part = static_cast<uint16_t>((ipv6 >> (112 - i * 16)) & 0xFFFF);
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 16 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
uint16_t part = static_cast<uint16_t>((ipv6 >> (112 - i * 16)) & 0xFFFF);
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 0xFFFF is a magic number; consider replacing it with a named constant [readability-magic-numbers]
uint16_t part = static_cast<uint16_t>((ipv6 >> (112 - i * 16)) & 0xFFFF);
^ghostOct 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 7 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
if (i != 7) {
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 7 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
if (i != 7) {
^ghostOct 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 999999999999999999ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(999999999999999999ll) * 100000000000000000ll * 1000ll +
^ghostOct 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| static_cast<int128_t>(999999999999999999ll) *100000000000000000ll*1000ll+ | |
| static_cast<int128_t>(999999999999999999LL) *100000000000000000ll*1000ll+ |
ghostOct 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 100000000000000000ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(999999999999999999ll) * 100000000000000000ll * 1000ll +
^Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 1000ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(99999999999999999ll) * 1000ll + 999ll;
^ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| static_cast<int128_t>(99999999999999999ll) *1000ll+999ll; | |
| static_cast<int128_t>(99999999999999999ll) *1000LL+999ll; |
ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 999ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(99999999999999999ll) * 1000ll + 999ll;
^ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| static_cast<int128_t>(99999999999999999ll) *1000ll+999ll; | |
| static_cast<int128_t>(99999999999999999ll) *1000ll+999LL; |
ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 999999999999999999ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(999999999999999999ll) * 100000000000000000ll * 1000ll +
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| static_cast<int128_t>(99999999999999999ll) *1000ll+999ll; | |
| static_cast<int128_t>(999999999999999999LL) *100000000000000000ll*1000ll+ |
ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 100000000000000000ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(999999999999999999ll) * 100000000000000000ll * 1000ll +
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| static_cast<int128_t>(99999999999999999ll) *1000ll+999ll; | |
| static_cast<int128_t>(999999999999999999ll) *100000000000000000LL*1000ll+ |
ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 1000ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(999999999999999999ll) * 100000000000000000ll * 1000ll +
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| static_cast<int128_t>(99999999999999999ll) *1000ll+999ll; | |
| static_cast<int128_t>(999999999999999999ll) *100000000000000000ll*1000LL+ |
ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 99999999999999999ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(99999999999999999ll) * 1000ll + 999ll;
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| } | |
| static_cast<int128_t>(99999999999999999LL) *1000ll+999ll; |
ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 1000ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(99999999999999999ll) * 1000ll + 999ll;
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| } | |
| static_cast<int128_t>(99999999999999999ll) *1000LL+999ll; |
ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 999ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(99999999999999999ll) * 1000ll + 999ll;
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| } | |
| static_cast<int128_t>(99999999999999999ll) *1000ll+999LL; |
ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 999999999999999999ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
-(static_cast<int128_t>(999999999999999999ll) * 100000000000000000ll * 1000ll +
^ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| -(static_cast<int128_t>(999999999999999999ll) *100000000000000000ll*1000ll+ | |
| -(static_cast<int128_t>(999999999999999999LL) *100000000000000000ll*1000ll+ |
ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 100000000000000000ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
-(static_cast<int128_t>(999999999999999999ll) * 100000000000000000ll * 1000ll +
^ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| -(static_cast<int128_t>(999999999999999999ll) *100000000000000000ll*1000ll+ | |
| -(static_cast<int128_t>(999999999999999999ll) *100000000000000000LL*1000ll+ |
ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 1000ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
-(static_cast<int128_t>(999999999999999999ll) * 100000000000000000ll * 1000ll +
^ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| -(static_cast<int128_t>(999999999999999999ll) *100000000000000000ll*1000ll+ | |
| -(static_cast<int128_t>(999999999999999999ll) *100000000000000000ll*1000LL+ |
ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 99999999999999999ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(99999999999999999ll) * 1000ll + 999ll);
^ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| static_cast<int128_t>(99999999999999999ll) *1000ll+999ll); | |
| static_cast<int128_t>(99999999999999999LL) *1000ll+999ll); |
ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 1000ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(99999999999999999ll) * 1000ll + 999ll);
^ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| static_cast<int128_t>(99999999999999999ll) *1000ll+999ll); | |
| static_cast<int128_t>(99999999999999999ll) *1000LL+999ll); |
ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 999ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static_cast<int128_t>(99999999999999999ll) * 1000ll + 999ll);
^ghostOct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| static_cast<int128_t>(99999999999999999ll) *1000ll+999ll); | |
| static_cast<int128_t>(99999999999999999ll) *1000ll+999LL); |
ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 999999999999999999ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
-(static_cast<int128_t>(999999999999999999ll) * 100000000000000000ll * 1000ll +
^ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer literal has suffix 'll', which is not uppercase [readability-uppercase-literal-suffix]
| static_cast<int128_t>(99999999999999999ll) *1000ll+999ll); | |
| -(static_cast<int128_t>(999999999999999999LL) *100000000000000000ll*1000ll+ |
ghostOct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 100000000000000000ll is a magic number; consider replacing it with a named constant [readability-magic-numbers]
-(static_cast<int128_t>(999999999999999999ll) * 100000000000000000ll * 1000ll +
^Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.