Turn on C++11 and make all warnings into errors.
As a consequence:
+ Comment out the names of all unused parameters.
+ Remove all unused variables and functions.
In server/Android.mk, there are a couple of non-trivial changes:
+ Use libcxx instead of stlport. This is needed to fix a bunch of errors due to
specifying -std=c++11.
+ LOCAL_SHARED_LIBRARIES is sorted. Technically, the order in which libraries
are listed has an effect on linking, but nobody should be doing such brittle
things anyway.
Change-Id: I0aff5b745e04609da23144d0e8be4c5694321b8b
diff --git a/server/NatController.cpp b/server/NatController.cpp
index fbf5f8a..8391ad7 100644
--- a/server/NatController.cpp
+++ b/server/NatController.cpp
@@ -165,11 +165,9 @@
// 0 1 2 3 4 5
// nat enable intface extface addrcnt nated-ipaddr/prelength
int NatController::enableNat(const int argc, char **argv) {
- int i;
int addrCount = atoi(argv[4]);
const char *intIface = argv[2];
const char *extIface = argv[3];
- int tableNumber;
ALOGV("enableNat(intIface=<%s>, extIface=<%s>)",intIface, extIface);
@@ -271,8 +269,7 @@
if (!add) {
return 0;
}
- char *pair_name, *proc_path;
- int quota_fd;
+ char *pair_name;
asprintf(&pair_name, "%s_%s", intIface, extIface);
if (checkTetherCountingRuleExist(pair_name)) {
@@ -408,11 +405,9 @@
// 0 1 2 3 4 5
// nat enable intface extface addrcnt nated-ipaddr/prelength
int NatController::disableNat(const int argc, char **argv) {
- int i;
int addrCount = atoi(argv[4]);
const char *intIface = argv[2];
const char *extIface = argv[3];
- int tableNumber;
if (!checkInterface(intIface) || !checkInterface(extIface)) {
ALOGE("Invalid interface specified");