Merge "Frameworks/base: Turn on -Wall -Werror in cmds"
This commit is contained in:
@@ -3,17 +3,17 @@ LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES:= \
|
||||
app_main.cpp
|
||||
app_main.cpp
|
||||
|
||||
LOCAL_LDFLAGS := -Wl,--version-script,art/sigchainlib/version-script.txt -Wl,--export-dynamic
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libdl \
|
||||
libcutils \
|
||||
libutils \
|
||||
liblog \
|
||||
libbinder \
|
||||
libandroid_runtime
|
||||
libdl \
|
||||
libcutils \
|
||||
libutils \
|
||||
liblog \
|
||||
libbinder \
|
||||
libandroid_runtime
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
|
||||
|
||||
@@ -21,6 +21,9 @@ LOCAL_MODULE:= app_process
|
||||
LOCAL_MULTILIB := both
|
||||
LOCAL_MODULE_STEM_32 := app_process32
|
||||
LOCAL_MODULE_STEM_64 := app_process64
|
||||
|
||||
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
# Create a symlink from app_process to app_process32 or 64
|
||||
@@ -34,14 +37,14 @@ ifeq ($(TARGET_ARCH),arm)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES:= \
|
||||
app_main.cpp
|
||||
app_main.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libcutils \
|
||||
libutils \
|
||||
liblog \
|
||||
libbinder \
|
||||
libandroid_runtime
|
||||
libcutils \
|
||||
libutils \
|
||||
liblog \
|
||||
libbinder \
|
||||
libandroid_runtime
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
|
||||
|
||||
@@ -54,6 +57,8 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)/asan
|
||||
LOCAL_MODULE_STEM := app_process
|
||||
LOCAL_ADDRESS_SANITIZER := true
|
||||
|
||||
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
endif # ifeq($(TARGET_ARCH),arm)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
namespace android {
|
||||
|
||||
void app_usage()
|
||||
static void app_usage()
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: app_process [java-options] cmd-dir start-class-name [options]\n");
|
||||
|
||||
@@ -12,4 +12,6 @@ LOCAL_MODULE:= btool
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
@@ -25,8 +25,7 @@ using namespace android;
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
usage(int argc, const char** argv)
|
||||
static int usage(int /* argc */, const char** argv)
|
||||
{
|
||||
const char* p = argv[0];
|
||||
|
||||
@@ -44,15 +43,13 @@ usage(int argc, const char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
perform_full_backup()
|
||||
static int perform_full_backup()
|
||||
{
|
||||
printf("this would have written all of your data to stdout\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
perform_list(const char* filename)
|
||||
static int perform_list(const char* filename)
|
||||
{
|
||||
int err;
|
||||
int fd;
|
||||
@@ -95,14 +92,13 @@ perform_list(const char* filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int perform_print(const char* entityname, const char* filename)
|
||||
static int perform_print(const char* entityname, const char* filename)
|
||||
{
|
||||
printf("perform_print(%s, %s);", entityname, filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, const char** argv)
|
||||
int main(int argc, const char** argv)
|
||||
{
|
||||
if (argc <= 1) {
|
||||
return perform_full_backup();
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -25,4 +25,6 @@ LOCAL_C_INCLUDES := external/zlib
|
||||
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace {
|
||||
if (entry == NULL) {
|
||||
return -1;
|
||||
}
|
||||
if (!zip->getEntryInfo(entry, NULL, NULL, NULL, NULL, NULL, (long*)crc)) {
|
||||
if (!zip->getEntryInfo(entry, NULL, NULL, NULL, NULL, NULL, reinterpret_cast<long*>(crc))) {
|
||||
return -1;
|
||||
}
|
||||
zip->releaseEntry(entry);
|
||||
@@ -66,7 +66,7 @@ fail:
|
||||
fprintf(stderr, "error: write: %s\n", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
bytesLeft -= w;
|
||||
bytesLeft -= static_cast<size_t>(w);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ fail:
|
||||
}
|
||||
|
||||
char buf[N];
|
||||
ssize_t bytesLeft = N;
|
||||
size_t bytesLeft = N;
|
||||
if (lseek(idmap_fd, SEEK_SET, 0) < 0) {
|
||||
return true;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ fail:
|
||||
if (r < 0) {
|
||||
return true;
|
||||
}
|
||||
bytesLeft -= r;
|
||||
bytesLeft -= static_cast<size_t>(r);
|
||||
if (bytesLeft == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -152,13 +152,13 @@ namespace {
|
||||
printe("failed to get resource name id=0x%08x\n", res_id);
|
||||
return UNKNOWN_ERROR;
|
||||
}
|
||||
if (package) {
|
||||
if (package != NULL) {
|
||||
*package = String8(String16(data.package, data.packageLen));
|
||||
}
|
||||
if (type) {
|
||||
if (type != NULL) {
|
||||
*type = String8(String16(data.type, data.typeLen));
|
||||
}
|
||||
if (name) {
|
||||
if (name != NULL) {
|
||||
*name = String8(String16(data.name, data.nameLen));
|
||||
}
|
||||
return NO_ERROR;
|
||||
|
||||
@@ -64,30 +64,6 @@ namespace {
|
||||
return String8(tmp);
|
||||
}
|
||||
|
||||
int mkdir_p(const String8& path, uid_t uid, gid_t gid)
|
||||
{
|
||||
static const mode_t mode =
|
||||
S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH;
|
||||
struct stat st;
|
||||
|
||||
if (stat(path.string(), &st) == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (mkdir_p(path.getPathDir(), uid, gid) < 0) {
|
||||
return -1;
|
||||
}
|
||||
if (mkdir(path.string(), 0755) != 0) {
|
||||
return -1;
|
||||
}
|
||||
if (chown(path.string(), uid, gid) == -1) {
|
||||
return -1;
|
||||
}
|
||||
if (chmod(path.string(), mode) == -1) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int parse_overlay_tag(const ResXMLTree& parser, const char *target_package_name)
|
||||
{
|
||||
const size_t N = parser.getAttributeCount();
|
||||
@@ -98,7 +74,7 @@ namespace {
|
||||
String16 key(parser.getAttributeName(i, &len));
|
||||
if (key == String16("targetPackage")) {
|
||||
const uint16_t *p = parser.getAttributeStringValue(i, &len);
|
||||
if (p) {
|
||||
if (p != NULL) {
|
||||
target = String16(p, len);
|
||||
}
|
||||
} else if (key == String16("priority")) {
|
||||
@@ -164,7 +140,7 @@ namespace {
|
||||
return -1;
|
||||
}
|
||||
FileMap *dataMap = zip->createEntryFileMap(entry);
|
||||
if (!dataMap) {
|
||||
if (dataMap == NULL) {
|
||||
ALOGW("%s: failed to create FileMap\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ LOCAL_SRC_FILES := \
|
||||
LOCAL_MODULE := interrupter
|
||||
LOCAL_MODULE_TAGS := eng tests
|
||||
LOCAL_LDFLAGS := -ldl
|
||||
LOCAL_CFLAGS := -Wall -Werror -Wunused -Wunreachable-code
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -17,5 +18,6 @@ LOCAL_SRC_FILES := \
|
||||
LOCAL_MODULE := interrupter
|
||||
LOCAL_MODULE_TAGS := eng tests
|
||||
LOCAL_LDFLAGS := -ldl
|
||||
LOCAL_CFLAGS := -Wall -Werror -Wunused -Wunreachable-code
|
||||
|
||||
include $(BUILD_HOST_SHARED_LIBRARY)
|
||||
include $(BUILD_HOST_SHARED_LIBRARY)
|
||||
|
||||
@@ -2,13 +2,13 @@ LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES:= \
|
||||
screencap.cpp
|
||||
screencap.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libcutils \
|
||||
libutils \
|
||||
libbinder \
|
||||
libskia \
|
||||
libcutils \
|
||||
libutils \
|
||||
libbinder \
|
||||
libskia \
|
||||
libui \
|
||||
libgui
|
||||
|
||||
@@ -16,4 +16,6 @@ LOCAL_MODULE:= screencap
|
||||
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
@@ -32,10 +32,14 @@
|
||||
|
||||
#include <ui/PixelFormat.h>
|
||||
|
||||
// TODO: Fix Skia.
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#include <SkImageEncoder.h>
|
||||
#include <SkBitmap.h>
|
||||
#include <SkData.h>
|
||||
#include <SkStream.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
using namespace android;
|
||||
|
||||
@@ -129,7 +133,7 @@ int main(int argc, char** argv)
|
||||
argv += optind;
|
||||
|
||||
int fd = -1;
|
||||
const char* fn;
|
||||
const char* fn = NULL;
|
||||
if (argc == 0) {
|
||||
fd = dup(STDOUT_FILENO);
|
||||
} else if (argc == 1) {
|
||||
@@ -153,7 +157,7 @@ int main(int argc, char** argv)
|
||||
void const* mapbase = MAP_FAILED;
|
||||
ssize_t mapsize = -1;
|
||||
|
||||
void const* base = 0;
|
||||
void const* base = NULL;
|
||||
uint32_t w, s, h, f;
|
||||
size_t size = 0;
|
||||
|
||||
@@ -190,7 +194,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (base) {
|
||||
if (base != NULL) {
|
||||
if (png) {
|
||||
const SkImageInfo info = SkImageInfo::Make(w, h, flinger2skia(f),
|
||||
kPremul_SkAlphaType);
|
||||
@@ -202,7 +206,9 @@ int main(int argc, char** argv)
|
||||
SkData* streamData = stream.copyToData();
|
||||
write(fd, streamData->data(), streamData->size());
|
||||
streamData->unref();
|
||||
notifyMediaScanner(fn);
|
||||
if (fn != NULL) {
|
||||
notifyMediaScanner(fn);
|
||||
}
|
||||
} else {
|
||||
write(fd, &w, 4);
|
||||
write(fd, &h, 4);
|
||||
|
||||
Reference in New Issue
Block a user