fix warnings on Mac in src/images

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/6299048

git-svn-id: http://skia.googlecode.com/svn/trunk@4179 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/images/SkFDStream.cpp b/src/images/SkFDStream.cpp
index e1e214a..5bf0850 100644
--- a/src/images/SkFDStream.cpp
+++ b/src/images/SkFDStream.cpp
@@ -57,7 +57,7 @@
 #endif
                 return 0;
             }
-            return size;
+            return (size_t) size;
         } else if (NULL == buffer) {        // skip
             off_t oldCurr = ::lseek(fFD, 0, SEEK_CUR);
             if (oldCurr < 0) {
@@ -74,7 +74,7 @@
                 return 0;   // error;
             }
             // return the actual amount we skipped
-            return newCurr - oldCurr;
+            return (size_t) (newCurr - oldCurr);
         } else {                            // read
             ssize_t actual = ::read(fFD, buffer, size);
             // our API can't return an error, so we return 0
diff --git a/src/images/SkImageDecoder_libbmp.cpp b/src/images/SkImageDecoder_libbmp.cpp
index fa75295..d3bb871 100644
--- a/src/images/SkImageDecoder_libbmp.cpp
+++ b/src/images/SkImageDecoder_libbmp.cpp
@@ -31,7 +31,7 @@
 DEFINE_DECODER_CREATOR(BMPImageDecoder);
 ///////////////////////////////////////////////////////////////////////////////
 
-SkImageDecoder* sk_libbmp_dfactory(SkStream* stream) {
+static SkImageDecoder* sk_libbmp_dfactory(SkStream* stream) {
     static const char kBmpMagic[] = { 'B', 'M' };
     
     size_t len = stream->getLength();
diff --git a/src/images/SkImageDecoder_libico.cpp b/src/images/SkImageDecoder_libico.cpp
index 3473344..30611cb 100644
--- a/src/images/SkImageDecoder_libico.cpp
+++ b/src/images/SkImageDecoder_libico.cpp
@@ -24,9 +24,11 @@
     virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode);
 };
 
+#if 0 // UNUSED
 SkImageDecoder* SkCreateICOImageDecoder() {
     return new SkICOImageDecoder;
 }
+#endif
 
 /////////////////////////////////////////////////////////////////////////////////////////
 
@@ -372,7 +374,7 @@
 
 #include "SkTRegistry.h"
 
-SkImageDecoder* sk_libico_dfactory(SkStream* stream) {
+static SkImageDecoder* sk_libico_dfactory(SkStream* stream) {
     // Check to see if the first four bytes are 0,0,1,0
     // FIXME: Is that required and sufficient?
     SkAutoMalloc autoMal(4);
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index 0c2b816..8989d35 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -656,7 +656,7 @@
 
 #include "SkTRegistry.h"
 
-SkImageDecoder* sk_libjpeg_dfactory(SkStream* stream) {
+static SkImageDecoder* sk_libjpeg_dfactory(SkStream* stream) {
     static const unsigned char gHeader[] = { 0xFF, 0xD8, 0xFF };
     static const size_t HEADER_SIZE = sizeof(gHeader);
 
diff --git a/src/images/SkImageDecoder_wbmp.cpp b/src/images/SkImageDecoder_wbmp.cpp
index 28a3705..a3faf3d 100644
--- a/src/images/SkImageDecoder_wbmp.cpp
+++ b/src/images/SkImageDecoder_wbmp.cpp
@@ -153,7 +153,7 @@
 
 #include "SkTRegistry.h"
 
-SkImageDecoder* sk_wbmp_dfactory(SkStream* stream) {
+static SkImageDecoder* sk_wbmp_dfactory(SkStream* stream) {
     wbmp_head   head;
 
     if (head.init(stream)) {
diff --git a/src/images/SkJpegUtility.cpp b/src/images/SkJpegUtility.cpp
index e28c512..19db018 100644
--- a/src/images/SkJpegUtility.cpp
+++ b/src/images/SkJpegUtility.cpp
@@ -74,6 +74,7 @@
 static void sk_term_source(j_decompress_ptr /*cinfo*/) {}
 
 
+#if 0 // UNUSED
 static void skmem_init_source(j_decompress_ptr cinfo) {
     skjpeg_source_mgr*  src = (skjpeg_source_mgr*)cinfo->src;
     src->next_input_byte = (const JOCTET*)src->fMemoryBase;
@@ -98,6 +99,7 @@
 }
 
 static void skmem_term_source(j_decompress_ptr /*cinfo*/) {}
+#endif
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -105,7 +107,7 @@
 skjpeg_source_mgr::skjpeg_source_mgr(SkStream* stream, SkImageDecoder* decoder,
                                      bool ownStream) : fStream(stream) {
     fDecoder = decoder;
-    const void* baseAddr = stream->getMemoryBase();
+    // const void* baseAddr = stream->getMemoryBase();
     fMemoryBase = NULL;
     fUnrefStream = ownStream;
     fMemoryBaseSize = 0;