update_engine: fixed warnings from cpplint
Fixed all the cpplint warnings in update engine.
BUG=None
TEST=Unit tests still pass.
Change-Id: I285ae858eec8abe0b26ff203b99a42a200ceb71c
Reviewed-on: https://chromium-review.googlesource.com/204027
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/omaha_request_action.cc b/omaha_request_action.cc
index 5955157..1a07566 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -58,7 +58,7 @@
namespace {
-const string kGupdateVersion("ChromeOSUpdateEngine-0.1.0.0");
+static const char* const kGupdateVersion = "ChromeOSUpdateEngine-0.1.0.0";
// This is handy for passing strings into libxml2
#define ConstXMLStr(x) (reinterpret_cast<const xmlChar*>(x))
@@ -278,7 +278,7 @@
return request_xml;
}
-} // namespace {}
+} // namespace
// Encodes XML entities in a given string with libxml2. input must be
// UTF-8 formatted. Output will be UTF-8 formatted.
@@ -465,7 +465,7 @@
LOG(ERROR) << "Unable to find " << xpath << " in XML document";
return NULL;
}
- if(xmlXPathNodeSetIsEmpty(result->nodesetval)){
+ if (xmlXPathNodeSetIsEmpty(result->nodesetval)) {
LOG(INFO) << "Nodeset is empty for " << xpath;
xmlXPathFreeObject(result);
return NULL;
@@ -526,7 +526,7 @@
prefs->SetInt64(kPrefsLastRollCallPingDay, daystart.ToInternalValue());
return true;
}
-} // namespace {}
+} // namespace
bool OmahaRequestAction::ParseResponse(xmlDoc* doc,
OmahaResponse* output_object,
@@ -1101,8 +1101,7 @@
update_first_seen_at_int)) {
LOG(INFO) << "Persisted the new value for UpdateFirstSeenAt: "
<< utils::ToString(update_first_seen_at);
- }
- else {
+ } else {
// This seems like an unexpected error where the value cannot be
// persisted for some reason. Just skip scattering in this
// case to be safe.
@@ -1363,15 +1362,15 @@
// Note: policy decision to not update to a version we rolled back from.
string rollback_version =
system_state_->payload_state()->GetRollbackVersion();
- if(!rollback_version.empty()) {
+ if (!rollback_version.empty()) {
LOG(INFO) << "Detected previous rollback from version " << rollback_version;
- if(rollback_version == response.version) {
+ if (rollback_version == response.version) {
LOG(INFO) << "Received version that we rolled back from. Ignoring.";
return true;
}
}
- if(!IsUpdateAllowedOverCurrentConnection()) {
+ if (!IsUpdateAllowedOverCurrentConnection()) {
LOG(INFO) << "Update is not allowed over current connection.";
return true;
}