Skip to content

Commit

Permalink
Switch unsigned long long to uint64_t
Browse files Browse the repository at this point in the history
That's what the kernel is using.

Signed-off-by: Alexander Heinlein <[email protected]>
  • Loading branch information
scaidermern committed Dec 17, 2021
1 parent df94fc9 commit 4052f68
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
18 changes: 9 additions & 9 deletions ProcCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Cache::Cache() : isEmpty(true),

Cache::Cache(const ProcessStatus& status) :
isEmpty(false),
userTimeJiffies(stringToNumber<unsigned long long>(status[UserTimeJiffies])),
systemTimeJiffies(stringToNumber<unsigned long long>(status[SystemTimeJiffies])),
startTimeJiffies(stringToNumber<unsigned long long>(status[StartTimeJiffies])),
userTimeJiffies(stringToNumber<uint64_t>(status[UserTimeJiffies])),
systemTimeJiffies(stringToNumber<uint64_t>(status[SystemTimeJiffies])),
startTimeJiffies(stringToNumber<uint64_t>(status[StartTimeJiffies])),
runTimeSecs(0.0),
totReadBytes(stringToNumber<unsigned long long>(status[TotReadBytes])),
totReadBytesStorage(stringToNumber<unsigned long long>(status[TotReadBytesStorage])),
totWrittenBytes(stringToNumber<unsigned long long>(status[TotWrittenBytes])),
totWrittenBytesStorage(stringToNumber<unsigned long long>(status[TotWrittenBytesStorage])),
totReadCalls(stringToNumber<unsigned long long>(status[TotReadCalls])),
totWriteCalls(stringToNumber<unsigned long long>(status[TotWriteCalls])) {
totReadBytes(stringToNumber<uint64_t>(status[TotReadBytes])),
totReadBytesStorage(stringToNumber<uint64_t>(status[TotReadBytesStorage])),
totWrittenBytes(stringToNumber<uint64_t>(status[TotWrittenBytes])),
totWrittenBytesStorage(stringToNumber<uint64_t>(status[TotWrittenBytesStorage])),
totReadCalls(stringToNumber<uint64_t>(status[TotReadCalls])),
totWriteCalls(stringToNumber<uint64_t>(status[TotWriteCalls])) {
}
23 changes: 12 additions & 11 deletions ProcCache.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef PROC_CACHE_H
#define PROC_CACHE_H PROC_CACHE_H

#include <cstdint>
#include <string>
#include <vector>

Expand All @@ -17,17 +18,17 @@ class Cache {
/// @note @ref runTimeSecs has to be filled later
Cache(const ProcessStatus &status);

bool isEmpty;
unsigned long long userTimeJiffies;
unsigned long long systemTimeJiffies;
unsigned long long startTimeJiffies;
double runTimeSecs;
unsigned long long totReadBytes;
unsigned long long totReadBytesStorage;
unsigned long long totWrittenBytes;
unsigned long long totWrittenBytesStorage;
unsigned long long totReadCalls;
unsigned long long totWriteCalls;
bool isEmpty;
uint64_t userTimeJiffies;
uint64_t systemTimeJiffies;
uint64_t startTimeJiffies;
double runTimeSecs;
uint64_t totReadBytes;
uint64_t totReadBytesStorage;
uint64_t totWrittenBytes;
uint64_t totWrittenBytesStorage;
uint64_t totReadCalls;
uint64_t totWriteCalls;
};

#endif // PROC_CACHE_H

0 comments on commit 4052f68

Please sign in to comment.