Skip to content

Commit

Permalink
use uint32_t instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Wen Sun committed Dec 6, 2022
1 parent 6d3431e commit 3182e02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/idl_gen_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2312,7 +2312,7 @@ class CppGenerator : public BaseGenerator {
code_ +=
" const {{INPUT_TYPE}} *curr_{{FIELD_NAME}} = {{FIELD_NAME}}();";
code_ +=
" for (auto i = 0; i < curr_{{FIELD_NAME}}->size(); i++) {";
" for (uint32_t i = 0; i < curr_{{FIELD_NAME}}->size(); i++) {";
code_ += " const auto lhs = curr_{{FIELD_NAME}}->Get(i);";
code_ += " const auto rhs = _{{FIELD_NAME}}->Get(i);";
code_ += " if(lhs != rhs) ";
Expand Down
4 changes: 2 additions & 2 deletions tests/key_field/key_field_sample_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) Baz FLATBUFFERS_FINAL_CLASS {
}
int KeyCompareWithValue(const flatbuffers::Array<uint8_t, 4> *_a) const {
const flatbuffers::Array<uint8_t, 4> *curr_a = a();
for (auto i = 0; i < curr_a->size(); i++) {
for (uint32_t i = 0; i < curr_a->size(); i++) {
const auto lhs = curr_a->Get(i);
const auto rhs = _a->Get(i);
if(lhs != rhs)
Expand Down Expand Up @@ -142,7 +142,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Bar FLATBUFFERS_FINAL_CLASS {
}
int KeyCompareWithValue(const flatbuffers::Array<float, 3> *_a) const {
const flatbuffers::Array<float, 3> *curr_a = a();
for (auto i = 0; i < curr_a->size(); i++) {
for (uint32_t i = 0; i < curr_a->size(); i++) {
const auto lhs = curr_a->Get(i);
const auto rhs = _a->Get(i);
if(lhs != rhs)
Expand Down

0 comments on commit 3182e02

Please sign in to comment.