diff options
author | Ryan Pavlik <rpavlik@iastate.edu> | 2011-11-02 17:33:38 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2012-01-04 06:53:54 (GMT) |
commit | 5ae8bdf49db36b2691ce545e3285f9ee64f92148 (patch) | |
tree | 5ef8285a7f6c54a35544903c05018fd0445aee30 /src/FbTk | |
parent | f859e78cb24cf69cc06e4395c58d804537f301c7 (diff) | |
download | fluxbox-5ae8bdf49db36b2691ce545e3285f9ee64f92148.zip fluxbox-5ae8bdf49db36b2691ce545e3285f9ee64f92148.tar.bz2 |
Pre-increment non-primitive types.
Found with cppcheck:
"Prefix ++/-- operators should be preferred for non-primitive
types. Pre-increment/decrement can be more efficient than
post-increment/decrement. Post-increment/decrement usually
involves keeping a copy of the previous value around and adds
a little extra code."
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/Font.cc | 4 | ||||
-rw-r--r-- | src/FbTk/ImageImlib2.cc | 2 | ||||
-rw-r--r-- | src/FbTk/Menu.cc | 2 | ||||
-rw-r--r-- | src/FbTk/STLUtil.hh | 2 | ||||
-rw-r--r-- | src/FbTk/Timer.cc | 2 | ||||
-rw-r--r-- | src/FbTk/TypeAhead.hh | 6 |
6 files changed, 9 insertions, 9 deletions
diff --git a/src/FbTk/Font.cc b/src/FbTk/Font.cc index f06e6f6..37621a8 100644 --- a/src/FbTk/Font.cc +++ b/src/FbTk/Font.cc | |||
@@ -117,7 +117,7 @@ void Font::shutdown() { | |||
117 | FontImp* font = fit->second; | 117 | FontImp* font = fit->second; |
118 | if (font) { | 118 | if (font) { |
119 | FontCacheIt it; | 119 | FontCacheIt it; |
120 | for (it = fit; it != font_cache.end(); it++) | 120 | for (it = fit; it != font_cache.end(); ++it) |
121 | if (it->second == font) | 121 | if (it->second == font) |
122 | it->second = 0; | 122 | it->second = 0; |
123 | delete font; | 123 | delete font; |
@@ -181,7 +181,7 @@ bool Font::load(const string &name) { | |||
181 | FbTk::StringUtil::stringtok<StringList>(names, name, "|"); | 181 | FbTk::StringUtil::stringtok<StringList>(names, name, "|"); |
182 | 182 | ||
183 | StringListIt name_it; | 183 | StringListIt name_it; |
184 | for (name_it = names.begin(); name_it != names.end(); name_it++) { | 184 | for (name_it = names.begin(); name_it != names.end(); ++name_it) { |
185 | FbTk::StringUtil::removeTrailingWhitespace(*name_it); | 185 | FbTk::StringUtil::removeTrailingWhitespace(*name_it); |
186 | FbTk::StringUtil::removeFirstWhitespace(*name_it); | 186 | FbTk::StringUtil::removeFirstWhitespace(*name_it); |
187 | 187 | ||
diff --git a/src/FbTk/ImageImlib2.cc b/src/FbTk/ImageImlib2.cc index 21202a1..af103bd 100644 --- a/src/FbTk/ImageImlib2.cc +++ b/src/FbTk/ImageImlib2.cc | |||
@@ -36,7 +36,7 @@ public: | |||
36 | 36 | ||
37 | std::map<int, Imlib_Context>::iterator it = this->begin(); | 37 | std::map<int, Imlib_Context>::iterator it = this->begin(); |
38 | std::map<int, Imlib_Context>::iterator it_end = this->end(); | 38 | std::map<int, Imlib_Context>::iterator it_end = this->end(); |
39 | for (; it != it_end; it++) { | 39 | for (; it != it_end; ++it) { |
40 | imlib_context_free(it->second); | 40 | imlib_context_free(it->second); |
41 | } | 41 | } |
42 | 42 | ||
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 40f81c8..671d32a 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc | |||
@@ -1361,7 +1361,7 @@ void Menu::resetTypeAhead() { | |||
1361 | m_type_ahead.reset(); | 1361 | m_type_ahead.reset(); |
1362 | m_matches.clear(); | 1362 | m_matches.clear(); |
1363 | 1363 | ||
1364 | for (; it != vec.end(); it++) | 1364 | for (; it != vec.end(); ++it) |
1365 | clearItem((*it)->getIndex(), true, 1); | 1365 | clearItem((*it)->getIndex(), true, 1); |
1366 | } | 1366 | } |
1367 | 1367 | ||
diff --git a/src/FbTk/STLUtil.hh b/src/FbTk/STLUtil.hh index b1007f7..abc5472 100644 --- a/src/FbTk/STLUtil.hh +++ b/src/FbTk/STLUtil.hh | |||
@@ -85,7 +85,7 @@ F forAllIf(C& c, I i, F f) { | |||
85 | typedef typename C::iterator iterator; | 85 | typedef typename C::iterator iterator; |
86 | iterator it = c.begin(); | 86 | iterator it = c.begin(); |
87 | iterator end = c.end(); | 87 | iterator end = c.end(); |
88 | for (; it != end; it++) { | 88 | for (; it != end; ++it) { |
89 | if (i(*it)) | 89 | if (i(*it)) |
90 | f(*it); | 90 | f(*it); |
91 | } | 91 | } |
diff --git a/src/FbTk/Timer.cc b/src/FbTk/Timer.cc index f34db08..8b144db 100644 --- a/src/FbTk/Timer.cc +++ b/src/FbTk/Timer.cc | |||
@@ -189,7 +189,7 @@ void Timer::updateTimers(int fd) { | |||
189 | 189 | ||
190 | time_t delta = last_time - now.tv_sec; | 190 | time_t delta = last_time - now.tv_sec; |
191 | 191 | ||
192 | for (it = m_timerlist.begin(); it != m_timerlist.end(); it++) { | 192 | for (it = m_timerlist.begin(); it != m_timerlist.end(); ++it) { |
193 | (*it)->m_start.tv_sec -= delta; | 193 | (*it)->m_start.tv_sec -= delta; |
194 | } | 194 | } |
195 | } | 195 | } |
diff --git a/src/FbTk/TypeAhead.hh b/src/FbTk/TypeAhead.hh index cac90a5..289587a 100644 --- a/src/FbTk/TypeAhead.hh +++ b/src/FbTk/TypeAhead.hh | |||
@@ -113,7 +113,7 @@ private: | |||
113 | Items const *m_ref; // reference to vector we are operating on | 113 | Items const *m_ref; // reference to vector we are operating on |
114 | 114 | ||
115 | void fillValues(BaseItems const &search, Items &fillin) const { | 115 | void fillValues(BaseItems const &search, Items &fillin) const { |
116 | for (BaseItemscIt it = search.begin(); it != search.end(); it++) { | 116 | for (BaseItemscIt it = search.begin(); it != search.end(); ++it) { |
117 | Item_Type tmp = dynamic_cast<Item_Type>(*it); | 117 | Item_Type tmp = dynamic_cast<Item_Type>(*it); |
118 | if (tmp) | 118 | if (tmp) |
119 | fillin.push_back(tmp); | 119 | fillin.push_back(tmp); |
@@ -153,7 +153,7 @@ private: | |||
153 | // iteration based on original list of items | 153 | // iteration based on original list of items |
154 | void doSearch(char to_test, Items const &items, | 154 | void doSearch(char to_test, Items const &items, |
155 | SearchResult &mySearchResult) const { | 155 | SearchResult &mySearchResult) const { |
156 | for (ItemscIt it = items.begin(); it != items.end(); it++) { | 156 | for (ItemscIt it = items.begin(); it != items.end(); ++it) { |
157 | if ((*it)->iTypeCompareChar(to_test, stringSize()) && (*it)->isEnabled()) | 157 | if ((*it)->iTypeCompareChar(to_test, stringSize()) && (*it)->isEnabled()) |
158 | mySearchResult.add(*it); | 158 | mySearchResult.add(*it); |
159 | } | 159 | } |
@@ -162,7 +162,7 @@ private: | |||
162 | // iteration based on last SearchResult | 162 | // iteration based on last SearchResult |
163 | void doSearch(char to_test, BaseItems const &search, | 163 | void doSearch(char to_test, BaseItems const &search, |
164 | SearchResult &mySearchResult) const { | 164 | SearchResult &mySearchResult) const { |
165 | for (BaseItemscIt it = search.begin(); it != search.end(); it++) { | 165 | for (BaseItemscIt it = search.begin(); it != search.end(); ++it) { |
166 | if ((*it)->iTypeCompareChar(to_test, stringSize()) && (*it)->isEnabled()) | 166 | if ((*it)->iTypeCompareChar(to_test, stringSize()) && (*it)->isEnabled()) |
167 | mySearchResult.add(*it); | 167 | mySearchResult.add(*it); |
168 | } | 168 | } |