Fix try for #171, changed some clang-format settings

This commit is contained in:
TheDarkBug 2021-12-05 13:34:56 +01:00
parent c04a553d2f
commit 258357ac51
2 changed files with 85 additions and 84 deletions

View file

@ -13,4 +13,5 @@ AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true AllowShortLoopsOnASingleLine: true
ColumnLimit: 0 ColumnLimit: 0
MaxEmptyLinesToKeep: 1 MaxEmptyLinesToKeep: 1
PointerAlignment: Left
... ...

View file

@ -470,7 +470,7 @@ void print_info(struct configuration *config_flags, struct info *user_info) {
terminal_cursor_move, NORMAL, BOLD, NORMAL, terminal_cursor_move, NORMAL, BOLD, NORMAL,
user_info->shell); user_info->shell);
#if defined(__APPLE__) && !defined(TARGET_OS_IPHONE) #if defined(__APPLE__) && !defined(TARGET_OS_IPHONE)
if (show_pkgs) if (config_flags->show_pkgs)
system( system(
"ls $(brew --cellar) | wc -l | awk -F' ' '{print \" \x1b[34mw " "ls $(brew --cellar) | wc -l | awk -F' ' '{print \" \x1b[34mw "
" w \x1b[0m\x1b[1mPKGS\x1b[0m \"$1 \" (brew)\"}'"); " w \x1b[0m\x1b[1mPKGS\x1b[0m \"$1 \" (brew)\"}'");
@ -533,7 +533,7 @@ void write_cache(struct info *user_info) {
if (cache_fp == NULL) return; if (cache_fp == NULL) return;
// writing all info to the cache file // writing all info to the cache file
#ifdef __APPLE__ #ifdef __APPLE__
uptime = uptime_apple(); user_info->uptime = uptime_apple();
#else #else
#ifdef __FREEBSD__ #ifdef __FREEBSD__
uptime = uptime_freebsd(); uptime = uptime_freebsd();
@ -661,7 +661,7 @@ void print_cache(struct configuration *config_flags, struct info *user_info) {
// Total ram // Total ram
sysctlbyname("hw.memsize", &mem_buffer, &mem_buffer_len, NULL, 0); sysctlbyname("hw.memsize", &mem_buffer, &mem_buffer_len, NULL, 0);
ram_used = ((mem_wired + mem_active + mem_compressed) * 4 / 1024); user_info->ram_used = ((mem_wired + mem_active + mem_compressed) * 4 / 1024);
#endif // __APPLE__ #endif // __APPLE__
print_ascii(user_info); print_ascii(user_info);
@ -730,7 +730,7 @@ struct info get_info()
#endif #endif
host_model_info = popen("sysctl -a " HOSTCTL, "r"); host_model_info = popen("sysctl -a " HOSTCTL, "r");
while (fgets(line, sizeof(line), host_model_info)) while (fgets(line, sizeof(line), host_model_info))
if (sscanf(line, HOSTCTL ": %[^\n]", host_model)) break; if (sscanf(line, HOSTCTL ": %[^\n]", user_info->host_model)) break;
#endif // _WIN32 #endif // _WIN32
FILE* host_model_version = FILE* host_model_version =
fopen("/sys/devices/virtual/dmi/id/product_version", "r"); fopen("/sys/devices/virtual/dmi/id/product_version", "r");
@ -975,8 +975,8 @@ struct info get_info()
// Total // Total
sysctlbyname("hw.memsize", &mem_buffer, &mem_buffer_len, NULL, 0); sysctlbyname("hw.memsize", &mem_buffer, &mem_buffer_len, NULL, 0);
ram_used = ((mem_wired + mem_active + mem_compressed) * 4 / 1024); user_info->ram_used = ((mem_wired + mem_active + mem_compressed) * 4 / 1024);
ram_total = mem_buffer / 1024 / 1024; user_info->ram_total = mem_buffer / 1024 / 1024;
#endif #endif
/* ---------- gpu ---------- */ /* ---------- gpu ---------- */