update engine: clang formatting
Fix clang formatting issues for all .cc, .h, and .proto files
in update engine.
~/trunk/src/chromium/src/buildtools/linux64/clang-format -i \
-style=file $(find update_engine -name '*.h' -o -name '*.cc' \
-o -name '*.cpp' -o -name '*.c')
BUG=b:169679497
TEST=CQ pass
Change-Id: I4fde01d3e734dbffaa2c7e7b667503d310abccae
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2462840
Reviewed-by: Amin Hassani <[email protected]>
Reviewed-by: Jae Hoon Kim <[email protected]>
Tested-by: Vyshu Khota <[email protected]>
Commit-Queue: Vyshu Khota <[email protected]>
diff --git a/boot_control_chromeos.cc b/boot_control_chromeos.cc
index 95456f0..da2c891 100644
--- a/boot_control_chromeos.cc
+++ b/boot_control_chromeos.cc
@@ -128,8 +128,9 @@
}
if (current_slot_ >= num_slots_) {
LOG(ERROR) << "Couldn't find the slot number corresponding to the "
- << "partition " << boot_device << ", number of slots: "
- << num_slots_ << ". This device is not updateable.";
+ << "partition " << boot_device
+ << ", number of slots: " << num_slots_
+ << ". This device is not updateable.";
num_slots_ = 1;
current_slot_ = BootControlInterface::kInvalidSlot;
return false;
diff --git a/common/subprocess.h b/common/subprocess.h
index 179a5c5..2ed8b81 100644
--- a/common/subprocess.h
+++ b/common/subprocess.h
@@ -37,7 +37,7 @@
#include <brillo/process.h>
#include <brillo/process_reaper.h>
#endif // __CHROMEOS__
-#include <gtest/gtest_prod.h> // for FRIEND_TEST
+#include <gtest/gtest_prod.h>
// The Subprocess class is a singleton. It's used to spawn off a subprocess
// and get notified when the subprocess exits. The result of Exec() can
diff --git a/omaha_request_params.h b/omaha_request_params.h
index 5d30d58..1e9ab7d 100644
--- a/omaha_request_params.h
+++ b/omaha_request_params.h
@@ -384,8 +384,8 @@
// TODO(b:133324571) tracks removal of this field once it is no longer
// needed in AU requests. Remove by October 1st 2019.
std::string device_requisition_; // Chrome OS Requisition type.
- bool delta_okay_; // If this client can accept a delta
- bool interactive_; // Whether this is a user-initiated update check
+ bool delta_okay_; // If this client can accept a delta
+ bool interactive_; // Whether this is a user-initiated update check
// The URL to send the Omaha request to.
std::string update_url_;
diff --git a/payload_consumer/install_plan.h b/payload_consumer/install_plan.h
index f04c650..5534fb3 100644
--- a/payload_consumer/install_plan.h
+++ b/payload_consumer/install_plan.h
@@ -59,8 +59,8 @@
struct Payload {
std::vector<std::string> payload_urls; // URLs to download the payload
- uint64_t size = 0; // size of the payload
- uint64_t metadata_size = 0; // size of the metadata
+ uint64_t size = 0; // size of the payload
+ uint64_t metadata_size = 0; // size of the metadata
std::string metadata_signature; // signature of the metadata in base64
brillo::Blob hash; // SHA256 hash of the payload
InstallPayloadType type{InstallPayloadType::kUnknown};
diff --git a/payload_generator/extent_ranges_unittest.cc b/payload_generator/extent_ranges_unittest.cc
index 326e936..f55bb73 100644
--- a/payload_generator/extent_ranges_unittest.cc
+++ b/payload_generator/extent_ranges_unittest.cc
@@ -52,8 +52,8 @@
}
}
-#define EXPECT_RANGE_EQ(ranges, var) \
- do { \
+#define EXPECT_RANGE_EQ(ranges, var) \
+ do { \
ExpectRangeEq(ranges, var, base::size(var), __LINE__); \
} while (0)
diff --git a/payload_generator/generate_delta_main.cc b/payload_generator/generate_delta_main.cc
index 7d62e77..1944847 100644
--- a/payload_generator/generate_delta_main.cc
+++ b/payload_generator/generate_delta_main.cc
@@ -74,7 +74,6 @@
}
}
-
void CalculateHashForSigning(const vector<size_t>& sizes,
const string& out_hash_file,
const string& out_metadata_hash_file,
diff --git a/test_http_server.cc b/test_http_server.cc
index cf6f10d..a2f1e05 100644
--- a/test_http_server.cc
+++ b/test_http_server.cc
@@ -190,7 +190,7 @@
string("HTTP/1.1 ") + Itoa(return_code) + " " +
GetHttpResponseDescription(return_code) +
EOL "Content-Type: application/octet-stream" EOL
- "Connection: close" EOL);
+ "Connection: close" EOL);
if (ret < 0)
return -1;
written += ret;
diff --git a/update_metadata.proto b/update_metadata.proto
index 8c63ee7..99bfa84 100644
--- a/update_metadata.proto
+++ b/update_metadata.proto
@@ -173,15 +173,15 @@
BSDIFF = 3 [deprecated = true]; // The data is a bsdiff binary diff.
// On minor version 2 or newer, these operations are supported:
- SOURCE_COPY = 4; // Copy from source to target partition
- SOURCE_BSDIFF = 5; // Like BSDIFF, but read from source partition
+ SOURCE_COPY = 4; // Copy from source to target partition
+ SOURCE_BSDIFF = 5; // Like BSDIFF, but read from source partition
// On minor version 3 or newer and on major version 2 or newer, these
// operations are supported:
- REPLACE_XZ = 8; // Replace destination extents w/ attached xz data.
+ REPLACE_XZ = 8; // Replace destination extents w/ attached xz data.
// On minor version 4 or newer, these operations are supported:
- ZERO = 6; // Write zeros in the destination.
+ ZERO = 6; // Write zeros in the destination.
DISCARD = 7; // Discard the destination blocks, reading as undefined.
BROTLI_BSDIFF = 10; // Like SOURCE_BSDIFF, but compressed with brotli.