diff options
author | Andreas Gampe <agampe@google.com> | 2014-10-21 23:38:52 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-10-22 08:15:54 -0700 |
commit | 2b3a8cd808a4013f43c881eca64a870ff0ea735b (patch) | |
tree | f58f9532a61bcb7db87401d2a4eb65f2342e7b84 /libs/storage/IMountService.cpp | |
parent | 4cd671e4d27befdd576fa86051956c3cafad6808 (diff) | |
download | frameworks_base-2b3a8cd808a4013f43c881eca64a870ff0ea735b.zip frameworks_base-2b3a8cd808a4013f43c881eca64a870ff0ea735b.tar.gz frameworks_base-2b3a8cd808a4013f43c881eca64a870ff0ea735b.tar.bz2 |
Frameworks/base: Wall Werror in libs/storage
Turn on -Wall -Werror in libs/storage.
Change-Id: I314cb32d0a917f9261488f7709d9a78a07b10fea
Diffstat (limited to 'libs/storage/IMountService.cpp')
-rw-r--r-- | libs/storage/IMountService.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp index 5701678..9db15b9 100644 --- a/libs/storage/IMountService.cpp +++ b/libs/storage/IMountService.cpp @@ -207,12 +207,19 @@ public: ALOGD("getStorageUsers caught exception %d\n", err); return err; } - const int32_t numUsers = reply.readInt32(); + int32_t numUsersI = reply.readInt32(); + uint32_t numUsers; + if (numUsersI < 0) { + ALOGW("Number of users is negative: %d\n", numUsersI); + numUsers = 0; + } else { + numUsers = static_cast<uint32_t>(numUsersI); + } *users = (int32_t*)malloc(sizeof(int32_t)*numUsers); - for (int i = 0; i < numUsers; i++) { + for (size_t i = 0; i < numUsers; i++) { **users++ = reply.readInt32(); } - return numUsers; + return static_cast<int32_t>(numUsers); } int32_t getVolumeState(const String16& mountPoint) @@ -544,8 +551,8 @@ public: } }; -IMPLEMENT_META_INTERFACE(MountService, "IMountService"); +IMPLEMENT_META_INTERFACE(MountService, "IMountService") // ---------------------------------------------------------------------- -}; +} |