summaryrefslogtreecommitdiffstats
path: root/cmds/bootanimation/BootAnimation.cpp
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-09-30 21:48:18 -0700
committerAndreas Gampe <agampe@google.com>2014-11-07 14:33:51 -0800
commitcfedceb8c180a2e176154d461659e0c3569dc931 (patch)
tree00de5f6ee61e72713c3b141f5a308f33f312bf53 /cmds/bootanimation/BootAnimation.cpp
parent59701b9ba5c453e327bc0e6873a9f6ff87a10391 (diff)
downloadframeworks_base-cfedceb8c180a2e176154d461659e0c3569dc931.zip
frameworks_base-cfedceb8c180a2e176154d461659e0c3569dc931.tar.gz
frameworks_base-cfedceb8c180a2e176154d461659e0c3569dc931.tar.bz2
Frameworks/base: Turn on -Wall -Werror in cmds
Fix small warnings, turn on -Wall -Werror. Change-Id: Iab1f01a7c7ebd6ba832b75067c5e395f380a1b8b
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r--cmds/bootanimation/BootAnimation.cpp19
1 files changed, 11 insertions, 8 deletions
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 @@ void BootAnimation::binderDied(const wp<IBinder>&)
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);