Merge "Frameworks/base: Fix more warnings"

This commit is contained in:
Andreas Gampe
2014-11-09 00:37:42 +00:00
committed by Gerrit Code Review
3 changed files with 5 additions and 11 deletions

View File

@@ -44,12 +44,6 @@ static const bool kIsDebug = false;
const static int ROUND_UP[4] = { 0, 3, 2, 1 };
static inline size_t
round_up(size_t n)
{
return n + ROUND_UP[n % 4];
}
static inline size_t
padding_extra(size_t n)
{
@@ -343,7 +337,7 @@ BackupDataReader::ReadEntityData(void* data, size_t size)
}
int remaining = m_dataEndPos - m_pos;
if (kIsDebug) {
ALOGD("ReadEntityData size=%d m_pos=0x%x m_dataEndPos=0x%x remaining=%d\n",
ALOGD("ReadEntityData size=%zu m_pos=0x%zx m_dataEndPos=0x%zx remaining=%d\n",
size, m_pos, m_dataEndPos, remaining);
}
if (remaining <= 0) {
@@ -353,7 +347,7 @@ BackupDataReader::ReadEntityData(void* data, size_t size)
size = remaining;
}
if (kIsDebug) {
ALOGD(" reading %d bytes", size);
ALOGD(" reading %zu bytes", size);
}
int amt = read(m_fd, data, size);
if (amt < 0) {

View File

@@ -555,7 +555,7 @@ int write_tarfile(const String8& packageName, const String8& domain,
snprintf(buf + 124, 12, "%011llo", (isdir) ? 0LL : s.st_size);
// [ 136 : 12 ] last mod time as a UTC time_t
snprintf(buf + 136, 12, "%0lo", s.st_mtime);
snprintf(buf + 136, 12, "%0lo", (unsigned long)s.st_mtime);
// [ 156 : 1 ] link/file type
uint8_t type;

View File

@@ -733,8 +733,8 @@ const char16_t* ResStringPool::stringAt(size_t idx, size_t* u16len) const
}
#else
// We do not want to be in this case when actually running Android.
ALOGW("CREATING STRING CACHE OF %d bytes",
mHeader->stringCount*sizeof(char16_t**));
ALOGW("CREATING STRING CACHE OF %zu bytes",
static_cast<size_t>(mHeader->stringCount*sizeof(char16_t**)));
#endif
mCache = (char16_t**)calloc(mHeader->stringCount, sizeof(char16_t**));
if (mCache == NULL) {