Skip to content

Commit a091d20

Browse files
committed
Swap: fix code smells
1 parent 47c6588 commit a091d20

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/detection/swap/swap_haiku.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22

33
#include <OS.h>
44

5-
enum { FFMaxNSwap = 8 };
6-
75
const char* ffDetectSwap(FFSwapResult* swap)
86
{
97
system_info info;
108
if (get_system_info(&info) != B_OK)
119
return "Error getting system info";
1210

13-
swap->bytesTotal = B_PAGE_SIZE * info.max_swap_pages;
14-
swap->bytesUsed = B_PAGE_SIZE * (info.max_swap_pages - info.free_swap_pages);
11+
swap->bytesTotal = B_PAGE_SIZE * (uint64_t) info.max_swap_pages;
12+
swap->bytesUsed = B_PAGE_SIZE * (uint64_t) (info.max_swap_pages - info.free_swap_pages);
1513

1614
return NULL;
1715
}

src/detection/swap/swap_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
const char* ffDetectSwap(FFSwapResult* swap)
99
{
10-
// #620
10+
// Ref: #620
1111
char buf[PROC_FILE_BUFFSIZ];
1212
ssize_t nRead = ffReadFileData("/proc/meminfo", ARRAY_SIZE(buf) - 1, buf);
1313
if(nRead < 0)

0 commit comments

Comments
 (0)