Skip to content

Fix compiler warning (-Wchar-subscript) #1259

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

Merged
merged 1 commit into from
Jan 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ccstruct/seam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void SEAM::CombineWith(const SEAM& other) {
location_ += other.location_;
location_ /= 2;

for (int s = 0; s < other.num_splits_ && num_splits_ < kMaxNumSplits; ++s)
for (uint8_t s = 0; s < other.num_splits_ && num_splits_ < kMaxNumSplits; ++s)
splits_[num_splits_++] = other.splits_[s];
}

Expand Down
4 changes: 2 additions & 2 deletions ccstruct/seam.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class SEAM {

private:
// Maximum number of splits that a SEAM can hold.
static const int kMaxNumSplits = 3;
static const uint8_t kMaxNumSplits = 3;
// Priority of this split. Lower is better.
float priority_;
// Position of the middle of the seam.
Expand All @@ -189,7 +189,7 @@ class SEAM {
inT8 widthp_;
inT8 widthn_;
// Number of splits_ that are used.
inT8 num_splits_;
uint8_t num_splits_;
// Set of pairs of points that are the ends of each split in the SEAM.
SPLIT splits_[kMaxNumSplits];
};
Expand Down