-
Notifications
You must be signed in to change notification settings - Fork 0
Json parse helper funcs #34
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
base: type_def_for_support_schema
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
92f3a0b to
640d5d7
Compare
0251b9b to
442c3b2
Compare
640d5d7 to
cc58712
Compare
442c3b2 to
5a22544
Compare
cc58712 to
c4b07ee
Compare
5a22544 to
16f7abf
Compare
update todo: head include update util func store as bigendian helper funcs update pase json filed value helper func fix parse json field value func check the value boundary when parse json value
c4b07ee to
2dbff16
Compare
16f7abf to
0959153
Compare
| std::memcpy(to, ptr, len); | ||
| #else | ||
| // sign bit | ||
| to[0] = (char) (ptr[len - 1] ^ 128); |
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.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use static_cast(...) instead [readability/casting] [4]
| } | ||
| else | ||
| { /* Set high and move exponent one up */ | ||
| uint16_t exp_part = (((uint16_t) tmp[0] << 8) | (uint16_t) tmp[1] | |
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.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use static_cast<uint16_t>(...) instead [readability/casting] [4]
| else | ||
| { /* Set high and move exponent one up */ | ||
| uint16_t exp_part = (((uint16_t) tmp[0] << 8) | (uint16_t) tmp[1] | | ||
| (uint16_t) 32768); |
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.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use static_cast<uint16_t>(...) instead [readability/casting] [4]
| { /* Set high and move exponent one up */ | ||
| uint16_t exp_part = (((uint16_t) tmp[0] << 8) | (uint16_t) tmp[1] | | ||
| (uint16_t) 32768); | ||
| exp_part += (uint16_t) 1 << (16 - 1 - DBL_EXP_DIG); |
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.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use static_cast<uint16_t>(...) instead [readability/casting] [4]
| // Parse json field value to binary value based on field type | ||
| static inline bool ParseJSONFieldValue(const nlohmann::json &json_value, | ||
| MetadataFieldType field_type, | ||
| std::vector<char> &buf) |
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.
[cpplint] reported by reviewdog 🐶
Add #include for vector<> [build/include_what_you_use] [4]
| } | ||
| int64_t val = json_value.get<int64_t>(); | ||
| if (val < std::numeric_limits<int64_t>::min() || | ||
| val > std::numeric_limits<int64_t>::max()) |
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.
[cpplint] reported by reviewdog 🐶
Add #include for numeric_limits<> [build/include_what_you_use] [4]
| { | ||
| return false; | ||
| } | ||
| std::string str = json_value.get<std::string>(); |
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.
[cpplint] reported by reviewdog 🐶
Add #include for string [build/include_what_you_use] [4]
| std::memcpy(buf.data() + buf.size() - len_size - str_len, | ||
| str_len_ptr, | ||
| len_size); | ||
| std::copy(str.begin(), str.end(), buf.data() + buf.size() - str_len); |
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.
[cpplint] reported by reviewdog 🐶
Add #include for copy [build/include_what_you_use] [4]
| return true; | ||
| } | ||
|
|
||
| } // namespace EloqVec No newline at end of file |
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.
[cpplint] reported by reviewdog 🐶
Could not find a newline character at the end of the file. [whitespace/ending_newline] [5]
No description provided.