shill: Fix most of warnings from cpplint
Fix most cpplinter's warnings. On a few occasisions, the warnings
produced were false-positives, so added explicit // NOLINT comment
overrides.
There were a few instances of disallowed non-const reference usage
(reported as runtime/reference error by cpplint) for
"DBus::Error &error" which should potentially be changed
to pointers to comply with C++ coding style but I will let Shill
owners do that since there is quite a few of those and the
change isn't brain-dead simple...
BUG=None
TEST=platform2 still compiles and all unit tests pass.
Change-Id: Ic2e31896aa13d20eeb1a85dee74f3db8cccfde2e
Reviewed-on: https://chromium-review.googlesource.com/204164
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/connection_health_checker.h b/connection_health_checker.h
index 936cc2c..7e2e9a8 100644
--- a/connection_health_checker.h
+++ b/connection_health_checker.h
@@ -5,6 +5,7 @@
#ifndef SHILL_CONNECTION_HEALTH_CHECKER_H_
#define SHILL_CONNECTION_HEALTH_CHECKER_H_
+#include <string>
#include <vector>
#include <base/basictypes.h>
@@ -40,7 +41,6 @@
// -(3)- Connectivity OK (TCP connection established, is healthy)
class ConnectionHealthChecker {
public:
-
enum Result {
// There was some problem in the setup of ConnctionHealthChecker.
// Could not attempt a tcp connection.
@@ -99,24 +99,24 @@
dispatcher_ = dispatcher;
}
void set_sock_fd(int sock_fd) { sock_fd_ = sock_fd; }
- short num_connection_failures() const { return num_connection_failures_; }
- void set_num_connection_failures(short val) {
+ int16_t num_connection_failures() const { return num_connection_failures_; }
+ void set_num_connection_failures(int16_t val) {
num_connection_failures_ = val;
}
- short num_tx_queue_polling_attempts() const {
+ int16_t num_tx_queue_polling_attempts() const {
return num_tx_queue_polling_attempts_;
}
- void set_num_tx_queue_polling_attempts(short val) {
+ void set_num_tx_queue_polling_attempts(int16_t val) {
num_tx_queue_polling_attempts_ = val;
}
- short num_congested_queue_detected() const {
+ int16_t num_congested_queue_detected() const {
return num_congested_queue_detected_;
}
- void set_num_congested_queue_detected(short val) {
+ void set_num_congested_queue_detected(int16_t val) {
num_congested_queue_detected_ = val;
}
- short num_successful_sends() const { return num_successful_sends_; }
- void set_num_successful_sends(short val) {
+ int16_t num_successful_sends() const { return num_successful_sends_; }
+ void set_num_successful_sends(int16_t val) {
num_successful_sends_ = val;
}
void set_old_transmit_queue_value(uint64 val) {
@@ -212,13 +212,13 @@
bool health_check_in_progress_;
// Number of connection failures in currently active health check.
- short num_connection_failures_;
+ int16_t num_connection_failures_;
// Number of times we have checked the tx-queue for the current send attempt.
- short num_tx_queue_polling_attempts_;
- // Number of out of credit scenarios detected in currentl health check.
- short num_congested_queue_detected_;
+ int16_t num_tx_queue_polling_attempts_;
+ // Number of out of credit scenarios detected in current health check.
+ int16_t num_congested_queue_detected_;
// Number of successful send attempts currently active health check.
- short num_successful_sends_;
+ int16_t num_successful_sends_;
// Snooze time while polling for updated /proc/tcpinfo
int tcp_state_update_wait_milliseconds_;