diff options
author | Dan Stoza <stoza@google.com> | 2014-11-18 10:24:03 -0800 |
---|---|---|
committer | Dan Stoza <stoza@google.com> | 2014-12-05 11:06:44 -0800 |
commit | d723bd7669b4fc88dc282d8bf8ba5ecb2849d22f (patch) | |
tree | efc2d81e4ebf1f2499c5c5ec10323c6b3013a5ba /libs/gui/ISensorServer.cpp | |
parent | a950eb18792da6962fcefa69b12ffc3f9d8cdca8 (diff) | |
download | frameworks_native-d723bd7669b4fc88dc282d8bf8ba5ecb2849d22f.zip frameworks_native-d723bd7669b4fc88dc282d8bf8ba5ecb2849d22f.tar.gz frameworks_native-d723bd7669b4fc88dc282d8bf8ba5ecb2849d22f.tar.bz2 |
libgui: Enable -Weverything and -Werror
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.
Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
Diffstat (limited to 'libs/gui/ISensorServer.cpp')
-rw-r--r-- | libs/gui/ISensorServer.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libs/gui/ISensorServer.cpp b/libs/gui/ISensorServer.cpp index a8464a2..8e09e7c 100644 --- a/libs/gui/ISensorServer.cpp +++ b/libs/gui/ISensorServer.cpp @@ -45,6 +45,8 @@ public: { } + virtual ~BpSensorServer(); + virtual Vector<Sensor> getSensorList() { Parcel data, reply; @@ -52,7 +54,7 @@ public: remote()->transact(GET_SENSOR_LIST, data, &reply); Sensor s; Vector<Sensor> v; - int32_t n = reply.readInt32(); + uint32_t n = reply.readUint32(); v.setCapacity(n); while (n--) { reply.read(s); @@ -70,6 +72,10 @@ public: } }; +// Out-of-line virtual method definition to trigger vtable emission in this +// translation unit (see clang warning -Wweak-vtables) +BpSensorServer::~BpSensorServer() {} + IMPLEMENT_META_INTERFACE(SensorServer, "android.gui.SensorServer"); // ---------------------------------------------------------------------- @@ -82,18 +88,18 @@ status_t BnSensorServer::onTransact( CHECK_INTERFACE(ISensorServer, data, reply); Vector<Sensor> v(getSensorList()); size_t n = v.size(); - reply->writeInt32(n); - for (size_t i=0 ; i<n ; i++) { + reply->writeUint32(static_cast<uint32_t>(n)); + for (size_t i = 0; i < n; i++) { reply->write(v[i]); } return NO_ERROR; - } break; + } case CREATE_SENSOR_EVENT_CONNECTION: { CHECK_INTERFACE(ISensorServer, data, reply); sp<ISensorEventConnection> connection(createSensorEventConnection()); reply->writeStrongBinder(IInterface::asBinder(connection)); return NO_ERROR; - } break; + } } return BBinder::onTransact(code, data, reply, flags); } |