diff --git a/installer/updater/updater.cc b/installer/updater/updater.cc index b2f9dd45ba..d1a694ef9c 100644 --- a/installer/updater/updater.cc +++ b/installer/updater/updater.cc @@ -557,7 +557,7 @@ struct Updater { // TODO: this should be generic between android versions // IPowerManager.reboot(confirm=false, reason="recovery", wait=true) system("service call power 16 i32 0 s16 recovery i32 1"); - while(1) pause(); + while (true) pause(); // execl("/system/bin/reboot", "recovery"); // set_error("failed to reboot into recovery"); diff --git a/selfdrive/camerad/cameras/camera_qcom2.cc b/selfdrive/camerad/cameras/camera_qcom2.cc index 20f62fd010..8194d79034 100644 --- a/selfdrive/camerad/cameras/camera_qcom2.cc +++ b/selfdrive/camerad/cameras/camera_qcom2.cc @@ -538,7 +538,7 @@ static int open_v4l_by_name_and_index(const char name[], int index, int flags) { char nbuf[0x100]; int v4l_index = 0; int cnt_index = index; - while (1) { + while (true) { snprintf(nbuf, sizeof(nbuf), "/sys/class/video4linux/v4l-subdev%d/name", v4l_index); FILE *f = fopen(nbuf, "rb"); if (f == NULL) return -1; diff --git a/selfdrive/common/params.cc b/selfdrive/common/params.cc index 5e0a26eea4..f8fb480a8d 100644 --- a/selfdrive/common/params.cc +++ b/selfdrive/common/params.cc @@ -268,7 +268,7 @@ int Params::put(const char* key, const char* value, size_t value_size) { // fsync parent directory path = params_path + "/d"; result = fsync_dir(path.c_str()); - } while(0); + } while (false); close(tmp_fd); remove(tmp_path.c_str()); diff --git a/selfdrive/modeld/test/dmon_lag/repro.cc b/selfdrive/modeld/test/dmon_lag/repro.cc index bba404fb5f..c4c1c65cbe 100644 --- a/selfdrive/modeld/test/dmon_lag/repro.cc +++ b/selfdrive/modeld/test/dmon_lag/repro.cc @@ -93,7 +93,7 @@ float trial() { } int main() { - while (1) { + while (true) { float ret = trial(); printf("got %f\n", ret); } diff --git a/selfdrive/modeld/test/snpe_benchmark/benchmark.cc b/selfdrive/modeld/test/snpe_benchmark/benchmark.cc index 8209508629..1e2072eea1 100644 --- a/selfdrive/modeld/test/snpe_benchmark/benchmark.cc +++ b/selfdrive/modeld/test/snpe_benchmark/benchmark.cc @@ -182,7 +182,7 @@ int main(int argc, char* argv[]) { } if (argc == 2) { - while(1) test(argv[1]); + while (true) test(argv[1]); } else if (argc == 3) { testrun(argv[1]); } diff --git a/selfdrive/ui/replay/filereader.cc b/selfdrive/ui/replay/filereader.cc index 2a16983032..e005144f8c 100644 --- a/selfdrive/ui/replay/filereader.cc +++ b/selfdrive/ui/replay/filereader.cc @@ -67,7 +67,7 @@ LogReader::LogReader(const QString& file, Events *events_, QReadWriteLock* event event_offset = 0; parser = new std::thread([&]() { - while (1) { + while (true) { mergeEvents(cdled.get()); } });