fix warnings



git-svn-id: http://skia.googlecode.com/svn/trunk@68 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/Sk64.cpp b/src/core/Sk64.cpp
index 6013bd7..2715d23 100644
--- a/src/core/Sk64.cpp
+++ b/src/core/Sk64.cpp
@@ -387,7 +387,7 @@
     SkASSERT(!a.isZero() == !table.zero);
     SkASSERT(!a.isPos() == !table.pos);
     SkASSERT(!a.isNeg() == !table.neg);
-    SkASSERT(a.sign() == table.sign);
+    SkASSERT(a.getSign() == table.sign);
 }
 
 #ifdef SkLONGLONG
diff --git a/src/core/SkFP.h b/src/core/SkFP.h
index 6c0c526..5e25d22 100644
--- a/src/core/SkFP.h
+++ b/src/core/SkFP.h
@@ -41,7 +41,7 @@
     #define SkFPDivInt(a, n)        ((a) / (n))
     #define SkFPInvert(x)           SkScalarInvert(x)
     #define SkFPSqrt(x)             SkScalarSqrt(x)
-    #define SkFPCubeRoot(x)         pow(x, 1.0f/3)
+    #define SkFPCubeRoot(x)         static_cast<float>(pow(x, 0.33333333333))
 
     #define SkFPLT(a, b)            ((a) < (b))
     #define SkFPLE(a, b)            ((a) <= (b))
diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp
index 4f22e92..7e2d424 100644
--- a/src/core/SkGeometry.cpp
+++ b/src/core/SkGeometry.cpp
@@ -255,12 +255,12 @@
 #endif
 }
 
-static void flatten_double_quad_extrema(SkScalar coords[14])
+static inline void flatten_double_quad_extrema(SkScalar coords[14])
 {
     coords[2] = coords[6] = coords[4];
 }
 
-static void force_quad_monotonic_in_y(SkPoint pts[3])
+static inline void force_quad_monotonic_in_y(SkPoint pts[3])
 {
     // zap pts[1].fY to the nearest value
     SkScalar ab = SkScalarAbs(pts[0].fY - pts[1].fY);
diff --git a/src/core/SkGraphics.cpp b/src/core/SkGraphics.cpp
index 64fbab9..2ad44cd 100644
--- a/src/core/SkGraphics.cpp
+++ b/src/core/SkGraphics.cpp
@@ -228,6 +228,7 @@
     return sum;
 }
 
+#if 0
 static float time_intToFloat() {
     const int repeat = 1000000;
     int i, n;
@@ -266,6 +267,7 @@
 
     return sum;
 }
+#endif
 
 void SkGraphics::Init(bool runUnitTests)
 {
diff --git a/src/core/SkMMapStream.cpp b/src/core/SkMMapStream.cpp
index 017bcaf..78cb3f3 100644
--- a/src/core/SkMMapStream.cpp
+++ b/src/core/SkMMapStream.cpp
@@ -16,8 +16,8 @@
         return;
     }
 
-    off_t size = lseek(fildes, 0, SEEK_END);    // find the file size
-    if (size == -1)
+    off_t offset = lseek(fildes, 0, SEEK_END);    // find the file size
+    if (offset == -1)
     {
         SkDEBUGF(("---- failed to lseek(%s) for mmap stream error=%d\n", filename, errno));
         close(fildes);
@@ -25,6 +25,9 @@
     }
     (void)lseek(fildes, 0, SEEK_SET);   // restore file offset to beginning
 
