Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a32e01d2 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Gerrit Code Review
Browse files

Merge "libcutils: turn on -Werror"

parents 3754791d 12717169
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ LOCAL_MODULE := libcutils
LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
LOCAL_LDLIBS := -lpthread
LOCAL_STATIC_LIBRARIES := liblog
LOCAL_CFLAGS += $(hostSmpFlag)
LOCAL_CFLAGS += $(hostSmpFlag) -Werror
include $(BUILD_HOST_STATIC_LIBRARY)


@@ -88,14 +88,14 @@ LOCAL_MODULE := lib64cutils
LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
LOCAL_LDLIBS := -lpthread
LOCAL_STATIC_LIBRARIES := lib64log
LOCAL_CFLAGS += $(hostSmpFlag) -m64
LOCAL_CFLAGS += $(hostSmpFlag) -m64 -Werror
include $(BUILD_HOST_STATIC_LIBRARY)

# Tests for host
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := tst_str_parms
LOCAL_CFLAGS += -DTEST_STR_PARMS
LOCAL_CFLAGS += -DTEST_STR_PARMS -Werror
LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c
LOCAL_STATIC_LIBRARIES := liblog
LOCAL_MODULE_TAGS := optional
@@ -135,7 +135,7 @@ endif # !arm

LOCAL_C_INCLUDES := $(libcutils_c_includes)
LOCAL_STATIC_LIBRARIES := liblog
LOCAL_CFLAGS += $(targetSmpFlag)
LOCAL_CFLAGS += $(targetSmpFlag) -Werror
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
@@ -144,13 +144,13 @@ LOCAL_MODULE := libcutils
# liblog symbols present in libcutils.
LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog
LOCAL_SHARED_LIBRARIES := liblog
LOCAL_CFLAGS += $(targetSmpFlag)
LOCAL_CFLAGS += $(targetSmpFlag) -Werror
LOCAL_C_INCLUDES := $(libcutils_c_includes)
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := tst_str_parms
LOCAL_CFLAGS += -DTEST_STR_PARMS
LOCAL_CFLAGS += -DTEST_STR_PARMS -Werror
LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c
LOCAL_SHARED_LIBRARIES := liblog
LOCAL_MODULE_TAGS := optional
+13 −11
Original line number Diff line number Diff line
@@ -19,20 +19,22 @@
 * an ashmem-enabled kernel. See ashmem-dev.c for the real ashmem-based version.
 */

#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#include <limits.h>
#include <unistd.h>

#include <cutils/ashmem.h>

int ashmem_create_region(const char *ignored, size_t size)
#define __unused __attribute__((__unused__))

int ashmem_create_region(const char *ignored __unused, size_t size)
{
	static const char txt[] = "abcdefghijklmnopqrstuvwxyz"
				  "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -78,17 +80,17 @@ error:
	return -1;
}

int ashmem_set_prot_region(int fd, int prot)
int ashmem_set_prot_region(int fd __unused, int prot __unused)
{
	return 0;
}

int ashmem_pin_region(int fd, size_t offset, size_t len)
int ashmem_pin_region(int fd __unused, size_t offset __unused, size_t len __unused)
{
	return ASHMEM_NOT_PURGED;
}

int ashmem_unpin_region(int fd, size_t offset, size_t len)
int ashmem_unpin_region(int fd __unused, size_t offset __unused, size_t len __unused)
{
	return ASHMEM_IS_UNPINNED;
}
+4 −5
Original line number Diff line number Diff line
/* libs/cutils/cpu_info.c
**
/*
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License"); 
@@ -15,11 +14,12 @@
** limitations under the License.
*/

#include <cutils/cpu_info.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <cutils/cpu_info.h>

// we cache the serial number here.
// this is also used as a fgets() line buffer when we are reading /proc/cpuinfo
static char serial_number[100] = { 0 };
@@ -31,7 +31,6 @@ extern const char* get_cpu_serial_number(void)
        FILE* file;
        char* chp, *end;
        char* whitespace;
        int length;
        
        // read serial number from /proc/cpuinfo
        file = fopen("proc/cpuinfo", "r");
+6 −4
Original line number Diff line number Diff line
@@ -15,20 +15,22 @@
 */

#include "../../../bionic/libc/bionic/dlmalloc.h"
#include "cutils/log.h"
#include "log/log.h"

#define UNUSED __attribute__((__unused__))

/*
 * Stubs for functions defined in bionic/libc/bionic/dlmalloc.c. These
 * are used in host builds, as the host libc will not contain these
 * functions.
 */
void dlmalloc_inspect_all(void(*handler)(void*, void *, size_t, void*),
                          void* arg)
void dlmalloc_inspect_all(void(*handler)(void*, void *, size_t, void*) UNUSED,
                          void* arg UNUSED)
{
  ALOGW("Called host unimplemented stub: dlmalloc_inspect_all");
}

int dlmalloc_trim(size_t unused)
int dlmalloc_trim(size_t unused UNUSED)
{
  ALOGW("Called host unimplemented stub: dlmalloc_trim");
  return 0;
+8 −6
Original line number Diff line number Diff line
/*
**
** Copyright 2007-2014, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License"); 
@@ -15,12 +14,12 @@
** limitations under the License.
*/

#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>

#ifdef HAVE_SCHED_H

@@ -30,6 +29,9 @@
/* #include <linux/ioprio.h> */
extern int ioprio_set(int which, int who, int ioprio);
extern int ioprio_get(int which, int who);
#define __android_unused
#else
#define __android_unused __attribute__((__unused__))
#endif

enum {
@@ -41,7 +43,7 @@ enum {
#define CLASS_SHIFT 13
#define IOPRIO_NORM 4

int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio) {
int android_set_ioprio(int pid __android_unused, IoSchedClass clazz __android_unused, int ioprio __android_unused) {
#ifdef HAVE_ANDROID_OS
    if (ioprio_set(WHO_PROCESS, pid, ioprio | (clazz << CLASS_SHIFT))) {
        return -1;
@@ -50,7 +52,7 @@ int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio) {
    return 0;
}

int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio) {
int android_get_ioprio(int pid __android_unused, IoSchedClass *clazz, int *ioprio) {
#ifdef HAVE_ANDROID_OS
    int rc;

Loading