From fafb0c541bb4b24515c57251a44d87825eec90fb Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Thu, 25 Jul 2013 22:53:02 +0200 Subject: Unify indentation and little clean-up in TWRP files Signed-off-by: Vojtech Bocek --- twinstall.cpp | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'twinstall.cpp') diff --git a/twinstall.cpp b/twinstall.cpp index e7d23ecaf..041c78d63 100644 --- a/twinstall.cpp +++ b/twinstall.cpp @@ -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); -- cgit v1.2.3