summaryrefslogtreecommitdiffstats
path: root/core/jni/android
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-11-12 08:03:48 -0800
committerAndreas Gampe <agampe@google.com>2014-11-13 15:20:37 -0800
commit0f0b4919667f418b249c497f5ad3e83fdf4437e5 (patch)
tree3a583c918c72b7d8d48b784505502f7b3fdf05e9 /core/jni/android
parent537888be7d5cfa6bfa9ddd459a622ea208339735 (diff)
downloadframeworks_base-0f0b4919667f418b249c497f5ad3e83fdf4437e5.zip
frameworks_base-0f0b4919667f418b249c497f5ad3e83fdf4437e5.tar.gz
frameworks_base-0f0b4919667f418b249c497f5ad3e83fdf4437e5.tar.bz2
Frameworks/base: Wall Werror in core/jni
Turn on -Wall -Werror in core/jni. Fix warnings. Clang TODO: For GCC we need to turn off Wunused-but-set-variable in the GL bindings. However, Clang doesn't have that warning and thus complains about an unknown pragma. It is necessary to make the pragma #ifdef-ed on the compiler being GCC. Change-Id: I14cab48d45c2771eef0432082356c47ed44a3d7f
Diffstat (limited to 'core/jni/android')
-rw-r--r--core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp1
-rw-r--r--core/jni/android/graphics/MinikinUtils.cpp12
-rw-r--r--core/jni/android/graphics/Shader.cpp5
-rw-r--r--core/jni/android/graphics/pdf/PdfRenderer.cpp5
-rw-r--r--core/jni/android/opengl/poly_clip.cpp1
-rw-r--r--core/jni/android/opengl/util.cpp14
6 files changed, 8 insertions, 30 deletions
diff --git a/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp b/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp
index b64ab0d..1a3fa14 100644
--- a/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp
+++ b/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp
@@ -24,7 +24,6 @@ public:
}
virtual size_t read(void* buffer, size_t size) {
- JNIEnv* env = fEnv;
if (NULL == buffer) {
if (0 == size) {
return 0;
diff --git a/core/jni/android/graphics/MinikinUtils.cpp b/core/jni/android/graphics/MinikinUtils.cpp
index f64ad7d..7dabf6b 100644
--- a/core/jni/android/graphics/MinikinUtils.cpp
+++ b/core/jni/android/graphics/MinikinUtils.cpp
@@ -26,18 +26,6 @@
namespace android {
-// Do an sprintf starting at offset n, abort on overflow
-static int snprintfcat(char* buf, int off, int size, const char* format, ...)
- __attribute__((__format__(__printf__, 4, 5)));
-static int snprintfcat(char* buf, int off, int size, const char* format, ...) {
- va_list args;
- va_start(args, format);
- int n = vsnprintf(buf + off, size - off, format, args);
- LOG_ALWAYS_FATAL_IF(n >= size - off, "String overflow in setting layout properties");
- va_end(args);
- return off + n;
-}
-
void MinikinUtils::doLayout(Layout* layout, const Paint* paint, int bidiFlags, TypefaceImpl* typeface,
const uint16_t* buf, size_t start, size_t count, size_t bufSize) {
TypefaceImpl* resolvedFace = TypefaceImpl_resolveDefault(typeface);
diff --git a/core/jni/android/graphics/Shader.cpp b/core/jni/android/graphics/Shader.cpp
index 6146fff..70a2fe5 100644
--- a/core/jni/android/graphics/Shader.cpp
+++ b/core/jni/android/graphics/Shader.cpp
@@ -13,11 +13,6 @@
using namespace android::uirenderer;
-static struct {
- jclass clazz;
- jfieldID shader;
-} gShaderClassInfo;
-
static void ThrowIAE_IfNull(JNIEnv* env, void* ptr) {
if (NULL == ptr) {
doThrowIAE(env);
diff --git a/core/jni/android/graphics/pdf/PdfRenderer.cpp b/core/jni/android/graphics/pdf/PdfRenderer.cpp
index 303ddea..b68aa38 100644
--- a/core/jni/android/graphics/pdf/PdfRenderer.cpp
+++ b/core/jni/android/graphics/pdf/PdfRenderer.cpp
@@ -20,7 +20,11 @@
#include "SkBitmap.h"
#include "SkMatrix.h"
#include "fpdfview.h"
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
#include "fsdk_rendercontext.h"
+#pragma GCC diagnostic pop
#include <android_runtime/AndroidRuntime.h>
#include <vector>
@@ -228,7 +232,6 @@ static void nativeRenderPage(JNIEnv* env, jclass thiz, jlong documentPtr, jlong
jlong bitmapPtr, jint destLeft, jint destTop, jint destRight, jint destBottom,
jlong matrixPtr, jint renderMode) {
- FPDF_DOCUMENT document = reinterpret_cast<FPDF_DOCUMENT>(documentPtr);
FPDF_PAGE page = reinterpret_cast<FPDF_PAGE>(pagePtr);
SkBitmap* skBitmap = reinterpret_cast<SkBitmap*>(bitmapPtr);
SkMatrix* skMatrix = reinterpret_cast<SkMatrix*>(matrixPtr);
diff --git a/core/jni/android/opengl/poly_clip.cpp b/core/jni/android/opengl/poly_clip.cpp
index 04e4b17..5c65220 100644
--- a/core/jni/android/opengl/poly_clip.cpp
+++ b/core/jni/android/opengl/poly_clip.cpp
@@ -58,7 +58,6 @@ namespace android {
void poly_clip_to_halfspace(Poly* p, Poly* q, int index, float sign, float k)
{
- unsigned long m;
float *up, *vp, *wp;
Poly_vert *v;
int i;
diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp
index 89baef8..e0ca951 100644
--- a/core/jni/android/opengl/util.cpp
+++ b/core/jni/android/opengl/util.cpp
@@ -759,8 +759,6 @@ getPointer(JNIEnv *_env, jobject buffer, jint *remaining)
jint limit;
jint elementSizeShift;
jlong pointer;
- jint offset;
- void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
@@ -900,10 +898,8 @@ static void etc1_encodeImage(JNIEnv *env, jclass clazz,
} else if (outB.remaining() < encodedImageSize) {
doThrowIAE(env, "out's remaining data < encoded image size");
} else {
- int result = etc1_encode_image((etc1_byte*) inB.getData(),
- width, height, pixelSize,
- stride,
- (etc1_byte*) outB.getData());
+ etc1_encode_image((etc1_byte*) inB.getData(), width, height, pixelSize, stride,
+ (etc1_byte*) outB.getData());
}
}
}
@@ -933,10 +929,8 @@ static void etc1_decodeImage(JNIEnv *env, jclass clazz,
} else if (outB.remaining() < imageSize) {
doThrowIAE(env, "out's remaining data < image size");
} else {
- int result = etc1_decode_image((etc1_byte*) inB.getData(),
- (etc1_byte*) outB.getData(),
- width, height, pixelSize,
- stride);
+ etc1_decode_image((etc1_byte*) inB.getData(), (etc1_byte*) outB.getData(),
+ width, height, pixelSize, stride);
}
}
}