From 7db5c03bacc3cc71cd64408d09b305bd3249f9f1 Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Tue, 14 Dec 2021 14:13:06 +0900 Subject: [PATCH] universal7885: debug_daemon: run clang-format Signed-off-by: roynatech2544 --- universal7885-common/debug/Kmsg.cpp | 21 ++++++++++----------- universal7885-common/debug/Logcat.cpp | 17 ++++++++--------- universal7885-common/debug/Main.cpp | 2 +- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/universal7885-common/debug/Kmsg.cpp b/universal7885-common/debug/Kmsg.cpp index 49d941e..43e68d3 100644 --- a/universal7885-common/debug/Kmsg.cpp +++ b/universal7885-common/debug/Kmsg.cpp @@ -19,26 +19,25 @@ #define WRITE_KMSG "/data/debug/logs/kmsg.txt" #define LOG_TAG "DebugKmsgDaemon" -#include #include +#include -bool check_data(){ +bool check_data() { std::ifstream datafile(CHECK_KMSG); - if(datafile.good()){ - datafile.close(); + if (datafile.good()) { + datafile.close(); ALOGI("Found %s, logging...", CHECK_KMSG); return true; - }else{ + } else { ALOGW("Couldn't find %s, not logging...", CHECK_KMSG); return false; } } -void copy_kmsg(){ - if(check_data()){ - std::ifstream readfile(KMSG_PATH); - std::ofstream writefile(WRITE_KMSG); - writefile << readfile.rdbuf(); +void copy_kmsg() { + if (check_data()) { + std::ifstream readfile(KMSG_PATH); + std::ofstream writefile(WRITE_KMSG); + writefile << readfile.rdbuf(); } } - diff --git a/universal7885-common/debug/Logcat.cpp b/universal7885-common/debug/Logcat.cpp index a889892..2dbd6a1 100644 --- a/universal7885-common/debug/Logcat.cpp +++ b/universal7885-common/debug/Logcat.cpp @@ -18,25 +18,24 @@ #define WRITE_LOGCAT "/data/debug/logs/logcat.txt" #define LOG_TAG "DebugLogcatDaemon" -#include #include +#include #include -bool check_data(){ +bool check_data() { std::ifstream datafile(CHECK_LOGCAT); - if(datafile.good()){ - datafile.close(); + if (datafile.good()) { + datafile.close(); ALOGI("Found %s, logging...", CHECK_LOGCAT); return true; - }else{ + } else { ALOGW("Couldn't find %s, not logging...", CHECK_LOGCAT); return false; } } -void copy_logcat(){ - if(check_data()){ - system("/system/bin/logcat -f /data/debug/logs/logcat.txt"); +void copy_logcat() { + if (check_data()) { + system("/system/bin/logcat -f /data/debug/logs/logcat.txt"); } } - diff --git a/universal7885-common/debug/Main.cpp b/universal7885-common/debug/Main.cpp index 511ef56..f357063 100644 --- a/universal7885-common/debug/Main.cpp +++ b/universal7885-common/debug/Main.cpp @@ -1,6 +1,6 @@ void copy_kmsg(); void copy_logcat(); -int main(){ +int main() { copy_kmsg(); copy_logcat(); return 0;