Towards enabling -Werror in skia on Linux

Review URL: http://codereview.appspot.com/5516044/



git-svn-id: http://skia.googlecode.com/svn/trunk@2983 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/animator/SkAnimateActive.cpp b/src/animator/SkAnimateActive.cpp
index f429903..4177aa0 100644
--- a/src/animator/SkAnimateActive.cpp
+++ b/src/animator/SkAnimateActive.cpp
@@ -142,9 +142,12 @@
     SkAnimateBase* animate = fAnimators[index];
     SkMSec duration = animate->dur;
     SkState& state = fState[index];
-    if (state.fMode == SkApply::kMode_immediate || state.fMode == SkApply::kMode_create)
+    switch (state.fMode) {
+      case SkApply::kMode_immediate:
+      case SkApply::kMode_create:
         duration = state.fSteps ? state.fSteps * SK_MSec1 : 1;
-//  else if (state.fMode == SkApply::kMode_hold) {
+        break;
+//    case SkApply::kMode_hold: {
 //      int entries = animate->entries();
 //      SkScriptValue value;
 //      value.fOperand = animate->getValues()[entries - 1];
@@ -152,7 +155,9 @@
 //      bool result = SkScriptEngine::ConvertTo(NULL, SkType_Int, &value);
 //      SkASSERT(result);
 //      duration = value.fOperand.fS32 * SK_MSec1;
-//  }
+//      break;
+//    }
+    }
     state.fDuration = duration;
     SkMSec maxTime = state.fBegin + duration;
     if (fMaxTime < maxTime)
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index afbcdef..6bde3b2 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -171,7 +171,7 @@
     size_t raw = SkPackBits::Unpack8(storage, size, fStorage);
 
     SkASSERT(raw <= sizeof(fStorage));
-    int count = gCountNibBits[fFlags & 0xF];
+    size_t count = gCountNibBits[fFlags & 0xF];
     SkASSERT(raw == count * 256);
 }
 
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index dfe0d4b..4191c4a 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -403,7 +403,7 @@
 
     class AutoRenderTargetRestore : public ::GrNoncopyable {
     public:
-        AutoRenderTargetRestore() : fDrawState(NULL) {}
+        AutoRenderTargetRestore() : fDrawState(NULL), fSavedTarget(NULL) {}
         AutoRenderTargetRestore(GrDrawState* ds, GrRenderTarget* newTarget) {
             fDrawState = NULL;
             this->set(ds, newTarget);
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 404c762..465fbe1 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -473,7 +473,7 @@
     SkTDArray<BFChar> bfcharEntries;
     SkTDArray<BFRange> bfrangeEntries;
 
-    BFRange currentRangeEntry;
+    BFRange currentRangeEntry = {0, 0, 0};
     bool rangeEmpty = true;
     const int count = glyphToUnicode.count();