Frameworks/base: Turn on -Wall -Werror in cmds

Fix small warnings, turn on -Wall -Werror.

Change-Id: Iab1f01a7c7ebd6ba832b75067c5e395f380a1b8b
diff --git a/cmds/bootanimation/Android.mk b/cmds/bootanimation/Android.mk
index d6ecbe3..2ee586f 100644
--- a/cmds/bootanimation/Android.mk
+++ b/cmds/bootanimation/Android.mk
@@ -2,22 +2,24 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:= \
-	bootanimation_main.cpp \
-	AudioPlayer.cpp \
-	BootAnimation.cpp
+    bootanimation_main.cpp \
+    AudioPlayer.cpp \
+    BootAnimation.cpp
 
 LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
 
+LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
+
 LOCAL_C_INCLUDES += external/tinyalsa/include
 
 LOCAL_SHARED_LIBRARIES := \
-	libcutils \
-	liblog \
-	libandroidfw \
-	libutils \
-	libbinder \
+    libcutils \
+    liblog \
+    libandroidfw \
+    libutils \
+    libbinder \
     libui \
-	libskia \
+    libskia \
     libEGL \
     libGLESv1_CM \
     libgui \
diff --git a/cmds/bootanimation/AudioPlayer.cpp b/cmds/bootanimation/AudioPlayer.cpp
index 471b77f..459190f 100644
--- a/cmds/bootanimation/AudioPlayer.cpp
+++ b/cmds/bootanimation/AudioPlayer.cpp
@@ -207,7 +207,6 @@
     struct pcm *pcm = NULL;
     bool moreChunks = true;
     const struct chunk_fmt* chunkFmt = NULL;
-    void* buffer = NULL;
     int bufferSize;
     const uint8_t* wavData;
     size_t wavLength;
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 167014e..1d4de22 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -42,9 +42,13 @@
 #include <gui/Surface.h>
 #include <gui/SurfaceComposerClient.h>
 
+// TODO: Fix Skia.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-parameter"
 #include <SkBitmap.h>
 #include <SkStream.h>
 #include <SkImageDecoder.h>
+#pragma GCC diagnostic pop
 
 #include <GLES/gl.h>
 #include <GLES/glext.h>
@@ -105,7 +109,7 @@
 status_t BootAnimation::initTexture(Texture* texture, AssetManager& assets,
         const char* name) {
     Asset* asset = assets.open(name, Asset::ACCESS_BUFFER);
-    if (!asset)
+    if (asset == NULL)
         return NO_INIT;
     SkBitmap bitmap;
     SkImageDecoder::DecodeMemory(asset->getBuffer(false), asset->getLength(),
@@ -164,7 +168,7 @@
     SkBitmap bitmap;
     SkMemoryStream  stream(frame.map->getDataPtr(), frame.map->getDataLength());
     SkImageDecoder* codec = SkImageDecoder::Factory(&stream);
-    if (codec) {
+    if (codec != NULL) {
         codec->setDitherImage(false);
         codec->decode(&stream, &bitmap,
                 kN32_SkColorType,
@@ -252,7 +256,7 @@
             EGL_DEPTH_SIZE, 0,
             EGL_NONE
     };
-    EGLint w, h, dummy;
+    EGLint w, h;
     EGLint numConfigs;
     EGLConfig config;
     EGLSurface surface;
@@ -470,7 +474,7 @@
     // Parse the description file
     for (;;) {
         const char* endl = strstr(s, "\n");
-        if (!endl) break;
+        if (endl == NULL) break;
         String8 line(s, endl - s);
         const char* l = line.string();
         int fps, width, height, count, pause;
@@ -572,7 +576,6 @@
 
     const int xc = (mWidth - animation.width) / 2;
     const int yc = ((mHeight - animation.height) / 2);
-    nsecs_t lastFrame = systemTime();
     nsecs_t frameDuration = s2ns(1) / animation.fps;
 
     Region clearReg(Rect(mWidth, mHeight));
@@ -620,9 +623,9 @@
                     Region::const_iterator tail(clearReg.end());
                     glEnable(GL_SCISSOR_TEST);
                     while (head != tail) {
-                        const Rect& r(*head++);
-                        glScissor(r.left, mHeight - r.bottom,
-                                r.width(), r.height());
+                        const Rect& r2(*head++);
+                        glScissor(r2.left, mHeight - r2.bottom,
+                                r2.width(), r2.height());
                         glClear(GL_COLOR_BUFFER_BIT);
                     }
                     glDisable(GL_SCISSOR_TEST);
diff --git a/cmds/bootanimation/bootanimation_main.cpp b/cmds/bootanimation/bootanimation_main.cpp
index 417e138..6550d22 100644
--- a/cmds/bootanimation/bootanimation_main.cpp
+++ b/cmds/bootanimation/bootanimation_main.cpp
@@ -36,7 +36,7 @@
 
 // ---------------------------------------------------------------------------
 
-int main(int argc, char** argv)
+int main()
 {
 #if defined(HAVE_PTHREADS)
     setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_DISPLAY);