ART: More warnings
Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general,
and -Wunused-but-set-parameter for GCC builds.
Change-Id: I81bbdd762213444673c65d85edae594a523836e5
diff --git a/runtime/jdwp/jdwp_adb.cc b/runtime/jdwp/jdwp_adb.cc
index fe91bb6..df7d068 100644
--- a/runtime/jdwp/jdwp_adb.cc
+++ b/runtime/jdwp/jdwp_adb.cc
@@ -84,13 +84,13 @@
shutting_down_ = true;
int control_sock = this->control_sock_;
- int clientSock = this->clientSock;
+ int local_clientSock = this->clientSock;
/* clear these out so it doesn't wake up and try to reuse them */
this->control_sock_ = this->clientSock = -1;
- if (clientSock != -1) {
- shutdown(clientSock, SHUT_RDWR);
+ if (local_clientSock != -1) {
+ shutdown(local_clientSock, SHUT_RDWR);
}
if (control_sock != -1) {
diff --git a/runtime/jdwp/jdwp_bits.h b/runtime/jdwp/jdwp_bits.h
index 9f80cbe..f9cf9ca 100644
--- a/runtime/jdwp/jdwp_bits.h
+++ b/runtime/jdwp/jdwp_bits.h
@@ -68,7 +68,7 @@
// @deprecated
static inline void Set1(uint8_t* buf, uint8_t val) {
- *buf = (uint8_t)(val);
+ *buf = val;
}
// @deprecated
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index d1229b2..44f713c 100644
--- a/runtime/jdwp/jdwp_event.cc
+++ b/runtime/jdwp/jdwp_event.cc
@@ -138,7 +138,7 @@
}
}
-uint32_t GetInstrumentationEventFor(JdwpEventKind eventKind) {
+static uint32_t GetInstrumentationEventFor(JdwpEventKind eventKind) {
switch (eventKind) {
case EK_BREAKPOINT:
case EK_SINGLE_STEP:
diff --git a/runtime/jdwp/jdwp_socket.cc b/runtime/jdwp/jdwp_socket.cc
index 4a80957..e8c0856 100644
--- a/runtime/jdwp/jdwp_socket.cc
+++ b/runtime/jdwp/jdwp_socket.cc
@@ -170,20 +170,20 @@
* for an open port.)
*/
void JdwpSocketState::Shutdown() {
- int listenSock = this->listenSock;
- int clientSock = this->clientSock;
+ int local_listenSock = this->listenSock;
+ int local_clientSock = this->clientSock;
/* clear these out so it doesn't wake up and try to reuse them */
this->listenSock = this->clientSock = -1;
/* "shutdown" dislodges blocking read() and accept() calls */
- if (listenSock != -1) {
- shutdown(listenSock, SHUT_RDWR);
- close(listenSock);
+ if (local_listenSock != -1) {
+ shutdown(local_listenSock, SHUT_RDWR);
+ close(local_listenSock);
}
- if (clientSock != -1) {
- shutdown(clientSock, SHUT_RDWR);
- close(clientSock);
+ if (local_clientSock != -1) {
+ shutdown(local_clientSock, SHUT_RDWR);
+ close(local_clientSock);
}
WakePipe();
diff --git a/runtime/jdwp/object_registry.cc b/runtime/jdwp/object_registry.cc
index bf72c7b..9123994 100644
--- a/runtime/jdwp/object_registry.cc
+++ b/runtime/jdwp/object_registry.cc
@@ -214,10 +214,10 @@
// Erase the object from the maps. Note object may be null if it's
// a weak ref and the GC has cleared it.
int32_t hash_code = entry->identity_hash_code;
- for (auto it = object_to_entry_.lower_bound(hash_code), end = object_to_entry_.end();
- it != end && it->first == hash_code; ++it) {
- if (entry == it->second) {
- object_to_entry_.erase(it);
+ for (auto inner_it = object_to_entry_.lower_bound(hash_code), end = object_to_entry_.end();
+ inner_it != end && inner_it->first == hash_code; ++inner_it) {
+ if (entry == inner_it->second) {
+ object_to_entry_.erase(inner_it);
break;
}
}