Unify indentation and little clean-up in TWRP files

Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
This commit is contained in:
Vojtech Bocek
2013-07-25 22:53:02 +02:00
committed by Gerrit Code Review
parent 8b44bbda25
commit fafb0c541b
37 changed files with 3841 additions and 3786 deletions
+26 -26
View File
@@ -87,37 +87,37 @@ static int Run_Update_Binary(const char *path, ZipArchive *Zip, int* wipe_cache)
child_data = fdopen(pipe_fd[0], "r");
while (fgets(buffer, sizeof(buffer), child_data) != NULL) {
char* command = strtok(buffer, " \n");
if (command == NULL) {
continue;
} else if (strcmp(command, "progress") == 0) {
char* fraction_char = strtok(NULL, " \n");
char* seconds_char = strtok(NULL, " \n");
if (command == NULL) {
continue;
} else if (strcmp(command, "progress") == 0) {
char* fraction_char = strtok(NULL, " \n");
char* seconds_char = strtok(NULL, " \n");
float fraction_float = strtof(fraction_char, NULL);
int seconds_float = strtol(seconds_char, NULL, 10);
float fraction_float = strtof(fraction_char, NULL);
int seconds_float = strtol(seconds_char, NULL, 10);
if (zip_verify)
if (zip_verify)
DataManager::ShowProgress(fraction_float * (1 - VERIFICATION_PROGRESS_FRACTION), seconds_float);
else
DataManager::ShowProgress(fraction_float, seconds_float);
} else if (strcmp(command, "set_progress") == 0) {
char* fraction_char = strtok(NULL, " \n");
float fraction_float = strtof(fraction_char, NULL);
DataManager::SetProgress(fraction_float);
} else if (strcmp(command, "ui_print") == 0) {
char* display_value = strtok(NULL, "\n");
if (display_value) {
gui_print("%s", display_value);
} else {
gui_print("\n");
}
} else if (strcmp(command, "wipe_cache") == 0) {
*wipe_cache = 1;
} else if (strcmp(command, "clear_display") == 0) {
// Do nothing, not supported by TWRP
} else {
LOGERR("unknown command [%s]\n", command);
}
} else if (strcmp(command, "set_progress") == 0) {
char* fraction_char = strtok(NULL, " \n");
float fraction_float = strtof(fraction_char, NULL);
DataManager::SetProgress(fraction_float);
} else if (strcmp(command, "ui_print") == 0) {
char* display_value = strtok(NULL, "\n");
if (display_value) {
gui_print("%s", display_value);
} else {
gui_print("\n");
}
} else if (strcmp(command, "wipe_cache") == 0) {
*wipe_cache = 1;
} else if (strcmp(command, "clear_display") == 0) {
// Do nothing, not supported by TWRP
} else {
LOGERR("unknown command [%s]\n", command);
}
}
fclose(child_data);