+    // to avoid a 64bit->32bit warning, I explicitly create a size_t size
+    size_t size = static_cast<size_t>(offset);
+
     void* addr = mmap(NULL, size, PROT_READ, MAP_SHARED, fildes, 0);
     if (MAP_FAILED == addr)
     {
diff --git a/src/core/SkMath.cpp b/src/core/SkMath.cpp
index c627d9b..2655586 100644
--- a/src/core/SkMath.cpp
+++ b/src/core/SkMath.cpp
@@ -140,7 +140,7 @@
     tmp.shiftRight(16);
     return tmp.fLo;
 #elif defined(SkLONGLONG)
-    return (SkLONGLONG)a * b >> 16;
+    return static_cast<SkFixed>((SkLONGLONG)a * b >> 16);
 #else
     int sa = SkExtractSign(a);
     int sb = SkExtractSign(b);
@@ -165,7 +165,7 @@
     tmp.setMul(a, b);
     return tmp.getFract();
 #elif defined(SkLONGLONG)
-    return (SkLONGLONG)a * b >> 30;
+    return static_cast<SkFract>((SkLONGLONG)a * b >> 30);
 #else
     int sa = SkExtractSign(a);
     int sb = SkExtractSign(b);
@@ -550,7 +550,7 @@
 
 #include "SkRandom.h"
 
-#ifdef SkLONGLONG
+#if defined(SkLONGLONG) && defined(SK_SUPPORT_UNITTEST)
 static int symmetric_fixmul(int a, int b) {
     int sa = SkExtractSign(a);
     int sb = SkExtractSign(b);
@@ -586,7 +586,7 @@
 }
 #endif
 
-#ifdef SK_CAN_USE_FLOAT
+#if defined(SK_CAN_USE_FLOAT) && defined(SK_SUPPORT_UNITTEST)
 
 static float nextFloat(SkRandom& rand) {
     SkFloatIntUnion data;
@@ -696,6 +696,7 @@
 
 #endif
 
+#ifdef SK_SUPPORT_UNITTEST
 static void test_muldiv255() {
     for (int a = 0; a <= 255; a++) {
         for (int b = 0; b <= 255; b++) {
@@ -716,6 +717,7 @@
         }
     }
 }
+#endif
 
 void SkMath::UnitTest() {    
 #ifdef SK_SUPPORT_UNITTEST
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index bb6b31e..691da41 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -367,26 +367,6 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-static uint32_t sk_glyphID_next(const char** text)
-{
-    const uint16_t* glyph = (const uint16_t*)text;
-    int32_t value = *glyph;
-    glyph += 1;
-    *text = (const char*)glyph;
-    return value;
-}
-
-static uint32_t sk_glyphID_prev(const char** text)
-{
-    const uint16_t* glyph = (const uint16_t*)text;
-    glyph -= 1;
-    int32_t value = *glyph;
-    *text = (const char*)glyph;
-    return value;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
 static const SkGlyph& sk_getMetrics_utf8_next(SkGlyphCache* cache, const char** text)
 {
     SkASSERT(cache != NULL);
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 854c4de..f63e729 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -182,17 +182,6 @@
     return ctx;
 }
 
-static int plus_minus_pin(int value, int max) {
-    SkASSERT(max >= 0);
-    
-    if (value > max) {
-        value = max;
-    } else if (value < -max) {
-        value = -max;
-    }
-    return value;
-}    
-
 void SkScalerContext::getAdvance(SkGlyph* glyph) {
     // mark us as just having a valid advance
     glyph->fMaskFormat = MASK_FORMAT_JUST_ADVANCE;
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp
index 8b58991..d8f779a 100644
--- a/src/core/SkScan_Path.cpp
+++ b/src/core/SkScan_Path.cpp
@@ -387,6 +387,7 @@
     return list[0];
 }
 
+#ifdef SK_DEBUG
 /* 'quick' computation of the max sized needed to allocated for
     our edgelist.
 */
@@ -422,6 +423,7 @@
     *storage = size;
     return edgeCount;
 }
+#endif
 
 /* Much faster than worst_case_edge_count, but over estimates even more
 */
diff --git a/src/core/SkUtils.cpp b/src/core/SkUtils.cpp
index 20f7ddc..a4c6c16 100644
--- a/src/core/SkUtils.cpp
+++ b/src/core/SkUtils.cpp
@@ -427,10 +427,12 @@
 
 #include <stdlib.h>
 
+#if 0
 static int round_to_K(size_t bytes)
 {
     return (bytes + 512) >> 10;
 }
+#endif
 
 SkAutoMemoryUsageProbe::SkAutoMemoryUsageProbe(const char label[])
     : fLabel(label)
diff --git a/src/core/SkWriter32.cpp b/src/core/SkWriter32.cpp
index 61d0051..819803f 100644
--- a/src/core/SkWriter32.cpp
+++ b/src/core/SkWriter32.cpp
@@ -37,15 +37,6 @@
     }
 };
 
-static size_t compute_block_size(size_t currSize, size_t minSize)
-{
-    if (currSize < minSize)
-        currSize = minSize;
-    
-    currSize += (currSize >> 1);
-    return SkAlign4(currSize);
-}
-
 ///////////////////////////////////////////////////////////////////////////////
 
 SkWriter32::~SkWriter32()
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index e8a202d..80bafce 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -30,6 +30,7 @@
     return SkPackARGB32(a, r, g, b);
 }
 
+#if 0
 // idea for higher precision blends in xfer procs (and slightly faster)
 // see DstATop as a probable caller
 static U8CPU mulmuldiv255round(U8CPU a, U8CPU b, U8CPU c, U8CPU d) {
@@ -42,6 +43,7 @@
     SkASSERT(result <= 255);
     return result;
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -778,7 +780,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef SK_DEBUG
+#ifdef SK_DEBUGx
 static void unit_test() {
     for (unsigned a = 0; a <= 255; a++) {
         for (unsigned c = 0; c <= a; c++) {
diff --git a/src/effects/SkGradientShader.cpp b/src/effects/SkGradientShader.cpp
index b0d91ee..9b5d922 100644
--- a/src/effects/SkGradientShader.cpp
+++ b/src/effects/SkGradientShader.cpp
@@ -608,7 +608,7 @@
 };
 
 //  Return true if fx, fx+dx, fx+2*dx, ... is always in range
-static bool no_need_for_clamp(int fx, int dx, int count)
+static inline bool no_need_for_clamp(int fx, int dx, int count)
 {
     SkASSERT(count > 0);
     return (unsigned)((fx | (fx + (count - 1) * dx)) >> 8) <= 0xFF;