fix warnings on Mac in src/opts
authorcaryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 6 Jun 2012 12:10:26 +0000 (12:10 +0000)
committercaryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 6 Jun 2012 12:10:26 +0000 (12:10 +0000)
Fix these class of warnings:
- unused functions
- unused locals
- sign mismatch
- missing function prototypes
- missing newline at end of file
- 64 to 32 bit truncation

The changes prefer to link in dead code in the debug build
with 'if (false)' than to comment it out, but trivial cases
are commented out or sometimes deleted if it appears to be
a copy/paste error.
Review URL: https://codereview.appspot.com/6303045

git-svn-id: http://skia.googlecode.com/svn/trunk@4184 2bbb7eff-a529-9590-31e7-b0007b416f81

src/opts/SkBlitRect_opts_SSE2.cpp
src/opts/SkBlitRow_opts_SSE2.cpp
src/opts/opts_check_SSE2.cpp

index 9336951..6d8a296 100644 (file)
@@ -14,7 +14,7 @@
 /** Simple blitting of opaque rectangles less than 31 pixels wide:
     inlines and merges sections of Color32_SSE2 and sk_memset32_SSE2.
 */
-void BlitRect32_OpaqueNarrow_SSE2(SkPMColor* SK_RESTRICT destination,
+static void BlitRect32_OpaqueNarrow_SSE2(SkPMColor* SK_RESTRICT destination,
                                   int width, int height,
                                   size_t rowBytes, uint32_t color) {
     SkASSERT(255 == SkGetPackedA32(color));
@@ -48,7 +48,7 @@ void BlitRect32_OpaqueNarrow_SSE2(SkPMColor* SK_RESTRICT destination,
   A 31 pixel rectangle is guaranteed to have at least one
   16-pixel aligned span that can take advantage of mm_store.
 */
-void BlitRect32_OpaqueWide_SSE2(SkPMColor* SK_RESTRICT destination,
+static void BlitRect32_OpaqueWide_SSE2(SkPMColor* SK_RESTRICT destination,
                                 int width, int height,
                                 size_t rowBytes, uint32_t color) {
     SkASSERT(255 == SkGetPackedA32(color));
@@ -118,16 +118,16 @@ void ColorRect32_SSE2(SkPMColor* destination,
         return;
     }
     unsigned colorA = SkGetPackedA32(color);
-    //if (255 == colorA) {
-        //if (width < 31) {
-            //BlitRect32_OpaqueNarrow_SSE2(destination, width, height,
-                                         //rowBytes, color);
-        //} else {
-            //BlitRect32_OpaqueWide_SSE2(destination, width, height,
-                                       //rowBytes, color);
-        //}
-    //} else {
+    if (false && 255 == colorA) { // disabled but compilable to suppress warning
+        if (width < 31) {
+            BlitRect32_OpaqueNarrow_SSE2(destination, width, height,
+                                         rowBytes, color);
+        } else {
+            BlitRect32_OpaqueWide_SSE2(destination, width, height,
+                                       rowBytes, color);
+        }
+    } else {
         SkBlitRow::ColorRect32(destination, width, height, rowBytes, color);
-    //}
+    }
 }
 
index 8e4dd1d..5bb0c8c 100644 (file)
@@ -7,6 +7,7 @@
 
 
 #include "SkBlitRow_opts_SSE2.h"
+#include "SkBitmapProcState_opts_SSE2.h"
 #include "SkColorPriv.h"
 #include "SkUtils.h"
 
index a839696..5da6412 100644 (file)
@@ -223,6 +223,8 @@ SkMemset32Proc SkMemset32GetPlatformProc() {
     }
 }
 
+SkBlitRow::ColorRectProc PlatformColorRectProcFactory(); // suppress warning
+
 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() {
     if (cachedHasSSE2()) {
         return ColorRect32_SSE2;