am 8814bd1d: Merge "include: cleanup for -Wsystem-header"

* commit '8814bd1d24e3ce9476e64ba641d592521fcf80ed':
  include: cleanup for -Wsystem-header
This commit is contained in:
Mark Salyzyn 2014-05-23 22:23:57 +00:00 committed by Android Git Automerger
commit 21157abcd9
9 changed files with 41 additions and 21 deletions

View file

@ -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) static inline int bitmask_ffz(unsigned int *bitmask, int num_bits)
{ {
int bit, result; int bit, result;
unsigned int i; size_t i;
for (i = 0; i < BITS_TO_WORDS(num_bits); i++) { for (i = 0; i < BITS_TO_WORDS(num_bits); i++) {
bit = ffs(~bitmask[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) static inline int bitmask_weight(unsigned int *bitmask, int num_bits)
{ {
int i; size_t i;
int weight = 0; int weight = 0;
for (i = 0; i < BITS_TO_WORDS(num_bits); i++) for (i = 0; i < BITS_TO_WORDS(num_bits); i++)

View file

@ -18,6 +18,7 @@
#define __CUTILS_FS_H #define __CUTILS_FS_H
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h>
/* /*
* TEMP_FAILURE_RETRY is defined by some, but not all, versions of * TEMP_FAILURE_RETRY is defined by some, but not all, versions of

View file

@ -20,6 +20,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h>
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>

View file

@ -67,7 +67,8 @@ public:
// timespec // timespec
bool operator== (const timespec &T) const 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 bool operator!= (const timespec &T) const
{ {
@ -75,8 +76,9 @@ public:
} }
bool operator< (const timespec &T) const bool operator< (const timespec &T) const
{ {
return (tv_sec < T.tv_sec) return (tv_sec < static_cast<uint32_t>(T.tv_sec))
|| ((tv_sec == T.tv_sec) && (tv_nsec < T.tv_nsec)); || ((tv_sec == static_cast<uint32_t>(T.tv_sec))
&& (tv_nsec < static_cast<uint32_t>(T.tv_nsec)));
} }
bool operator>= (const timespec &T) const bool operator>= (const timespec &T) const
{ {
@ -84,8 +86,9 @@ public:
} }
bool operator> (const timespec &T) const bool operator> (const timespec &T) const
{ {
return (tv_sec > T.tv_sec) return (tv_sec > static_cast<uint32_t>(T.tv_sec))
|| ((tv_sec == T.tv_sec) && (tv_nsec > T.tv_nsec)); || ((tv_sec == static_cast<uint32_t>(T.tv_sec))
&& (tv_nsec > static_cast<uint32_t>(T.tv_nsec)));
} }
bool operator<= (const timespec &T) const bool operator<= (const timespec &T) const
{ {

View file

@ -62,9 +62,8 @@ struct logger_entry_v3 {
/* /*
* The maximum size of the log entry payload that can be * The maximum size of the log entry payload that can be
* written to the kernel logger driver. An attempt to write * written to the logger. An attempt to write more than
* more than this amount to /dev/log/* will result in a * this amount will result in a truncated log entry.
* truncated log entry.
*/ */
#define LOGGER_ENTRY_MAX_PAYLOAD 4076 #define LOGGER_ENTRY_MAX_PAYLOAD 4076

View file

@ -434,6 +434,14 @@ typedef struct {
static const audio_offload_info_t AUDIO_INFO_INITIALIZER = { static const audio_offload_info_t AUDIO_INFO_INITIALIZER = {
version: AUDIO_OFFLOAD_INFO_VERSION_CURRENT, version: AUDIO_OFFLOAD_INFO_VERSION_CURRENT,
size: sizeof(audio_offload_info_t), 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) static inline bool audio_is_output_device(audio_devices_t device)

View file

@ -26,6 +26,10 @@
#include <system/graphics.h> #include <system/graphics.h>
#include <unistd.h> #include <unistd.h>
#ifndef __unused
#define __unused __attribute__((__unused__))
#endif
__BEGIN_DECLS __BEGIN_DECLS
/*****************************************************************************/ /*****************************************************************************/
@ -89,10 +93,10 @@ typedef struct ANativeWindowBuffer
// Implement the methods that sp<ANativeWindowBuffer> expects so that it // Implement the methods that sp<ANativeWindowBuffer> expects so that it
// can be used to automatically refcount ANativeWindowBuffer's. // 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)); 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)); common.decRef(const_cast<android_native_base_t*>(&common));
} }
#endif #endif
@ -352,10 +356,10 @@ struct ANativeWindow
/* Implement the methods that sp<ANativeWindow> expects so that it /* Implement the methods that sp<ANativeWindow> expects so that it
can be used to automatically refcount ANativeWindow's. */ 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)); 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)); common.decRef(const_cast<android_native_base_t*>(&common));
} }
#endif #endif
@ -603,13 +607,13 @@ static inline int native_window_set_usage(
/* deprecated. Always returns 0. Don't call. */ /* deprecated. Always returns 0. Don't call. */
static inline int native_window_connect( static inline int native_window_connect(
struct ANativeWindow* window, int api) { struct ANativeWindow* window __unused, int api __unused) {
return 0; return 0;
} }
/* deprecated. Always returns 0. Don't call. */ /* deprecated. Always returns 0. Don't call. */
static inline int native_window_disconnect( static inline int native_window_disconnect(
struct ANativeWindow* window, int api) { struct ANativeWindow* window __unused, int api __unused) {
return 0; return 0;
} }

View file

@ -25,7 +25,7 @@ class Functor {
public: public:
Functor() {} Functor() {}
virtual ~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 }; // namespace android

View file

@ -56,7 +56,7 @@ public:
bool next() { bool next() {
mIndex = mCache.mTable->next(mIndex); mIndex = mCache.mTable->next(mIndex);
return mIndex != -1; return (ssize_t)mIndex != -1;
} }
size_t index() const { size_t index() const {
@ -103,9 +103,13 @@ private:
// Implementation is here, because it's fully templated // Implementation is here, because it's fully templated
template <typename TKey, typename TValue> template <typename TKey, typename TValue>
LruCache<TKey, TValue>::LruCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity), LruCache<TKey, TValue>::LruCache(uint32_t maxCapacity)
mNullValue(NULL), mTable(new BasicHashtable<TKey, Entry>), mYoungest(NULL), mOldest(NULL), : mTable(new BasicHashtable<TKey, Entry>)
mListener(NULL) { , mListener(NULL)
, mOldest(NULL)
, mYoungest(NULL)
, mMaxCapacity(maxCapacity)
, mNullValue(NULL) {
}; };
template<typename K, typename V> template<typename K, typename V>