Skip to content

Commit

Permalink
FPRow: Add missing initialisation for scalar (CID 1402754)
Browse files Browse the repository at this point in the history
Modernize the code also a little bit.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jul 10, 2019
1 parent bdc7abf commit 2aebd10
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/textord/cjkpitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,8 @@ class FPChar {
// FPChar's.
class FPRow {
public:
FPRow() : pitch_(0.0f), estimated_pitch_(0.0f),
all_pitches_(), all_gaps_(), good_pitches_(), good_gaps_(),
heights_(), characters_(), real_row_(nullptr) {
FPRow() : all_pitches_(), all_gaps_(), good_pitches_(), good_gaps_(),
heights_(), characters_() {
}

~FPRow() { }
Expand Down Expand Up @@ -439,11 +438,11 @@ class FPRow {
characters_.truncate(index);
}

float pitch_; // Character pitch.
float estimated_pitch_; // equal to pitch_ if pitch_ is considered
float pitch_ = 0.0f; // Character pitch.
float estimated_pitch_ = 0.0f; // equal to pitch_ if pitch_ is considered
// to be good enough.
float height_; // Character height.
float gap_; // Minimum gap between characters.
float height_ = 0.0f; // Character height.
float gap_ = 0.0f; // Minimum gap between characters.

// Pitches between any two successive characters.
SimpleStats all_pitches_;
Expand All @@ -459,7 +458,7 @@ class FPRow {
SimpleStats heights_;

GenericVector<FPChar> characters_;
TO_ROW *real_row_; // Underlying TD_ROW for this row.
TO_ROW *real_row_ = nullptr; // Underlying TD_ROW for this row.
};

void FPRow::Init(TO_ROW *row) {
Expand Down

0 comments on commit 2aebd10

Please sign in to comment.