From becb032818f488122656e263bb5561928a8062ad Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Sat, 14 Dec 2024 05:01:49 +0800 Subject: [PATCH] Use uint64_t for disk IO accumulated values Change the data type from unsigned long long to uint64_t. Co-authored-by: Benny Baumann --- darwin/Platform.c | 4 ++-- freebsd/Platform.c | 2 +- linux/Platform.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/darwin/Platform.c b/darwin/Platform.c index b7e7a0bae..ebfc5de9e 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -404,7 +404,7 @@ bool Platform_getDiskIO(DiskIOData* data) { if (IOServiceGetMatchingServices(iokit_port, IOServiceMatching("IOBlockStorageDriver"), &drive_list)) return false; - unsigned long long int read_sum = 0, write_sum = 0, timeSpend_sum = 0; + uint64_t read_sum = 0, write_sum = 0, timeSpend_sum = 0; uint64_t numDisks = 0; io_registry_entry_t drive; @@ -437,7 +437,7 @@ bool Platform_getDiskIO(DiskIOData* data) { numDisks++; CFNumberRef number; - unsigned long long int value; + uint64_t value; /* Get bytes read */ number = (CFNumberRef) CFDictionaryGetValue(statistics, CFSTR(kIOBlockStorageDriverStatisticsBytesReadKey)); diff --git a/freebsd/Platform.c b/freebsd/Platform.c index a2392db26..0464c6fe8 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -312,7 +312,7 @@ bool Platform_getDiskIO(DiskIOData* data) { int count = current.dinfo->numdevs; - unsigned long long int bytesReadSum = 0, bytesWriteSum = 0, timeSpendSum = 0; + uint64_t bytesReadSum = 0, bytesWriteSum = 0, timeSpendSum = 0; uint64_t numDisks = 0; // get data diff --git a/linux/Platform.c b/linux/Platform.c index 39c64066a..eec5d1bf2 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -613,7 +613,7 @@ bool Platform_getDiskIO(DiskIOData* data) { char lastTopDisk[32] = { '\0' }; - unsigned long long int read_sum = 0, write_sum = 0, timeSpend_sum = 0; + uint64_t read_sum = 0, write_sum = 0, timeSpend_sum = 0; uint64_t numDisks = 0; char lineBuffer[256];