mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Swap: fix code smells
This commit is contained in:
@@ -2,16 +2,14 @@
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
enum { FFMaxNSwap = 8 };
|
||||
|
||||
const char* ffDetectSwap(FFSwapResult* swap)
|
||||
{
|
||||
system_info info;
|
||||
if (get_system_info(&info) != B_OK)
|
||||
return "Error getting system info";
|
||||
|
||||
swap->bytesTotal = B_PAGE_SIZE * info.max_swap_pages;
|
||||
swap->bytesUsed = B_PAGE_SIZE * (info.max_swap_pages - info.free_swap_pages);
|
||||
swap->bytesTotal = B_PAGE_SIZE * (uint64_t) info.max_swap_pages;
|
||||
swap->bytesUsed = B_PAGE_SIZE * (uint64_t) (info.max_swap_pages - info.free_swap_pages);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
const char* ffDetectSwap(FFSwapResult* swap)
|
||||
{
|
||||
// #620
|
||||
// Ref: #620
|
||||
char buf[PROC_FILE_BUFFSIZ];
|
||||
ssize_t nRead = ffReadFileData("/proc/meminfo", ARRAY_SIZE(buf) - 1, buf);
|
||||
if(nRead < 0)
|
||||
|
||||
Reference in New Issue
Block a user