diff options
author | Elliott Hughes <enh@google.com> | 2017-11-30 16:23:51 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2017-11-30 16:24:36 -0800 |
commit | 38d2567c9ffa089661e784b63a5448f8a16572c8 (patch) | |
tree | fbeef91072ff19233e17f50fb7cad67647448629 | |
parent | aaa0bbce8eadf1a428493f3524066a74447eded4 (diff) | |
download | core-38d2567c9ffa089661e784b63a5448f8a16572c8.tar.gz core-38d2567c9ffa089661e784b63a5448f8a16572c8.tar.bz2 core-38d2567c9ffa089661e784b63a5448f8a16572c8.zip |
Stop defining local "unused" macros now this is C++.
Bug: N/A
Test: builds, boots
Change-Id: I3eb075d5003fa7cdc6690f4af29a296e22be257c
-rw-r--r-- | libcutils/android_reboot.cpp | 2 | ||||
-rw-r--r-- | libcutils/ashmem-host.cpp | 16 | ||||
-rw-r--r-- | libcutils/sched_policy.cpp | 8 | ||||
-rw-r--r-- | libcutils/socket_local_client_unix.cpp | 6 | ||||
-rw-r--r-- | libcutils/str_parms.cpp | 5 | ||||
-rw-r--r-- | libcutils/trace-host.cpp | 18 |
6 files changed, 16 insertions, 39 deletions
diff --git a/libcutils/android_reboot.cpp b/libcutils/android_reboot.cpp index 5e864d442..ce41cd320 100644 --- a/libcutils/android_reboot.cpp +++ b/libcutils/android_reboot.cpp @@ -23,7 +23,7 @@ #define TAG "android_reboot" -int android_reboot(int cmd, int flags __unused, const char* arg) { +int android_reboot(int cmd, int /*flags*/, const char* arg) { int ret; const char* restart_cmd = NULL; char* prop_value; diff --git a/libcutils/ashmem-host.cpp b/libcutils/ashmem-host.cpp index d2c28f393..b2bec9966 100644 --- a/libcutils/ashmem-host.cpp +++ b/libcutils/ashmem-host.cpp @@ -35,12 +35,7 @@ #include <utils/Compat.h> -#ifndef __unused -#define __unused __attribute__((__unused__)) -#endif - -int ashmem_create_region(const char *ignored __unused, size_t size) -{ +int ashmem_create_region(const char* /*ignored*/, size_t size) { char pattern[PATH_MAX]; snprintf(pattern, sizeof(pattern), "/tmp/android-ashmem-%d-XXXXXXXXX", getpid()); int fd = mkstemp(pattern); @@ -56,18 +51,15 @@ int ashmem_create_region(const char *ignored __unused, size_t size) return fd; } -int ashmem_set_prot_region(int fd __unused, int prot __unused) -{ +int ashmem_set_prot_region(int /*fd*/, int /*prot*/) { return 0; } -int ashmem_pin_region(int fd __unused, size_t offset __unused, size_t len __unused) -{ +int ashmem_pin_region(int /*fd*/, size_t /*offset*/, size_t /*len*/) { return 0 /*ASHMEM_NOT_PURGED*/; } -int ashmem_unpin_region(int fd __unused, size_t offset __unused, size_t len __unused) -{ +int ashmem_unpin_region(int /*fd*/, size_t /*offset*/, size_t /*len*/) { return 0 /*ASHMEM_IS_UNPINNED*/; } diff --git a/libcutils/sched_policy.cpp b/libcutils/sched_policy.cpp index 0e6d33333..f5ce82fea 100644 --- a/libcutils/sched_policy.cpp +++ b/libcutils/sched_policy.cpp @@ -27,8 +27,6 @@ #include <log/log.h> -#define UNUSED __attribute__((__unused__)) - /* Re-map SP_DEFAULT to the system default policy, and leave other values unchanged. * Call this any place a SchedPolicy is used as an input parameter. * Returns the possibly re-mapped policy. @@ -445,13 +443,11 @@ int set_sched_policy(int tid, SchedPolicy policy) /* Stubs for non-Android targets. */ -int set_sched_policy(int tid UNUSED, SchedPolicy policy UNUSED) -{ +int set_sched_policy(int /*tid*/, SchedPolicy /*policy*/) { return 0; } -int get_sched_policy(int tid UNUSED, SchedPolicy *policy) -{ +int get_sched_policy(int /*tid*/, SchedPolicy* policy) { *policy = SP_SYSTEM_DEFAULT; return 0; } diff --git a/libcutils/socket_local_client_unix.cpp b/libcutils/socket_local_client_unix.cpp index 68b2b0ce9..d2b4909d9 100644 --- a/libcutils/socket_local_client_unix.cpp +++ b/libcutils/socket_local_client_unix.cpp @@ -39,8 +39,6 @@ int socket_local_client(const char *name, int namespaceId, int type) #include "socket_local_unix.h" -#define UNUSED __attribute__((unused)) - #define LISTEN_BACKLOG 4 /* Documented in header file. */ @@ -123,9 +121,7 @@ error: * * Used by AndroidSocketImpl */ -int socket_local_client_connect(int fd, const char *name, int namespaceId, - int type UNUSED) -{ +int socket_local_client_connect(int fd, const char* name, int namespaceId, int /*type*/) { struct sockaddr_un addr; socklen_t alen; int err; diff --git a/libcutils/str_parms.cpp b/libcutils/str_parms.cpp index 139d62f6d..f5a52a767 100644 --- a/libcutils/str_parms.cpp +++ b/libcutils/str_parms.cpp @@ -30,8 +30,6 @@ #include <cutils/memory.h> #include <log/log.h> -#define UNUSED __attribute__((unused)) - /* When an object is allocated but not freed in a function, * because its ownership is released to other object like a hashmap, * call RELEASE_OWNERSHIP to tell the clang analyzer and avoid @@ -364,8 +362,7 @@ char *str_parms_to_str(struct str_parms *str_parms) return str; } -static bool dump_entry(void *key, void *value, void *context UNUSED) -{ +static bool dump_entry(void* key, void* value, void* /*context*/) { ALOGI("key: '%s' value: '%s'\n", (char *)key, (char *)value); return true; } diff --git a/libcutils/trace-host.cpp b/libcutils/trace-host.cpp index 05842cd7d..d47cc1861 100644 --- a/libcutils/trace-host.cpp +++ b/libcutils/trace-host.cpp @@ -16,21 +16,17 @@ #include <cutils/trace.h> -#ifndef __unused -#define __unused __attribute__((__unused__)) -#endif - atomic_bool atrace_is_ready = ATOMIC_VAR_INIT(true); int atrace_marker_fd = -1; uint64_t atrace_enabled_tags = 0; -void atrace_set_debuggable(bool debuggable __unused) { } -void atrace_set_tracing_enabled(bool enabled __unused) { } +void atrace_set_debuggable(bool /*debuggable*/) {} +void atrace_set_tracing_enabled(bool /*enabled*/) {} void atrace_update_tags() { } void atrace_setup() { } -void atrace_begin_body(const char* name __unused) { } +void atrace_begin_body(const char* /*name*/) {} void atrace_end_body() { } -void atrace_async_begin_body(const char* name __unused, int32_t cookie __unused) { } -void atrace_async_end_body(const char* name __unused, int32_t cookie __unused) { } -void atrace_int_body(const char* name __unused, int32_t value __unused) { } -void atrace_int64_body(const char* name __unused, int64_t value __unused) { } +void atrace_async_begin_body(const char* /*name*/, int32_t /*cookie*/) {} +void atrace_async_end_body(const char* /*name*/, int32_t /*cookie*/) {} +void atrace_int_body(const char* /*name*/, int32_t /*value*/) {} +void atrace_int64_body(const char* /*name*/, int64_t /*value*/) {} |