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
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 @@
     {
     }
 
+    virtual ~BpSensorServer();
+
     virtual Vector<Sensor> getSensorList()
     {
         Parcel data, reply;
@@ -52,7 +54,7 @@
         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 @@
     }
 };
 
+// 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 @@
             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);
 }