diff options
Diffstat (limited to 'libcutils')
-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 @@ | |||
23 | 23 | ||
24 | #define TAG "android_reboot" | 24 | #define TAG "android_reboot" |
25 | 25 | ||
26 | int android_reboot(int cmd, int flags __unused, const char* arg) { | 26 | int 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 | 38 | int ashmem_create_region(const char* /*ignored*/, size_t size) { |
39 | #define __unused __attribute__((__unused__)) | ||
40 | #endif | ||
41 | |||
42 | int 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 | ||
59 | int ashmem_set_prot_region(int fd __unused, int prot __unused) | 54 | int ashmem_set_prot_region(int /*fd*/, int /*prot*/) { |
60 | { | ||
61 | return 0; | 55 | return 0; |
62 | } | 56 | } |
63 | 57 | ||
64 | int ashmem_pin_region(int fd __unused, size_t offset __unused, size_t len __unused) | 58 | int 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 | ||
69 | int ashmem_unpin_region(int fd __unused, size_t offset __unused, size_t len __unused) | 62 | int 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 | ||
448 | int set_sched_policy(int tid UNUSED, SchedPolicy policy UNUSED) | 446 | int set_sched_policy(int /*tid*/, SchedPolicy /*policy*/) { |
449 | { | ||
450 | return 0; | 447 | return 0; |
451 | } | 448 | } |
452 | 449 | ||
453 | int get_sched_policy(int tid UNUSED, SchedPolicy *policy) | 450 | int 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 | */ |
126 | int socket_local_client_connect(int fd, const char *name, int namespaceId, | 124 | int 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 | ||
367 | static bool dump_entry(void *key, void *value, void *context UNUSED) | 365 | static 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 | |||
23 | atomic_bool atrace_is_ready = ATOMIC_VAR_INIT(true); | 19 | atomic_bool atrace_is_ready = ATOMIC_VAR_INIT(true); |
24 | int atrace_marker_fd = -1; | 20 | int atrace_marker_fd = -1; |
25 | uint64_t atrace_enabled_tags = 0; | 21 | uint64_t atrace_enabled_tags = 0; |
26 | 22 | ||
27 | void atrace_set_debuggable(bool debuggable __unused) { } | 23 | void atrace_set_debuggable(bool /*debuggable*/) {} |
28 | void atrace_set_tracing_enabled(bool enabled __unused) { } | 24 | void atrace_set_tracing_enabled(bool /*enabled*/) {} |
29 | void atrace_update_tags() { } | 25 | void atrace_update_tags() { } |
30 | void atrace_setup() { } | 26 | void atrace_setup() { } |
31 | void atrace_begin_body(const char* name __unused) { } | 27 | void atrace_begin_body(const char* /*name*/) {} |
32 | void atrace_end_body() { } | 28 | void atrace_end_body() { } |
33 | void atrace_async_begin_body(const char* name __unused, int32_t cookie __unused) { } | 29 | void atrace_async_begin_body(const char* /*name*/, int32_t /*cookie*/) {} |
34 | void atrace_async_end_body(const char* name __unused, int32_t cookie __unused) { } | 30 | void atrace_async_end_body(const char* /*name*/, int32_t /*cookie*/) {} |
35 | void atrace_int_body(const char* name __unused, int32_t value __unused) { } | 31 | void atrace_int_body(const char* /*name*/, int32_t /*value*/) {} |
36 | void atrace_int64_body(const char* name __unused, int64_t value __unused) { } | 32 | void atrace_int64_body(const char* /*name*/, int64_t /*value*/) {} |