Merge "Fix clang-tidy warnings in bootable/recovery." am: 89bf2bdc85

am: 9968866e86

Change-Id: Id888e91546d18d5ed0054e1fbac2823a6e31c6a1
This commit is contained in:
Chih-Hung Hsieh
2016-08-26 23:44:33 +00:00
committed by android-build-merger
3 changed files with 4 additions and 4 deletions

View File

@@ -54,8 +54,8 @@ static const float DEFAULT_FILES_PROGRESS_FRACTION = 0.4;
static const float DEFAULT_IMAGE_PROGRESS_FRACTION = 0.1; static const float DEFAULT_IMAGE_PROGRESS_FRACTION = 0.1;
// This function parses and returns the build.version.incremental // This function parses and returns the build.version.incremental
static int parse_build_number(std::string str) { static int parse_build_number(const std::string& str) {
size_t pos = str.find("="); size_t pos = str.find('=');
if (pos != std::string::npos) { if (pos != std::string::npos) {
std::string num_string = android::base::Trim(str.substr(pos+1)); std::string num_string = android::base::Trim(str.substr(pos+1));
int build_number; int build_number;

View File

@@ -65,7 +65,7 @@ static bool file_cmp(std::string& f1, std::string& f2) {
return c1 == c2; 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", return android::base::StringPrintf("%s%s%s/%s",
&DATA_PATH[0], &DATA_PATH[0],
&NATIVE_TEST_PATH[0], &NATIVE_TEST_PATH[0],

View File

@@ -122,7 +122,7 @@ void* WearSwipeDetector::touch_thread(void* cookie) {
return NULL; 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 WearSwipeDetector::openDevice(const char *device) {
int fd = open(device, O_RDONLY); int fd = open(device, O_RDONLY);