~widelands-dev/widelands/bug-1377642-iterator-loops

« back to all changes in this revision

Viewing changes to src/logic/maptriangleregion.h

Merged lp:~widelands-dev/widelands/bug-986611-cppcheck-uninitialized-variables:
Initialize a bunch of uninitialized member variables, adding constructors where necessary. Turned some enums into enum classes. Removed empty string initializations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
private:
104
104
        Area<TCoords<FCoords>> area_;
105
105
        FCoords left_;
106
 
        uint16_t rowwidth_;
107
 
        uint16_t remaining_in_row_;
108
 
        uint16_t remaining_rows_;
 
106
        uint16_t rowwidth_ = 0;
 
107
        uint16_t remaining_in_row_ = 0;
 
108
        uint16_t remaining_rows_ = 0;
109
109
};
110
110
template <typename CoordsType> struct MapTriangleRegion<TCoords<CoordsType>> {
111
111
        MapTriangleRegion(const Map&, Area<TCoords<CoordsType>, uint16_t>);
117
117
        bool advance(const Map&);
118
118
 
119
119
private:
120
 
        const bool radius_is_odd_;
121
 
        enum { Top, Upper, Lower, Bottom } phase_;
122
 
        uint16_t remaining_rows_in_upper_phase_;
123
 
        uint16_t remaining_rows_in_lower_phase_;
124
 
        uint16_t row_length_, remaining_in_row_;
 
120
        const bool radius_is_odd_ = false;
 
121
        enum { Top, Upper, Lower, Bottom } phase_ = Top;
 
122
        uint16_t remaining_rows_in_upper_phase_ = 0U;
 
123
        uint16_t remaining_rows_in_lower_phase_ = 0U;
 
124
        uint16_t row_length_, remaining_in_row_ = 0U;
125
125
        CoordsType left_;
126
126
        TCoords<CoordsType> location_;
127
127
};