summaryrefslogtreecommitdiffstats
path: root/libs/storage
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-11-08 01:14:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-11-08 01:14:59 +0000
commit9ade8c1ad59a40f1a2fdbe88074d05aa97a95aff (patch)
tree623e47dbf6834ebe1f4c494c4d2a455cfb414ede /libs/storage
parentf89a2fdacb2ba907f180188dc79f9de81e3eb254 (diff)
parent2b3a8cd808a4013f43c881eca64a870ff0ea735b (diff)
downloadframeworks_base-9ade8c1ad59a40f1a2fdbe88074d05aa97a95aff.zip
frameworks_base-9ade8c1ad59a40f1a2fdbe88074d05aa97a95aff.tar.gz
frameworks_base-9ade8c1ad59a40f1a2fdbe88074d05aa97a95aff.tar.bz2
Merge "Frameworks/base: Wall Werror in libs/storage"
Diffstat (limited to 'libs/storage')
-rw-r--r--libs/storage/Android.mk2
-rw-r--r--libs/storage/IMountService.cpp17
-rw-r--r--libs/storage/IMountServiceListener.cpp4
-rw-r--r--libs/storage/IMountShutdownObserver.cpp4
-rw-r--r--libs/storage/IObbActionListener.cpp9
5 files changed, 23 insertions, 13 deletions
diff --git a/libs/storage/Android.mk b/libs/storage/Android.mk
index 7a9dd6c..fae2bf7 100644
--- a/libs/storage/Android.mk
+++ b/libs/storage/Android.mk
@@ -9,4 +9,6 @@ LOCAL_SRC_FILES:= \
LOCAL_MODULE:= libstorage
+LOCAL_CFLAGS += -Wall -Werror
+
include $(BUILD_STATIC_LIBRARY)
diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp
index 621de18..7ac7737 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)
@@ -546,8 +553,8 @@ public:
}
};
-IMPLEMENT_META_INTERFACE(MountService, "IMountService");
+IMPLEMENT_META_INTERFACE(MountService, "IMountService")
// ----------------------------------------------------------------------
-};
+}
diff --git a/libs/storage/IMountServiceListener.cpp b/libs/storage/IMountServiceListener.cpp
index c98a424..11b53fd 100644
--- a/libs/storage/IMountServiceListener.cpp
+++ b/libs/storage/IMountServiceListener.cpp
@@ -34,7 +34,7 @@ status_t BnMountServiceListener::onTransact(
onUsbMassStorageConnectionChanged(connected);
reply->writeNoException();
return NO_ERROR;
- } break;
+ }
case TRANSACTION_onStorageStateChanged: {
CHECK_INTERFACE(IMountServiceListener, data, reply);
String16 path = data.readString16();
@@ -50,4 +50,4 @@ status_t BnMountServiceListener::onTransact(
}
// ----------------------------------------------------------------------
-};
+}
diff --git a/libs/storage/IMountShutdownObserver.cpp b/libs/storage/IMountShutdownObserver.cpp
index 1a6fdee..a74a768 100644
--- a/libs/storage/IMountShutdownObserver.cpp
+++ b/libs/storage/IMountShutdownObserver.cpp
@@ -33,11 +33,11 @@ status_t BnMountShutdownObserver::onTransact(
onShutDownComplete(statusCode);
reply->writeNoException();
return NO_ERROR;
- } break;
+ }
default:
return BBinder::onTransact(code, data, reply, flags);
}
}
// ----------------------------------------------------------------------
-};
+}
diff --git a/libs/storage/IObbActionListener.cpp b/libs/storage/IObbActionListener.cpp
index eaa211e..9656e65 100644
--- a/libs/storage/IObbActionListener.cpp
+++ b/libs/storage/IObbActionListener.cpp
@@ -30,10 +30,11 @@ public:
: BpInterface<IObbActionListener>(impl)
{ }
- virtual void onObbResult(const String16& filename, const int32_t nonce, const int32_t state) { }
+ virtual void onObbResult(const String16& /* filename */, const int32_t /* nonce */,
+ const int32_t /* state */) { }
};
-IMPLEMENT_META_INTERFACE(ObbActionListener, "IObbActionListener");
+IMPLEMENT_META_INTERFACE(ObbActionListener, "IObbActionListener")
// ----------------------------------------------------------------------
@@ -49,7 +50,7 @@ status_t BnObbActionListener::onTransact(
onObbResult(filename, nonce, state);
reply->writeNoException();
return NO_ERROR;
- } break;
+ }
default:
return BBinder::onTransact(code, data, reply, flags);
}
@@ -57,4 +58,4 @@ status_t BnObbActionListener::onTransact(
// ----------------------------------------------------------------------
-};
+}