Merge "Fix a set of random warnings in frameworks/base/" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
359df40aaf
@@ -18,6 +18,6 @@ LOCAL_SHARED_LIBRARIES := \
|
|||||||
LOCAL_MODULE := libhidcommand_jni
|
LOCAL_MODULE := libhidcommand_jni
|
||||||
LOCAL_MODULE_TAGS := optional
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
|
||||||
LOCAL_CFLAGS += -Wall
|
LOCAL_CFLAGS += -Wall -Wextra -Werror
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ static struct {
|
|||||||
jmethodID onDeviceError;
|
jmethodID onDeviceError;
|
||||||
} gDeviceCallbackClassInfo;
|
} 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);
|
Device* d = reinterpret_cast<Device*>(data);
|
||||||
return d->handleEvents(events);
|
return d->handleEvents(events);
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ std::unique_ptr<uint8_t[]> getData(JNIEnv* env, jbyteArray javaArray, size_t& ou
|
|||||||
return data;
|
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) {
|
jbyteArray rawDescriptor, jobject queue, jobject callback) {
|
||||||
ScopedUtfChars name(env, rawName);
|
ScopedUtfChars name(env, rawName);
|
||||||
if (name.c_str() == nullptr) {
|
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);
|
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;
|
size_t size;
|
||||||
std::unique_ptr<uint8_t[]> report = getData(env, rawReport, size);
|
std::unique_ptr<uint8_t[]> report = getData(env, rawReport, size);
|
||||||
uhid::Device* d = reinterpret_cast<uhid::Device*>(ptr);
|
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);
|
uhid::Device* d = reinterpret_cast<uhid::Device*>(ptr);
|
||||||
if (d) {
|
if (d) {
|
||||||
delete d;
|
delete d;
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ LOCAL_SRC_FILES := \
|
|||||||
LOCAL_SHARED_LIBRARIES := \
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
libnativehelper
|
libnativehelper
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -Wall -Werror
|
||||||
|
|
||||||
LOCAL_MODULE := libframeworks_coretests_jni
|
LOCAL_MODULE := libframeworks_coretests_jni
|
||||||
|
|
||||||
# this does not prevent build system
|
# this does not prevent build system
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ int register_com_android_frameworks_coretests_JNITests(JNIEnv* env) {
|
|||||||
/*
|
/*
|
||||||
* JNI Initialization
|
* JNI Initialization
|
||||||
*/
|
*/
|
||||||
jint JNI_OnLoad(JavaVM *jvm, void *reserved) {
|
jint JNI_OnLoad(JavaVM *jvm, void */* reserved */) {
|
||||||
JNIEnv *e;
|
JNIEnv *e;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ LOCAL_SRC_FILES:= \
|
|||||||
# All of the shard libraries we link against.
|
# All of the shard libraries we link against.
|
||||||
LOCAL_SHARED_LIBRARIES := liblog
|
LOCAL_SHARED_LIBRARIES := liblog
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -Wall -Wextra -Werror
|
||||||
|
|
||||||
# Also need the JNI headers.
|
# Also need the JNI headers.
|
||||||
LOCAL_C_INCLUDES += \
|
LOCAL_C_INCLUDES += \
|
||||||
$(JNI_H_INCLUDE)
|
$(JNI_H_INCLUDE)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "jni.h"
|
#include "jni.h"
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
add(JNIEnv *env, jobject thiz, jint a, jint b) {
|
add(JNIEnv */* env */, jobject /* thiz */, jint a, jint b) {
|
||||||
int result = a + b;
|
int result = a + b;
|
||||||
ALOGI("%d + %d = %d", a, b, result);
|
ALOGI("%d + %d = %d", a, b, result);
|
||||||
return result;
|
return result;
|
||||||
@@ -82,7 +82,7 @@ typedef union {
|
|||||||
void* venv;
|
void* venv;
|
||||||
} UnionJNIEnvToVoid;
|
} UnionJNIEnvToVoid;
|
||||||
|
|
||||||
jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
|
||||||
{
|
{
|
||||||
UnionJNIEnvToVoid uenv;
|
UnionJNIEnvToVoid uenv;
|
||||||
uenv.venv = NULL;
|
uenv.venv = NULL;
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ LOCAL_SRC_FILES:= \
|
|||||||
LOCAL_SHARED_LIBRARIES := \
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
libutils liblog
|
libutils liblog
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -Wall -Wextra -Werror
|
||||||
|
|
||||||
# Also need the JNI headers.
|
# Also need the JNI headers.
|
||||||
LOCAL_C_INCLUDES += \
|
LOCAL_C_INCLUDES += \
|
||||||
$(JNI_H_INCLUDE)
|
$(JNI_H_INCLUDE)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "jni.h"
|
#include "jni.h"
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
add(JNIEnv *env, jobject thiz, jint a, jint b) {
|
add(JNIEnv */* env */, jobject /* thiz */, jint a, jint b) {
|
||||||
int result = a + b;
|
int result = a + b;
|
||||||
ALOGI("%d + %d = %d", a, b, result);
|
ALOGI("%d + %d = %d", a, b, result);
|
||||||
return result;
|
return result;
|
||||||
@@ -82,7 +82,7 @@ typedef union {
|
|||||||
void* venv;
|
void* venv;
|
||||||
} UnionJNIEnvToVoid;
|
} UnionJNIEnvToVoid;
|
||||||
|
|
||||||
jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
|
||||||
{
|
{
|
||||||
UnionJNIEnvToVoid uenv;
|
UnionJNIEnvToVoid uenv;
|
||||||
uenv.venv = NULL;
|
uenv.venv = NULL;
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ LOCAL_SRC_FILES:= \
|
|||||||
LOCAL_LDLIBS = -llog
|
LOCAL_LDLIBS = -llog
|
||||||
LOCAL_SHARED_LIBRARIES := liblog
|
LOCAL_SHARED_LIBRARIES := liblog
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -Wall -Wextra -Werror
|
||||||
|
|
||||||
# Also need the JNI headers.
|
# Also need the JNI headers.
|
||||||
LOCAL_C_INCLUDES += \
|
LOCAL_C_INCLUDES += \
|
||||||
$(JNI_H_INCLUDE)
|
$(JNI_H_INCLUDE)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "jni.h"
|
#include "jni.h"
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
add(JNIEnv *env, jobject thiz, jint a, jint b) {
|
add(JNIEnv */* env */, jobject /* thiz */, jint a, jint b) {
|
||||||
int result = a + b;
|
int result = a + b;
|
||||||
ALOGI("%d + %d = %d", a, b, result);
|
ALOGI("%d + %d = %d", a, b, result);
|
||||||
return result;
|
return result;
|
||||||
@@ -82,7 +82,7 @@ typedef union {
|
|||||||
void* venv;
|
void* venv;
|
||||||
} UnionJNIEnvToVoid;
|
} UnionJNIEnvToVoid;
|
||||||
|
|
||||||
jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
|
||||||
{
|
{
|
||||||
UnionJNIEnvToVoid uenv;
|
UnionJNIEnvToVoid uenv;
|
||||||
uenv.venv = NULL;
|
uenv.venv = NULL;
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ LOCAL_SHARED_LIBRARIES := \
|
|||||||
|
|
||||||
LOCAL_MODULE:= test-touchlag
|
LOCAL_MODULE:= test-touchlag
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -Wall -Wextra -Werror
|
||||||
|
|
||||||
LOCAL_MODULE_TAGS := tests
|
LOCAL_MODULE_TAGS := tests
|
||||||
|
|
||||||
include $(BUILD_EXECUTABLE)
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|||||||
@@ -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) {
|
void drawTwoPixels(Buffer* buf, uint32_t pixel, ssize_t x, ssize_t y, size_t w) {
|
||||||
if (y>0 && y<ssize_t(buf->h)) {
|
if (y>0 && y<ssize_t(buf->h)) {
|
||||||
uint32_t* bits = buf->pixels + y * buf->s;
|
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;
|
bits[x] = pixel;
|
||||||
}
|
}
|
||||||
ssize_t W(w);
|
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;
|
bits[x+W] = pixel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,13 +251,13 @@ int main(int argc, char** argv) {
|
|||||||
Queue queue;
|
Queue queue;
|
||||||
|
|
||||||
|
|
||||||
int x=0, y=0, down=0;
|
int x=0, y=0;
|
||||||
int lag_x=0, lag_y=0;
|
int lag_x=0, lag_y=0;
|
||||||
|
|
||||||
clearBuffer(&framebuffer, 0);
|
clearBuffer(&framebuffer, 0);
|
||||||
while (true) {
|
while (true) {
|
||||||
uint32_t crt = 0;
|
uint32_t crt = 0;
|
||||||
int err = ioctl(fd, FBIO_WAITFORVSYNC, &crt);
|
ioctl(fd, FBIO_WAITFORVSYNC, &crt);
|
||||||
|
|
||||||
// draw beam marker
|
// draw beam marker
|
||||||
drawRect(&framebuffer, 0x400000, framebuffer.w-2, 0, 2, framebuffer.h);
|
drawRect(&framebuffer, 0x400000, framebuffer.w-2, 0, 2, framebuffer.h);
|
||||||
|
|||||||
Reference in New Issue
Block a user