summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes2017-11-30 18:23:51 -0600
committerElliott Hughes2017-11-30 18:24:36 -0600
commit38d2567c9ffa089661e784b63a5448f8a16572c8 (patch)
treefbeef91072ff19233e17f50fb7cad67647448629 /libcutils
parentaaa0bbce8eadf1a428493f3524066a74447eded4 (diff)
downloadplatform-system-core-38d2567c9ffa089661e784b63a5448f8a16572c8.tar.gz
platform-system-core-38d2567c9ffa089661e784b63a5448f8a16572c8.tar.xz
platform-system-core-38d2567c9ffa089661e784b63a5448f8a16572c8.zip
Stop defining local "unused" macros now this is C++.
Bug: N/A Test: builds, boots Change-Id: I3eb075d5003fa7cdc6690f4af29a296e22be257c
Diffstat (limited to 'libcutils')
-rw-r--r--libcutils/android_reboot.cpp2
-rw-r--r--libcutils/ashmem-host.cpp16
-rw-r--r--libcutils/sched_policy.cpp8
-rw-r--r--libcutils/socket_local_client_unix.cpp6
-rw-r--r--libcutils/str_parms.cpp5
-rw-r--r--libcutils/trace-host.cpp18
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 @@
23 23
24#define TAG "android_reboot" 24#define TAG "android_reboot"
25 25
26int android_reboot(int cmd, int flags __unused, const char* arg) { 26int android_reboot(int cmd, int /*flags*/, const char* arg) {
27 int ret; 27 int ret;
28 const char* restart_cmd = NULL; 28 const char* restart_cmd = NULL;
29 char* prop_value; 29 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 @@
35 35
36#include <utils/Compat.h> 36#include <utils/Compat.h>
37 37
38#ifndef __unused 38int ashmem_create_region(const char* /*ignored*/, size_t size) {
39#define __unused __attribute__((__unused__))
40#endif
41
42int ashmem_create_region(const char *ignored __unused, size_t size)
43{
44 char pattern[PATH_MAX]; 39 char pattern[PATH_MAX];
45 snprintf(pattern, sizeof(pattern), "/tmp/android-ashmem-%d-XXXXXXXXX", getpid()); 40 snprintf(pattern, sizeof(pattern), "/tmp/android-ashmem-%d-XXXXXXXXX", getpid());
46 int fd = mkstemp(pattern); 41 int fd = mkstemp(pattern);
@@ -56,18 +51,15 @@ int ashmem_create_region(const char *ignored __unused, size_t size)
56 return fd; 51 return fd;
57} 52}
58 53
59int ashmem_set_prot_region(int fd __unused, int prot __unused) 54int ashmem_set_prot_region(int /*fd*/, int /*prot*/) {
60{
61 return 0; 55 return 0;
62} 56}
63 57
64int ashmem_pin_region(int fd __unused, size_t offset __unused, size_t len __unused) 58int ashmem_pin_region(int /*fd*/, size_t /*offset*/, size_t /*len*/) {
65{
66 return 0 /*ASHMEM_NOT_PURGED*/; 59 return 0 /*ASHMEM_NOT_PURGED*/;
67} 60}
68 61
69int ashmem_unpin_region(int fd __unused, size_t offset __unused, size_t len __unused) 62int ashmem_unpin_region(int /*fd*/, size_t /*offset*/, size_t /*len*/) {
70{
71 return 0 /*ASHMEM_IS_UNPINNED*/; 63 return 0 /*ASHMEM_IS_UNPINNED*/;
72} 64}
73 65
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 @@
27 27
28#include <log/log.h> 28#include <log/log.h>
29 29
30#define UNUSED __attribute__((__unused__))
31
32/* Re-map SP_DEFAULT to the system default policy, and leave other values unchanged. 30/* Re-map SP_DEFAULT to the system default policy, and leave other values unchanged.
33 * Call this any place a SchedPolicy is used as an input parameter. 31 * Call this any place a SchedPolicy is used as an input parameter.
34 * Returns the possibly re-mapped policy. 32 * Returns the possibly re-mapped policy.
@@ -445,13 +443,11 @@ int set_sched_policy(int tid, SchedPolicy policy)
445 443
446/* Stubs for non-Android targets. */ 444/* Stubs for non-Android targets. */
447 445
448int set_sched_policy(int tid UNUSED, SchedPolicy policy UNUSED) 446int set_sched_policy(int /*tid*/, SchedPolicy /*policy*/) {
449{
450 return 0; 447 return 0;
451} 448}
452 449
453int get_sched_policy(int tid UNUSED, SchedPolicy *policy) 450int get_sched_policy(int /*tid*/, SchedPolicy* policy) {
454{
455 *policy = SP_SYSTEM_DEFAULT; 451 *policy = SP_SYSTEM_DEFAULT;
456 return 0; 452 return 0;
457} 453}
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)
39 39
40#include "socket_local_unix.h" 40#include "socket_local_unix.h"
41 41
42#define UNUSED __attribute__((unused))
43
44#define LISTEN_BACKLOG 4 42#define LISTEN_BACKLOG 4
45 43
46/* Documented in header file. */ 44/* Documented in header file. */
@@ -123,9 +121,7 @@ error:
123 * 121 *
124 * Used by AndroidSocketImpl 122 * Used by AndroidSocketImpl
125 */ 123 */
126int socket_local_client_connect(int fd, const char *name, int namespaceId, 124int socket_local_client_connect(int fd, const char* name, int namespaceId, int /*type*/) {
127 int type UNUSED)
128{
129 struct sockaddr_un addr; 125 struct sockaddr_un addr;
130 socklen_t alen; 126 socklen_t alen;
131 int err; 127 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 @@
30#include <cutils/memory.h> 30#include <cutils/memory.h>
31#include <log/log.h> 31#include <log/log.h>
32 32
33#define UNUSED __attribute__((unused))
34
35/* When an object is allocated but not freed in a function, 33/* When an object is allocated but not freed in a function,
36 * because its ownership is released to other object like a hashmap, 34 * because its ownership is released to other object like a hashmap,
37 * call RELEASE_OWNERSHIP to tell the clang analyzer and avoid 35 * call RELEASE_OWNERSHIP to tell the clang analyzer and avoid
@@ -364,8 +362,7 @@ char *str_parms_to_str(struct str_parms *str_parms)
364 return str; 362 return str;
365} 363}
366 364
367static bool dump_entry(void *key, void *value, void *context UNUSED) 365static bool dump_entry(void* key, void* value, void* /*context*/) {
368{
369 ALOGI("key: '%s' value: '%s'\n", (char *)key, (char *)value); 366 ALOGI("key: '%s' value: '%s'\n", (char *)key, (char *)value);
370 return true; 367 return true;
371} 368}
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 @@
16 16
17#include <cutils/trace.h> 17#include <cutils/trace.h>
18 18
19#ifndef __unused
20#define __unused __attribute__((__unused__))
21#endif
22
23atomic_bool atrace_is_ready = ATOMIC_VAR_INIT(true); 19atomic_bool atrace_is_ready = ATOMIC_VAR_INIT(true);
24int atrace_marker_fd = -1; 20int atrace_marker_fd = -1;
25uint64_t atrace_enabled_tags = 0; 21uint64_t atrace_enabled_tags = 0;
26 22
27void atrace_set_debuggable(bool debuggable __unused) { } 23void atrace_set_debuggable(bool /*debuggable*/) {}
28void atrace_set_tracing_enabled(bool enabled __unused) { } 24void atrace_set_tracing_enabled(bool /*enabled*/) {}
29void atrace_update_tags() { } 25void atrace_update_tags() { }
30void atrace_setup() { } 26void atrace_setup() { }
31void atrace_begin_body(const char* name __unused) { } 27void atrace_begin_body(const char* /*name*/) {}
32void atrace_end_body() { } 28void atrace_end_body() { }
33void atrace_async_begin_body(const char* name __unused, int32_t cookie __unused) { } 29void atrace_async_begin_body(const char* /*name*/, int32_t /*cookie*/) {}
34void atrace_async_end_body(const char* name __unused, int32_t cookie __unused) { } 30void atrace_async_end_body(const char* /*name*/, int32_t /*cookie*/) {}
35void atrace_int_body(const char* name __unused, int32_t value __unused) { } 31void atrace_int_body(const char* /*name*/, int32_t /*value*/) {}
36void atrace_int64_body(const char* name __unused, int64_t value __unused) { } 32void atrace_int64_body(const char* /*name*/, int64_t /*value*/) {}