summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-16 14:28:30 +0000
committerthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-16 14:28:30 +0000
commitf07467d2f7344af716a90df0b54573b4fd9967e3 (patch)
treec8ae35b12a8e0f88b29ae5cb0e86d995a36154db
parent7b862a32d4f20c96e2a98c39e26b4c6b77f9e1cc (diff)
downloadchromium_src-f07467d2f7344af716a90df0b54573b4fd9967e3.zip
chromium_src-f07467d2f7344af716a90df0b54573b4fd9967e3.tar.gz
chromium_src-f07467d2f7344af716a90df0b54573b4fd9967e3.tar.bz2
Working towards -Wextra
- Make loops use {} instead of a ';' to make it clear there is no body to the loop. - Remove checks of unsigned values for <0 - coordinates should be CGFloat, not NSUInteger. BUG=34160 TEST=none Review URL: http://codereview.chromium.org/2865003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49939 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/third_party/dmg_fp/README.chromium1
-rw-r--r--base/third_party/dmg_fp/dtoa.cc4
-rw-r--r--base/third_party/dmg_fp/g_fmt.cc6
-rw-r--r--base/third_party/dmg_fp/mac_wextra.patch53
-rw-r--r--chrome/browser/automation/automation_provider.cc2
-rw-r--r--chrome/browser/cocoa/objc_zombie.mm3
-rw-r--r--chrome/browser/privacy_blacklist/blacklist.cc2
-rw-r--r--chrome/browser/sessions/tab_restore_service.cc2
-rw-r--r--chrome/renderer/pepper_plugin_delegate_impl.h1
-rw-r--r--gpu/command_buffer/common/id_allocator.cc2
-rwxr-xr-xnet/base/cookie_monster.cc6
-rw-r--r--net/http/http_response_headers.cc6
12 files changed, 70 insertions, 18 deletions
diff --git a/base/third_party/dmg_fp/README.chromium b/base/third_party/dmg_fp/README.chromium
index d151349..f52c96a 100644
--- a/base/third_party/dmg_fp/README.chromium
+++ b/base/third_party/dmg_fp/README.chromium
@@ -13,3 +13,4 @@ List of changes made to original code:
- made some minor changes to allow clean compilation under g++ -Wall, see
gcc_warnings.patch.
- made some minor changes to build on 64-bit, see gcc_64_bit.patch.
+ - made minor changes for -Wextra for Mac build, see mac_wextra.patch
diff --git a/base/third_party/dmg_fp/dtoa.cc b/base/third_party/dmg_fp/dtoa.cc
index c1bc476..3f7e794 100644
--- a/base/third_party/dmg_fp/dtoa.cc
+++ b/base/third_party/dmg_fp/dtoa.cc
@@ -3863,7 +3863,7 @@ dtoa
if (dval(&u) > 0.5 + dval(&eps))
goto bump_up;
else if (dval(&u) < 0.5 - dval(&eps)) {
- while(*--s == '0');
+ while(*--s == '0') {}
s++;
goto ret1;
}
@@ -4176,7 +4176,7 @@ dtoa
#ifdef Honor_FLT_ROUNDS
trimzeros:
#endif
- while(*--s == '0');
+ while(*--s == '0') {}
s++;
}
ret:
diff --git a/base/third_party/dmg_fp/g_fmt.cc b/base/third_party/dmg_fp/g_fmt.cc
index 7f3c881..d864eb7 100644
--- a/base/third_party/dmg_fp/g_fmt.cc
+++ b/base/third_party/dmg_fp/g_fmt.cc
@@ -46,7 +46,7 @@ g_fmt(register char *b, double x)
if (sign)
*b++ = '-';
if (decpt == 9999) /* Infinity or Nan */ {
- while((*b++ = *s++));
+ while((*b++ = *s++)) {}
goto done0;
}
if (decpt <= -4 || decpt > se - s + 5) {
@@ -64,7 +64,7 @@ g_fmt(register char *b, double x)
}
else
*b++ = '+';
- for(j = 2, k = 10; 10*k <= decpt; j++, k *= 10);
+ for(j = 2, k = 10; 10*k <= decpt; j++, k *= 10) {}
for(;;) {
i = decpt / k;
*b++ = i + '0';
@@ -79,7 +79,7 @@ g_fmt(register char *b, double x)
*b++ = '.';
for(; decpt < 0; decpt++)
*b++ = '0';
- while((*b++ = *s++));
+ while((*b++ = *s++)) {}
}
else {
while((*b = *s++)) {
diff --git a/base/third_party/dmg_fp/mac_wextra.patch b/base/third_party/dmg_fp/mac_wextra.patch
new file mode 100644
index 0000000..15340f2
--- /dev/null
+++ b/base/third_party/dmg_fp/mac_wextra.patch
@@ -0,0 +1,53 @@
+Index: g_fmt.cc
+===================================================================
+--- g_fmt.cc (revision 49784)
++++ g_fmt.cc (working copy)
+@@ -46,7 +46,7 @@
+ if (sign)
+ *b++ = '-';
+ if (decpt == 9999) /* Infinity or Nan */ {
+- while((*b++ = *s++));
++ while((*b++ = *s++)) {}
+ goto done0;
+ }
+ if (decpt <= -4 || decpt > se - s + 5) {
+@@ -64,7 +64,7 @@
+ }
+ else
+ *b++ = '+';
+- for(j = 2, k = 10; 10*k <= decpt; j++, k *= 10);
++ for(j = 2, k = 10; 10*k <= decpt; j++, k *= 10) {}
+ for(;;) {
+ i = decpt / k;
+ *b++ = i + '0';
+@@ -79,7 +79,7 @@
+ *b++ = '.';
+ for(; decpt < 0; decpt++)
+ *b++ = '0';
+- while((*b++ = *s++));
++ while((*b++ = *s++)) {}
+ }
+ else {
+ while((*b = *s++)) {
+Index: dtoa.cc
+===================================================================
+--- dtoa.cc (revision 49784)
++++ dtoa.cc (working copy)
+@@ -3863,7 +3863,7 @@
+ if (dval(&u) > 0.5 + dval(&eps))
+ goto bump_up;
+ else if (dval(&u) < 0.5 - dval(&eps)) {
+- while(*--s == '0');
++ while(*--s == '0') {}
+ s++;
+ goto ret1;
+ }
+@@ -4176,7 +4176,7 @@
+ #ifdef Honor_FLT_ROUNDS
+ trimzeros:
+ #endif
+- while(*--s == '0');
++ while(*--s == '0') {}
+ s++;
+ }
+ ret:
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 8b0063a..2ed4d53 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -863,7 +863,7 @@ void AutomationProvider::GetBrowserWindow(int index, int* handle) {
*handle = 0;
if (index >= 0) {
BrowserList::const_iterator iter = BrowserList::begin();
- for (; (iter != BrowserList::end()) && (index > 0); ++iter, --index);
+ for (; (iter != BrowserList::end()) && (index > 0); ++iter, --index) {}
if (iter != BrowserList::end()) {
*handle = browser_tracker_->Add(*iter);
}
diff --git a/chrome/browser/cocoa/objc_zombie.mm b/chrome/browser/cocoa/objc_zombie.mm
index 35607c5..c450d2a 100644
--- a/chrome/browser/cocoa/objc_zombie.mm
+++ b/chrome/browser/cocoa/objc_zombie.mm
@@ -275,9 +275,6 @@ BOOL ZombieEnable(BOOL zombieAllObjects,
if (!ZombieInit())
return NO;
- if (zombieCount < 0)
- return NO;
-
g_zombieAllObjects = zombieAllObjects;
// Replace the implementation of -[NSObject dealloc].
diff --git a/chrome/browser/privacy_blacklist/blacklist.cc b/chrome/browser/privacy_blacklist/blacklist.cc
index c4aa383..9b4bda1 100644
--- a/chrome/browser/privacy_blacklist/blacklist.cc
+++ b/chrome/browser/privacy_blacklist/blacklist.cc
@@ -43,7 +43,7 @@ bool Blacklist::Matches(const std::string& pattern, const std::string& url) {
while (pattern[p] != '\0' && url[u] != '\0') {
if (pattern[p] == '@') {
- while (pattern[++p] == '@'); // Consecutive @ are redundant.
+ while (pattern[++p] == '@') {} // Consecutive @ are redundant.
if (pattern[p] == '\0')
return true; // Nothing to match after the @.
diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc
index af243d2..0559de5 100644
--- a/chrome/browser/sessions/tab_restore_service.cc
+++ b/chrome/browser/sessions/tab_restore_service.cc
@@ -254,7 +254,7 @@ void TabRestoreService::RestoreEntryById(Browser* browser,
size_t index = 0;
for (Entries::iterator j = entries_.begin(); j != i && j != entries_.end();
- ++j, ++index);
+ ++j, ++index) {}
if (static_cast<int>(index) < entries_to_write_)
entries_to_write_--;
diff --git a/chrome/renderer/pepper_plugin_delegate_impl.h b/chrome/renderer/pepper_plugin_delegate_impl.h
index 8b6f0d2..2edb4dd 100644
--- a/chrome/renderer/pepper_plugin_delegate_impl.h
+++ b/chrome/renderer/pepper_plugin_delegate_impl.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/weak_ptr.h"
#include "webkit/glue/plugins/pepper_plugin_delegate.h"
+#include "webkit/glue/plugins/pepper_plugin_instance.h"
class RenderView;
diff --git a/gpu/command_buffer/common/id_allocator.cc b/gpu/command_buffer/common/id_allocator.cc
index 22c55e3..faa4599 100644
--- a/gpu/command_buffer/common/id_allocator.cc
+++ b/gpu/command_buffer/common/id_allocator.cc
@@ -27,7 +27,7 @@ ResourceId IdAllocator::FindFirstFree() const {
ResourceId IdAllocator::AllocateIDAtOrAbove(ResourceId desired_id) {
DCHECK_LT(static_cast<ResourceId>(used_ids_.size()),
static_cast<ResourceId>(-1));
- for (; InUse(desired_id); ++desired_id);
+ for (; InUse(desired_id); ++desired_id) {}
MarkAsUsed(desired_id);
return desired_id;
}
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc
index f74752a..7e17906 100755
--- a/net/base/cookie_monster.cc
+++ b/net/base/cookie_monster.cc
@@ -1184,7 +1184,7 @@ static inline bool CharIsA(const char c, const char* chars) {
static inline bool SeekTo(std::string::const_iterator* it,
const std::string::const_iterator& end,
const char* chars) {
- for (; *it != end && !CharIsA(**it, chars); ++(*it));
+ for (; *it != end && !CharIsA(**it, chars); ++(*it)) {}
return *it == end;
}
// Seek the iterator to the first occurrence of a character not in |chars|.
@@ -1192,13 +1192,13 @@ static inline bool SeekTo(std::string::const_iterator* it,
static inline bool SeekPast(std::string::const_iterator* it,
const std::string::const_iterator& end,
const char* chars) {
- for (; *it != end && CharIsA(**it, chars); ++(*it));
+ for (; *it != end && CharIsA(**it, chars); ++(*it)) {}
return *it == end;
}
static inline bool SeekBackPast(std::string::const_iterator* it,
const std::string::const_iterator& end,
const char* chars) {
- for (; *it != end && CharIsA(**it, chars); --(*it));
+ for (; *it != end && CharIsA(**it, chars); --(*it)) {}
return *it == end;
}
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
index 2e8d9fb..e6980ab 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -137,7 +137,7 @@ void HttpResponseHeaders::Persist(Pickle* pickle, PersistOptions options) {
// Locate the start of the next header.
size_t k = i;
- while (++k < parsed_.size() && parsed_[k].is_continuation());
+ while (++k < parsed_.size() && parsed_[k].is_continuation()) {}
--k;
std::string header_name(parsed_[i].name_begin, parsed_[i].name_end);
@@ -177,7 +177,7 @@ void HttpResponseHeaders::Update(const HttpResponseHeaders& new_headers) {
// Locate the start of the next header.
size_t k = i;
- while (++k < new_parsed.size() && new_parsed[k].is_continuation());
+ while (++k < new_parsed.size() && new_parsed[k].is_continuation()) {}
--k;
const std::string::const_iterator& name_begin = new_parsed[i].name_begin;
@@ -208,7 +208,7 @@ void HttpResponseHeaders::MergeWithHeaders(const std::string& raw_headers,
// Locate the start of the next header.
size_t k = i;
- while (++k < parsed_.size() && parsed_[k].is_continuation());
+ while (++k < parsed_.size() && parsed_[k].is_continuation()) {}
--k;
std::string name(parsed_[i].name_begin, parsed_[i].name_end);