Turn on -Wall -Wextra on Mac, and fix all the warnings that crop up for /usr/bin...
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 23 Jul 2013 11:13:56 +0000 (11:13 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 23 Jul 2013 11:13:56 +0000 (11:13 +0000)
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

bench/PathIterBench.cpp
gyp/common_conditions.gypi
src/core/SkBitmapScaler.cpp
src/core/SkPicture.cpp
src/gpu/GrDrawState.h
src/gpu/GrDrawTargetCaps.h
src/utils/SkLayer.cpp
src/views/mac/SkOptionsTableView.mm

index 8bc8add..987a752 100644 (file)
@@ -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) { }
             }
         }
     }
index 1ff70f5..2dcd36c 100644 (file)
             'xcode_settings': {
               'OTHER_CPLUSPLUSFLAGS': [
                 '-Werror',
+                '-Wall',
+                '-Wextra',
+                '-Wno-unused-parameter',
               ],
             },
           }],
index 5453e64..a80476f 100644 (file)
@@ -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) &&
index 2b488de..d8ad80d 100644 (file)
@@ -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;
index 1a67bb1..c006e6c 100644 (file)
@@ -41,7 +41,7 @@ public:
     /**
      * Copies another draw state.
      **/
-    GrDrawState(const GrDrawState& state) {
+    GrDrawState(const GrDrawState& state) : INHERITED() {
         GR_DEBUGCODE(fBlockEffectRemovalCnt = 0;)
         *this = state;
     }
index ffacc9e..61c9fed 100644 (file)
@@ -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();
index a96d921..126dd92 100644 (file)
@@ -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;
index eaa3e4c..7a6afe4 100644 (file)
@@ -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);
                     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];
     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
 - (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];
         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;
     [cell selectItemAtIndex:index];
     [cell setArrowPosition:NSPopUpArrowAtBottom];
     [cell setBezelStyle:NSSmallSquareBezelStyle];
-    return cell; 
+    return cell;
 }
 
 - (NSCell*)createSlider:(float)value min:(float)min max:(float)max {
     return cell;
 }
 
-- (NSCell*)createTextField:(NSString*)placeHolder; {
+- (NSCell*)createTextField:(NSString*)placeHolder {
     SkTextFieldCell* cell = [[[SkTextFieldCell alloc] init] autorelease];
     [cell setEditable:YES];
     [cell setStringValue:@""];