aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-23 11:13:56 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-23 11:13:56 +0000
commitfaa5ae456d184202993a5dbe782a3a95acc25326 (patch)
tree8d2e7c509a65656a711727f0848bc58cfd437196
parent6ae6383f56704928838032ce6c46829e06201853 (diff)
Turn on -Wall -Wextra on Mac, and fix all the warnings that crop up for /usr/bin/g++ and Clang 3.3.
BUG= R=bungeman@google.com Author: mtklein@google.com Review URL: https://chromiumcodereview.appspot.com/19569012 git-svn-id: http://skia.googlecode.com/svn/trunk@10255 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--bench/PathIterBench.cpp4
-rw-r--r--gyp/common_conditions.gypi3
-rw-r--r--src/core/SkBitmapScaler.cpp6
-rw-r--r--src/core/SkPicture.cpp2
-rw-r--r--src/gpu/GrDrawState.h2
-rw-r--r--src/gpu/GrDrawTargetCaps.h2
-rw-r--r--src/utils/SkLayer.cpp2
-rw-r--r--src/views/mac/SkOptionsTableView.mm24
8 files changed, 22 insertions, 23 deletions
diff --git a/bench/PathIterBench.cpp b/bench/PathIterBench.cpp
index 8bc8add427..987a752ad9 100644
--- a/bench/PathIterBench.cpp
+++ b/bench/PathIterBench.cpp
@@ -72,7 +72,7 @@ protected:
SkPath::Verb verb;
SkPoint pts[4];
- while ((verb = iter.next(pts)) != SkPath::kDone_Verb);
+ while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { }
}
} else {
for (int i = 0; i < N; ++i) {
@@ -80,7 +80,7 @@ protected:
SkPath::Verb verb;
SkPoint pts[4];
- while ((verb = iter.next(pts)) != SkPath::kDone_Verb);
+ while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { }
}
}
}
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index 1ff70f5890..2dcd36c2ba 100644
--- a/gyp/common_conditions.gypi
+++ b/gyp/common_conditions.gypi
@@ -302,6 +302,9 @@
'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS': [
'-Werror',
+ '-Wall',
+ '-Wextra',
+ '-Wno-unused-parameter',
],
},
}],
diff --git a/src/core/SkBitmapScaler.cpp b/src/core/SkBitmapScaler.cpp
index 5453e6455f..a80476f9c4 100644
--- a/src/core/SkBitmapScaler.cpp
+++ b/src/core/SkBitmapScaler.cpp
@@ -45,9 +45,6 @@ private:
SkConvolutionFilter1D* output,
SkConvolutionProcs* convolveProcs);
- // Subset of scaled destination bitmap to compute.
- SkIRect fOutBounds;
-
SkConvolutionFilter1D fXFilter;
SkConvolutionFilter1D fYFilter;
};
@@ -56,8 +53,7 @@ SkResizeFilter::SkResizeFilter(SkBitmapScaler::ResizeMethod method,
int srcFullWidth, int srcFullHeight,
int destWidth, int destHeight,
const SkIRect& destSubset,
- SkConvolutionProcs* convolveProcs)
- : fOutBounds(destSubset) {
+ SkConvolutionProcs* convolveProcs) {
// method will only ever refer to an "algorithm method".
SkASSERT((SkBitmapScaler::RESIZE_FIRST_ALGORITHM_METHOD <= method) &&
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index 2b488dec02..d8ad80dd67 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -121,7 +121,7 @@ SkPicture::SkPicture() {
fWidth = fHeight = 0;
}
-SkPicture::SkPicture(const SkPicture& src) {
+SkPicture::SkPicture(const SkPicture& src) : INHERITED() {
fWidth = src.fWidth;
fHeight = src.fHeight;
fRecord = NULL;
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 1a67bb1ab0..c006e6c5dd 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -41,7 +41,7 @@ public:
/**
* Copies another draw state.
**/
- GrDrawState(const GrDrawState& state) {
+ GrDrawState(const GrDrawState& state) : INHERITED() {
GR_DEBUGCODE(fBlockEffectRemovalCnt = 0;)
*this = state;
}
diff --git a/src/gpu/GrDrawTargetCaps.h b/src/gpu/GrDrawTargetCaps.h
index ffacc9e4fe..61c9fede08 100644
--- a/src/gpu/GrDrawTargetCaps.h
+++ b/src/gpu/GrDrawTargetCaps.h
@@ -19,7 +19,7 @@ public:
SK_DECLARE_INST_COUNT(Caps)
GrDrawTargetCaps() { this->reset(); }
- GrDrawTargetCaps(const GrDrawTargetCaps& other) { *this = other; }
+ GrDrawTargetCaps(const GrDrawTargetCaps& other) : INHERITED() { *this = other; }
GrDrawTargetCaps& operator= (const GrDrawTargetCaps&);
virtual void reset();
diff --git a/src/utils/SkLayer.cpp b/src/utils/SkLayer.cpp
index a96d921457..126dd92198 100644
--- a/src/utils/SkLayer.cpp
+++ b/src/utils/SkLayer.cpp
@@ -36,7 +36,7 @@ SkLayer::SkLayer() {
#endif
}
-SkLayer::SkLayer(const SkLayer& src) {
+SkLayer::SkLayer(const SkLayer& src) : INHERITED() {
fParent = NULL;
m_opacity = src.m_opacity;
m_size = src.m_size;
diff --git a/src/views/mac/SkOptionsTableView.mm b/src/views/mac/SkOptionsTableView.mm
index eaa3e4cdd5..7a6afe42b3 100644
--- a/src/views/mac/SkOptionsTableView.mm
+++ b/src/views/mac/SkOptionsTableView.mm
@@ -56,8 +56,8 @@
}
- (void)updateMenu:(const SkOSMenu*)menu {
- // the first menu is always assumed to be the static, the second is
- // repopulated every time over and over again
+ // the first menu is always assumed to be the static, the second is
+ // repopulated every time over and over again
// seems pretty weird that we have to get rid of the const'ness here,
// but trying to propagate the const'ness through all the way to the fMenus
@@ -91,7 +91,7 @@
const SkOSMenu::Item* item = menuitems[i];
SkOptionItem* option = [[SkOptionItem alloc] init];
option.fItem = item;
-
+
if (SkOSMenu::kList_Type == item->getType()) {
int index = 0, count = 0;
SkOSMenu::FindListItemCount(*item->getEvent(), &count);
@@ -118,10 +118,10 @@
SkOSMenu::FindSliderValue(*item->getEvent(), item->getSlotName(), &value);
SkOSMenu::FindSliderMin(*item->getEvent(), &min);
SkOSMenu::FindSliderMax(*item->getEvent(), &max);
- option.fCell = [self createSlider:value
- min:min
+ option.fCell = [self createSlider:value
+ min:min
max:max];
- break;
+ break;
case SkOSMenu::kSwitch_Type:
SkOSMenu::FindSwitchState(*item->getEvent(), item->getSlotName(), &state);
option.fCell = [self createSwitch:(BOOL)state];
@@ -152,9 +152,9 @@
if (columnIndex == 0) {
const SkOSMenu::Item* item = ((SkOptionItem*)[fItems objectAtIndex:row]).fItem;
NSString* label = [NSString stringWithUTF8String:item->getLabel()];
- if (fShowKeys)
+ if (fShowKeys)
return [NSString stringWithFormat:@"%@ (%c)", label, item->getKeyEquivalent()];
- else
+ else
return label;
}
else
@@ -164,7 +164,7 @@
- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
if (tableColumn) {
int columnIndex = [tableView columnWithIdentifier:[tableColumn identifier]];
- if (columnIndex == 1)
+ if (columnIndex == 1)
return [((SkOptionItem*)[fItems objectAtIndex:row]).fCell copy];
else
return [[[SkTextFieldCell alloc] init] autorelease];
@@ -180,7 +180,7 @@
const SkOSMenu::Item* item = option.fItem;
switch (item->getType()) {
case SkOSMenu::kAction_Type:
- break;
+ break;
case SkOSMenu::kList_Type:
[cell selectItemAtIndex:[(NSPopUpButtonCell*)storedCell indexOfSelectedItem]];
break;
@@ -259,7 +259,7 @@
[cell selectItemAtIndex:index];
[cell setArrowPosition:NSPopUpArrowAtBottom];
[cell setBezelStyle:NSSmallSquareBezelStyle];
- return cell;
+ return cell;
}
- (NSCell*)createSlider:(float)value min:(float)min max:(float)max {
@@ -278,7 +278,7 @@
return cell;
}
-- (NSCell*)createTextField:(NSString*)placeHolder; {
+- (NSCell*)createTextField:(NSString*)placeHolder {
SkTextFieldCell* cell = [[[SkTextFieldCell alloc] init] autorelease];
[cell setEditable:YES];
[cell setStringValue:@""];