diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/backtrace/BacktraceMap.h | 1 | ||||
-rw-r--r-- | include/cutils/bitops.h | 4 | ||||
-rw-r--r-- | include/cutils/fs.h | 1 | ||||
-rw-r--r-- | include/cutils/list.h | 14 | ||||
-rw-r--r-- | include/cutils/trace.h | 1 | ||||
-rw-r--r-- | include/log/log_read.h | 13 | ||||
-rw-r--r-- | include/log/logger.h | 5 | ||||
-rw-r--r-- | include/netd_client/FwmarkCommands.h | 29 | ||||
-rw-r--r-- | include/private/android_filesystem_config.h | 3 | ||||
-rw-r--r-- | include/system/audio.h | 8 | ||||
-rw-r--r-- | include/system/window.h | 35 | ||||
-rw-r--r-- | include/utils/Functor.h | 2 | ||||
-rw-r--r-- | include/utils/LruCache.h | 12 |
13 files changed, 74 insertions, 54 deletions
diff --git a/include/backtrace/BacktraceMap.h b/include/backtrace/BacktraceMap.h index 13083bd..c717f09 100644 --- a/include/backtrace/BacktraceMap.h +++ b/include/backtrace/BacktraceMap.h @@ -18,6 +18,7 @@ #define _BACKTRACE_BACKTRACE_MAP_H #include <stdint.h> +#include <sys/types.h> #ifdef USE_MINGW // MINGW does not define these constants. #define PROT_NONE 0 diff --git a/include/cutils/bitops.h b/include/cutils/bitops.h index c26dc54..045830d 100644 --- a/include/cutils/bitops.h +++ b/include/cutils/bitops.h @@ -59,7 +59,7 @@ static inline void bitmask_init(unsigned int *bitmask, int num_bits) static inline int bitmask_ffz(unsigned int *bitmask, int num_bits) { int bit, result; - unsigned int i; + size_t i; for (i = 0; i < BITS_TO_WORDS(num_bits); i++) { bit = ffs(~bitmask[i]); @@ -77,7 +77,7 @@ static inline int bitmask_ffz(unsigned int *bitmask, int num_bits) static inline int bitmask_weight(unsigned int *bitmask, int num_bits) { - int i; + size_t i; int weight = 0; for (i = 0; i < BITS_TO_WORDS(num_bits); i++) diff --git a/include/cutils/fs.h b/include/cutils/fs.h index d1d4cf2..70f0b92 100644 --- a/include/cutils/fs.h +++ b/include/cutils/fs.h @@ -18,6 +18,7 @@ #define __CUTILS_FS_H #include <sys/types.h> +#include <unistd.h> /* * TEMP_FAILURE_RETRY is defined by some, but not all, versions of diff --git a/include/cutils/list.h b/include/cutils/list.h index 945729a..4ba2cfd 100644 --- a/include/cutils/list.h +++ b/include/cutils/list.h @@ -44,10 +44,10 @@ struct listnode #define list_for_each_reverse(node, list) \ for (node = (list)->prev; node != (list); node = node->prev) -#define list_for_each_safe(node, next, list) \ - for (node = (list)->next, next = node->next; \ +#define list_for_each_safe(node, n, list) \ + for (node = (list)->next, n = node->next; \ node != (list); \ - node = next, next = node->next) + node = n, n = node->next) static inline void list_init(struct listnode *node) { @@ -63,6 +63,14 @@ static inline void list_add_tail(struct listnode *head, struct listnode *item) head->prev = item; } +static inline void list_add_head(struct listnode *head, struct listnode *item) +{ + item->next = head->next; + item->prev = head; + head->next->prev = item; + head->next = item; +} + static inline void list_remove(struct listnode *item) { item->next->prev = item->prev; diff --git a/include/cutils/trace.h b/include/cutils/trace.h index 62a4e9f..fd9bc6a 100644 --- a/include/cutils/trace.h +++ b/include/cutils/trace.h @@ -20,6 +20,7 @@ #include <inttypes.h> #include <stdbool.h> #include <stdint.h> +#include <stdio.h> #include <sys/cdefs.h> #include <sys/types.h> #include <unistd.h> diff --git a/include/log/log_read.h b/include/log/log_read.h index 54d71a4..946711a 100644 --- a/include/log/log_read.h +++ b/include/log/log_read.h @@ -67,7 +67,8 @@ public: // timespec bool operator== (const timespec &T) const { - return (tv_sec == T.tv_sec) && (tv_nsec == T.tv_nsec); + return (tv_sec == static_cast<uint32_t>(T.tv_sec)) + && (tv_nsec == static_cast<uint32_t>(T.tv_nsec)); } bool operator!= (const timespec &T) const { @@ -75,8 +76,9 @@ public: } bool operator< (const timespec &T) const { - return (tv_sec < T.tv_sec) - || ((tv_sec == T.tv_sec) && (tv_nsec < T.tv_nsec)); + return (tv_sec < static_cast<uint32_t>(T.tv_sec)) + || ((tv_sec == static_cast<uint32_t>(T.tv_sec)) + && (tv_nsec < static_cast<uint32_t>(T.tv_nsec))); } bool operator>= (const timespec &T) const { @@ -84,8 +86,9 @@ public: } bool operator> (const timespec &T) const { - return (tv_sec > T.tv_sec) - || ((tv_sec == T.tv_sec) && (tv_nsec > T.tv_nsec)); + return (tv_sec > static_cast<uint32_t>(T.tv_sec)) + || ((tv_sec == static_cast<uint32_t>(T.tv_sec)) + && (tv_nsec > static_cast<uint32_t>(T.tv_nsec))); } bool operator<= (const timespec &T) const { diff --git a/include/log/logger.h b/include/log/logger.h index ed39c4f..53be1d3 100644 --- a/include/log/logger.h +++ b/include/log/logger.h @@ -62,9 +62,8 @@ struct logger_entry_v3 { /* * The maximum size of the log entry payload that can be - * written to the kernel logger driver. An attempt to write - * more than this amount to /dev/log/* will result in a - * truncated log entry. + * written to the logger. An attempt to write more than + * this amount will result in a truncated log entry. */ #define LOGGER_ENTRY_MAX_PAYLOAD 4076 diff --git a/include/netd_client/FwmarkCommands.h b/include/netd_client/FwmarkCommands.h deleted file mode 100644 index 0d22f02..0000000 --- a/include/netd_client/FwmarkCommands.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef NETD_CLIENT_FWMARK_COMMANDS_H -#define NETD_CLIENT_FWMARK_COMMANDS_H - -#include <stdint.h> - -// Commands sent from clients to the fwmark server to mark sockets (i.e., set their SO_MARK). -const uint8_t FWMARK_COMMAND_ON_CREATE = 0; -const uint8_t FWMARK_COMMAND_ON_CONNECT = 1; -const uint8_t FWMARK_COMMAND_ON_ACCEPT = 2; -const uint8_t FWMARK_COMMAND_SELECT_NETWORK = 3; -const uint8_t FWMARK_COMMAND_PROTECT_FROM_VPN = 4; - -#endif // NETD_CLIENT_FWMARK_COMMANDS_H diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h index d662107..f5289c1 100644 --- a/include/private/android_filesystem_config.h +++ b/include/private/android_filesystem_config.h @@ -77,6 +77,7 @@ #define AID_SDCARD_AV 1034 /* external storage audio/video access */ #define AID_SDCARD_ALL 1035 /* access all users external storage */ #define AID_LOGD 1036 /* log daemon */ +#define AID_SHARED_RELRO 1037 /* creator of shared GNU RELRO files */ #define AID_SHELL 2000 /* adb and debug shell user */ #define AID_CACHE 2001 /* cache access */ @@ -153,6 +154,7 @@ static const struct android_id_info android_ids[] = { { "sdcard_av", AID_SDCARD_AV, }, { "sdcard_all", AID_SDCARD_ALL, }, { "logd", AID_LOGD, }, + { "shared_relro", AID_SHARED_RELRO, }, { "shell", AID_SHELL, }, { "cache", AID_CACHE, }, @@ -198,6 +200,7 @@ static const struct fs_path_config android_dirs[] = { { 00771, AID_SHELL, AID_SHELL, 0, "data/local" }, { 01771, AID_SYSTEM, AID_MISC, 0, "data/misc" }, { 00770, AID_DHCP, AID_DHCP, 0, "data/misc/dhcp" }, + { 00771, AID_SHARED_RELRO, AID_SHARED_RELRO, 0, "data/misc/shared_relro" }, { 00775, AID_MEDIA_RW, AID_MEDIA_RW, 0, "data/media" }, { 00775, AID_MEDIA_RW, AID_MEDIA_RW, 0, "data/media/Music" }, { 00771, AID_SYSTEM, AID_SYSTEM, 0, "data" }, diff --git a/include/system/audio.h b/include/system/audio.h index f36befb..8838e71 100644 --- a/include/system/audio.h +++ b/include/system/audio.h @@ -434,6 +434,14 @@ typedef struct { static const audio_offload_info_t AUDIO_INFO_INITIALIZER = { version: AUDIO_OFFLOAD_INFO_VERSION_CURRENT, size: sizeof(audio_offload_info_t), + sample_rate: 0, + channel_mask: 0, + format: AUDIO_FORMAT_DEFAULT, + stream_type: AUDIO_STREAM_VOICE_CALL, + bit_rate: 0, + duration_us: 0, + has_video: false, + is_streaming: false }; static inline bool audio_is_output_device(audio_devices_t device) diff --git a/include/system/window.h b/include/system/window.h index 588f9c6..16b7b67 100644 --- a/include/system/window.h +++ b/include/system/window.h @@ -26,6 +26,13 @@ #include <system/graphics.h> #include <unistd.h> +#ifndef __unused +#define __unused __attribute__((__unused__)) +#endif +#ifndef __deprecated +#define __deprecated __attribute__((__deprecated__)) +#endif + __BEGIN_DECLS /*****************************************************************************/ @@ -89,10 +96,10 @@ typedef struct ANativeWindowBuffer // Implement the methods that sp<ANativeWindowBuffer> expects so that it // can be used to automatically refcount ANativeWindowBuffer's. - void incStrong(const void* id) const { + void incStrong(const void* /*id*/) const { common.incRef(const_cast<android_native_base_t*>(&common)); } - void decStrong(const void* id) const { + void decStrong(const void* /*id*/) const { common.decRef(const_cast<android_native_base_t*>(&common)); } #endif @@ -352,10 +359,10 @@ struct ANativeWindow /* Implement the methods that sp<ANativeWindow> expects so that it can be used to automatically refcount ANativeWindow's. */ - void incStrong(const void* id) const { + void incStrong(const void* /*id*/) const { common.incRef(const_cast<android_native_base_t*>(&common)); } - void decStrong(const void* id) const { + void decStrong(const void* /*id*/) const { common.decRef(const_cast<android_native_base_t*>(&common)); } #endif @@ -582,7 +589,7 @@ struct ANativeWindow * android_native_window_t is deprecated. */ typedef struct ANativeWindow ANativeWindow; -typedef struct ANativeWindow android_native_window_t; +typedef struct ANativeWindow android_native_window_t __deprecated; /* * native_window_set_usage(..., usage) @@ -603,13 +610,19 @@ static inline int native_window_set_usage( /* deprecated. Always returns 0. Don't call. */ static inline int native_window_connect( - struct ANativeWindow* window, int api) { + struct ANativeWindow* window __unused, int api __unused) __deprecated; + +static inline int native_window_connect( + struct ANativeWindow* window __unused, int api __unused) { return 0; } /* deprecated. Always returns 0. Don't call. */ static inline int native_window_disconnect( - struct ANativeWindow* window, int api) { + struct ANativeWindow* window __unused, int api __unused) __deprecated; + +static inline int native_window_disconnect( + struct ANativeWindow* window __unused, int api __unused) { return 0; } @@ -664,6 +677,10 @@ static inline int native_window_set_post_transform_crop( */ static inline int native_window_set_active_rect( struct ANativeWindow* window, + android_native_rect_t const * active_rect) __deprecated; + +static inline int native_window_set_active_rect( + struct ANativeWindow* window, android_native_rect_t const * active_rect) { return native_window_set_post_transform_crop(window, active_rect); @@ -691,6 +708,10 @@ static inline int native_window_set_buffer_count( */ static inline int native_window_set_buffers_geometry( struct ANativeWindow* window, + int w, int h, int format) __deprecated; + +static inline int native_window_set_buffers_geometry( + struct ANativeWindow* window, int w, int h, int format) { return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, diff --git a/include/utils/Functor.h b/include/utils/Functor.h index e24ded4..09ea614 100644 --- a/include/utils/Functor.h +++ b/include/utils/Functor.h @@ -25,7 +25,7 @@ class Functor { public: Functor() {} virtual ~Functor() {} - virtual status_t operator ()(int what, void* data) { return NO_ERROR; } + virtual status_t operator ()(int /*what*/, void* /*data*/) { return NO_ERROR; } }; }; // namespace android diff --git a/include/utils/LruCache.h b/include/utils/LruCache.h index 053bfaf..9248ac9 100644 --- a/include/utils/LruCache.h +++ b/include/utils/LruCache.h @@ -56,7 +56,7 @@ public: bool next() { mIndex = mCache.mTable->next(mIndex); - return mIndex != -1; + return (ssize_t)mIndex != -1; } size_t index() const { @@ -103,9 +103,13 @@ private: // Implementation is here, because it's fully templated template <typename TKey, typename TValue> -LruCache<TKey, TValue>::LruCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity), - mNullValue(NULL), mTable(new BasicHashtable<TKey, Entry>), mYoungest(NULL), mOldest(NULL), - mListener(NULL) { +LruCache<TKey, TValue>::LruCache(uint32_t maxCapacity) + : mTable(new BasicHashtable<TKey, Entry>) + , mListener(NULL) + , mOldest(NULL) + , mYoungest(NULL) + , mMaxCapacity(maxCapacity) + , mNullValue(NULL) { }; template<typename K, typename V> |