From cfedceb8c180a2e176154d461659e0c3569dc931 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 30 Sep 2014 21:48:18 -0700 Subject: Frameworks/base: Turn on -Wall -Werror in cmds Fix small warnings, turn on -Wall -Werror. Change-Id: Iab1f01a7c7ebd6ba832b75067c5e395f380a1b8b --- cmds/bootanimation/Android.mk | 20 +++++++++++--------- cmds/bootanimation/AudioPlayer.cpp | 1 - cmds/bootanimation/BootAnimation.cpp | 19 +++++++++++-------- cmds/bootanimation/bootanimation_main.cpp | 2 +- 4 files changed, 23 insertions(+), 19 deletions(-) (limited to 'cmds/bootanimation') 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 @@ LOCAL_PATH:= $(call my-dir) 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 @@ bool AudioPlayer::threadLoop() 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 #include +// TODO: Fix Skia. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include #include #include +#pragma GCC diagnostic pop #include #include @@ -105,7 +109,7 @@ void BootAnimation::binderDied(const wp&) 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 @@ status_t BootAnimation::initTexture(const Animation::Frame& frame) 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 @@ status_t BootAnimation::readyToRun() { EGL_DEPTH_SIZE, 0, EGL_NONE }; - EGLint w, h, dummy; + EGLint w, h; EGLint numConfigs; EGLConfig config; EGLSurface surface; @@ -470,7 +474,7 @@ bool BootAnimation::movie() // 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 @@ bool BootAnimation::movie() 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 @@ bool BootAnimation::movie() 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 @@ using namespace android; // --------------------------------------------------------------------------- -int main(int argc, char** argv) +int main() { #if defined(HAVE_PTHREADS) setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_DISPLAY); -- cgit v1.1