summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2016-08-27 01:42:05 +0200
committerandroid-build-merger <android-build-merger@google.com>2016-08-27 01:42:05 +0200
commit9968866e861a9d4f78dc264bc8adfdf2c5280f39 (patch)
treeb2d9b2cab10667fdd08f2de84db84dc86845477a
parentMerge "Free mmaped area if keys fail to load" (diff)
parentMerge "Fix clang-tidy warnings in bootable/recovery." (diff)
downloadandroid_bootable_recovery-9968866e861a9d4f78dc264bc8adfdf2c5280f39.tar
android_bootable_recovery-9968866e861a9d4f78dc264bc8adfdf2c5280f39.tar.gz
android_bootable_recovery-9968866e861a9d4f78dc264bc8adfdf2c5280f39.tar.bz2
android_bootable_recovery-9968866e861a9d4f78dc264bc8adfdf2c5280f39.tar.lz
android_bootable_recovery-9968866e861a9d4f78dc264bc8adfdf2c5280f39.tar.xz
android_bootable_recovery-9968866e861a9d4f78dc264bc8adfdf2c5280f39.tar.zst
android_bootable_recovery-9968866e861a9d4f78dc264bc8adfdf2c5280f39.zip
Diffstat (limited to '')
-rw-r--r--install.cpp4
-rw-r--r--tests/component/applypatch_test.cpp2
-rw-r--r--wear_touch.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/install.cpp b/install.cpp
index 6c8d827c2..10a90a0ce 100644
--- a/install.cpp
+++ b/install.cpp
@@ -54,8 +54,8 @@ static const float DEFAULT_FILES_PROGRESS_FRACTION = 0.4;
static const float DEFAULT_IMAGE_PROGRESS_FRACTION = 0.1;
// This function parses and returns the build.version.incremental
-static int parse_build_number(std::string str) {
- size_t pos = str.find("=");
+static int parse_build_number(const std::string& str) {
+ size_t pos = str.find('=');
if (pos != std::string::npos) {
std::string num_string = android::base::Trim(str.substr(pos+1));
int build_number;
diff --git a/tests/component/applypatch_test.cpp b/tests/component/applypatch_test.cpp
index b44ddd17c..2f7cb02f4 100644
--- a/tests/component/applypatch_test.cpp
+++ b/tests/component/applypatch_test.cpp
@@ -65,7 +65,7 @@ static bool file_cmp(std::string& f1, std::string& f2) {
return c1 == c2;
}
-static std::string from_testdata_base(const std::string fname) {
+static std::string from_testdata_base(const std::string& fname) {
return android::base::StringPrintf("%s%s%s/%s",
&DATA_PATH[0],
&NATIVE_TEST_PATH[0],
diff --git a/wear_touch.cpp b/wear_touch.cpp
index f22d40b88..51a1d31b2 100644
--- a/wear_touch.cpp
+++ b/wear_touch.cpp
@@ -122,7 +122,7 @@ void* WearSwipeDetector::touch_thread(void* cookie) {
return NULL;
}
-#define test_bit(bit, array) (array[bit/8] & (1<<(bit%8)))
+#define test_bit(bit, array) ((array)[(bit)/8] & (1<<((bit)%8)))
int WearSwipeDetector::openDevice(const char *device) {
int fd = open(device, O_RDONLY);