Merge "Fix a set of random warnings in frameworks/base/" into nyc-dev

am: 359df40aaf

* commit '359df40aaf4be97e94e78465fa06a6b6a018466b':
  Fix a set of random warnings in frameworks/base/
This commit is contained in:
Aurimas Liutikas
2016-02-19 23:37:01 +00:00
committed by android-build-merger
12 changed files with 26 additions and 16 deletions

View File

@@ -18,6 +18,6 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_MODULE := libhidcommand_jni
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -Wall
LOCAL_CFLAGS += -Wall -Wextra -Werror
include $(BUILD_SHARED_LIBRARY)

View File

@@ -49,7 +49,7 @@ static struct {
jmethodID onDeviceError;
} gDeviceCallbackClassInfo;
static int handleLooperEvents(int fd, int events, void* data) {
static int handleLooperEvents(int /* fd */, int events, void* data) {
Device* d = reinterpret_cast<Device*>(data);
return d->handleEvents(events);
}
@@ -183,7 +183,7 @@ std::unique_ptr<uint8_t[]> getData(JNIEnv* env, jbyteArray javaArray, size_t& ou
return data;
}
static jlong openDevice(JNIEnv* env, jclass clazz, jstring rawName, jint id, jint vid, jint pid,
static jlong openDevice(JNIEnv* env, jclass /* clazz */, jstring rawName, jint id, jint vid, jint pid,
jbyteArray rawDescriptor, jobject queue, jobject callback) {
ScopedUtfChars name(env, rawName);
if (name.c_str() == nullptr) {
@@ -202,7 +202,7 @@ static jlong openDevice(JNIEnv* env, jclass clazz, jstring rawName, jint id, jin
return reinterpret_cast<jlong>(d);
}
static void sendReport(JNIEnv* env, jclass clazz, jlong ptr,jbyteArray rawReport) {
static void sendReport(JNIEnv* env, jclass /* clazz */, jlong ptr,jbyteArray rawReport) {
size_t size;
std::unique_ptr<uint8_t[]> report = getData(env, rawReport, size);
uhid::Device* d = reinterpret_cast<uhid::Device*>(ptr);
@@ -211,7 +211,7 @@ static void sendReport(JNIEnv* env, jclass clazz, jlong ptr,jbyteArray rawReport
}
}
static void closeDevice(JNIEnv* env, jclass clazz, jlong ptr) {
static void closeDevice(JNIEnv* /* env */, jclass /* clazz */, jlong ptr) {
uhid::Device* d = reinterpret_cast<uhid::Device*>(ptr);
if (d) {
delete d;

View File

@@ -22,6 +22,8 @@ LOCAL_SRC_FILES := \
LOCAL_SHARED_LIBRARIES := \
libnativehelper
LOCAL_CFLAGS += -Wall -Werror
LOCAL_MODULE := libframeworks_coretests_jni
# this does not prevent build system

View File

@@ -37,7 +37,7 @@ int register_com_android_frameworks_coretests_JNITests(JNIEnv* env) {
/*
* JNI Initialization
*/
jint JNI_OnLoad(JavaVM *jvm, void *reserved) {
jint JNI_OnLoad(JavaVM *jvm, void */* reserved */) {
JNIEnv *e;
int status;

View File

@@ -32,6 +32,8 @@ LOCAL_SRC_FILES:= \
# All of the shard libraries we link against.
LOCAL_SHARED_LIBRARIES := liblog
LOCAL_CFLAGS += -Wall -Wextra -Werror
# Also need the JNI headers.
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE)

View File

@@ -22,7 +22,7 @@
#include "jni.h"
static jint
add(JNIEnv *env, jobject thiz, jint a, jint b) {
add(JNIEnv */* env */, jobject /* thiz */, jint a, jint b) {
int result = a + b;
ALOGI("%d + %d = %d", a, b, result);
return result;
@@ -82,7 +82,7 @@ typedef union {
void* venv;
} UnionJNIEnvToVoid;
jint JNI_OnLoad(JavaVM* vm, void* reserved)
jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
{
UnionJNIEnvToVoid uenv;
uenv.venv = NULL;

View File

@@ -34,6 +34,8 @@ LOCAL_SRC_FILES:= \
LOCAL_SHARED_LIBRARIES := \
libutils liblog
LOCAL_CFLAGS += -Wall -Wextra -Werror
# Also need the JNI headers.
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE)

View File

@@ -22,7 +22,7 @@
#include "jni.h"
static jint
add(JNIEnv *env, jobject thiz, jint a, jint b) {
add(JNIEnv */* env */, jobject /* thiz */, jint a, jint b) {
int result = a + b;
ALOGI("%d + %d = %d", a, b, result);
return result;
@@ -82,7 +82,7 @@ typedef union {
void* venv;
} UnionJNIEnvToVoid;
jint JNI_OnLoad(JavaVM* vm, void* reserved)
jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
{
UnionJNIEnvToVoid uenv;
uenv.venv = NULL;

View File

@@ -33,6 +33,8 @@ LOCAL_SRC_FILES:= \
LOCAL_LDLIBS = -llog
LOCAL_SHARED_LIBRARIES := liblog
LOCAL_CFLAGS += -Wall -Wextra -Werror
# Also need the JNI headers.
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE)

View File

@@ -22,7 +22,7 @@
#include "jni.h"
static jint
add(JNIEnv *env, jobject thiz, jint a, jint b) {
add(JNIEnv */* env */, jobject /* thiz */, jint a, jint b) {
int result = a + b;
ALOGI("%d + %d = %d", a, b, result);
return result;
@@ -82,7 +82,7 @@ typedef union {
void* venv;
} UnionJNIEnvToVoid;
jint JNI_OnLoad(JavaVM* vm, void* reserved)
jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
{
UnionJNIEnvToVoid uenv;
uenv.venv = NULL;

View File

@@ -9,6 +9,8 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_MODULE:= test-touchlag
LOCAL_CFLAGS += -Wall -Wextra -Werror
LOCAL_MODULE_TAGS := tests
include $(BUILD_EXECUTABLE)

View File

@@ -54,11 +54,11 @@ void clearBuffer(Buffer* buf, uint32_t pixel) {
void drawTwoPixels(Buffer* buf, uint32_t pixel, ssize_t x, ssize_t y, size_t w) {
if (y>0 && y<ssize_t(buf->h)) {
uint32_t* bits = buf->pixels + y * buf->s;
if (x>=0 && x<buf->w) {
if (x>=0 && x<ssize_t(buf->w)) {
bits[x] = pixel;
}
ssize_t W(w);
if ((x+W)>=0 && (x+W)<buf->w) {
if ((x+W)>=0 && (x+W)<ssize_t(buf->w)) {
bits[x+W] = pixel;
}
}
@@ -251,13 +251,13 @@ int main(int argc, char** argv) {
Queue queue;
int x=0, y=0, down=0;
int x=0, y=0;
int lag_x=0, lag_y=0;
clearBuffer(&framebuffer, 0);
while (true) {
uint32_t crt = 0;
int err = ioctl(fd, FBIO_WAITFORVSYNC, &crt);
ioctl(fd, FBIO_WAITFORVSYNC, &crt);
// draw beam marker
drawRect(&framebuffer, 0x400000, framebuffer.w-2, 0, 2, framebuffer.h);