mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-05 16:25:41 +08:00
Convert C++ while loops from int to bool (#21214)
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -93,7 +93,7 @@ float trial() {
|
||||
}
|
||||
|
||||
int main() {
|
||||
while (1) {
|
||||
while (true) {
|
||||
float ret = trial();
|
||||
printf("got %f\n", ret);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user