diff --git a/libs/main/containers/pimap.h b/libs/main/containers/pimap.h index 5f4e0ccb..7740c638 100644 --- a/libs/main/containers/pimap.h +++ b/libs/main/containers/pimap.h @@ -85,7 +85,7 @@ public: const PIMap * parent; ssize_t pos; public: - iterator(): parent(0), pos(0) {} + iterator(): parent(nullptr), pos(0) {} const Key & key() const {return const_cast * >(parent)->_key(pos);} T & value() {return const_cast * >(parent)->_value(pos);} inline PIPair operator *() const {return PIPair(const_cast * >(parent)->_key(pos), const_cast * >(parent)->_value(pos));} @@ -104,7 +104,7 @@ public: const PIMap * parent; ssize_t pos; public: - reverse_iterator(): parent(0), pos(0) {} + reverse_iterator(): parent(nullptr), pos(0) {} const Key & key() const {return const_cast * >(parent)->_key(pos);} T & value() const {return const_cast * >(parent)->_value(pos);} inline PIPair operator *() const {return PIPair(const_cast * >(parent)->_key(pos), const_cast * >(parent)->_value(pos));} @@ -123,9 +123,8 @@ public: const PIMap * parent; ssize_t pos; public: - const_iterator(): parent(0), pos(0) {} + const_iterator(): parent(nullptr), pos(0) {} const value_type operator *() const {return parent->_pair(pos);} - //const value_type* operator ->() const {cval = parent->_pair(pos); return &cval;} const Key & key() const {return const_cast * >(parent)->_key(pos);} const T & value() const {return const_cast * >(parent)->_value(pos);} void operator ++() {++pos;} @@ -134,7 +133,6 @@ public: void operator --(int) {--pos;} bool operator ==(const const_iterator & it) const {return (pos == it.pos);} bool operator !=(const const_iterator & it) const {return (pos != it.pos);} - //mutable value_type cval; }; class const_reverse_iterator { @@ -144,16 +142,14 @@ public: const PIMap * parent; ssize_t pos; public: - const_reverse_iterator(): parent(0), pos(0) {} + const_reverse_iterator(): parent(nullptr), pos(0) {} const value_type operator *() const {return parent->_pair(pos);} - //const value_type* operator ->() const {cval = parent->_pair(pos); return &cval;} void operator ++() {--pos;} void operator ++(int) {--pos;} void operator --() {++pos;} void operator --(int) {++pos;} bool operator ==(const const_reverse_iterator & it) const {return (pos == it.pos);} bool operator !=(const const_reverse_iterator & it) const {return (pos != it.pos);} - //mutable value_type cval; }; iterator begin() {return iterator(this, 0);} @@ -198,8 +194,9 @@ public: if (other.isEmpty()) return *this; if (other.size() == 1) {insert(other.pim_index[0].key, other.pim_content[0]); return *this;} if (other.size() == 2) {insert(other.pim_index[0].key, other.pim_content[0]); insert(other.pim_index[1].key, other.pim_content[1]); return *this;} - for (int i = 0; i < other.pim_index.size_s(); ++i) + for (int i = 0; i < other.pim_index.size_s(); ++i) { insert(other.pim_index[i].key, other.pim_content[other.pim_index[i].index]); + } return *this; } diff --git a/libs/main/core/picout.cpp b/libs/main/core/picout.cpp index 155c8889..d41e9ec8 100644 --- a/libs/main/core/picout.cpp +++ b/libs/main/core/picout.cpp @@ -330,8 +330,7 @@ PICout PICout::operator <<(const PIFlags & v) #define PINUMERICCOUT(v) { \ if (!act_) return *this; \ space(); \ - if (cnb_ == 10) PICOUTTOTARGET(v) \ - else write(PIString::fromNumber(v, cnb_)); \ + write(PIString::fromNumber(v, cnb_)); \ return *this; \ } @@ -543,8 +542,7 @@ PICout & PICout::write(const PIString & s) { if (buffer_) { buffer_->append(s); } else { - if (PICout::isOutputDeviceActive(PICout::StdOut)) - stdoutPIString(s); + if (PICout::isOutputDeviceActive(PICout::StdOut)) stdoutPIString(s); if (PICout::isOutputDeviceActive(PICout::Buffer)) PICout::__string__().append(s); } return *this;