Use a consistant 64-bit int type.
This commit is contained in:
parent
937fd69693
commit
b616bcf191
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=46659
@ -26,7 +26,7 @@
|
||||
|
||||
void
|
||||
-BSDGetSwapCtlInfo(int *totalp, int *freep) {
|
||||
+BSDGetSwapCtlInfo(long *totalp, long *freep) {
|
||||
+BSDGetSwapCtlInfo(int64_t *totalp, int64_t *freep) {
|
||||
int totalinuse, totalsize;
|
||||
int rnswap, nswap = swapctl(SWAP_NSWAP, 0, 0);
|
||||
struct swapent *swapiter;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#ifdef HAVE_SWAPCTL
|
||||
void
|
||||
-BSDGetSwapCtlInfo(int* total, int* free);
|
||||
+BSDGetSwapCtlInfo(long* total, long* free);
|
||||
+BSDGetSwapCtlInfo(int64_t* total, int64_t* free);
|
||||
#endif
|
||||
|
||||
int
|
||||
|
@ -5,11 +5,11 @@
|
||||
|
||||
void
|
||||
-BSDGetSwapInfo(int* total, int* free)
|
||||
+BSDGetSwapInfo(long* total, long* free)
|
||||
+BSDGetSwapInfo(int64_t* total, int64_t* free)
|
||||
{
|
||||
- int i, avail, npfree, used=0, xsize, xfree;
|
||||
+ int i, npfree, xsize, xfree;
|
||||
+ long avail, used=0;
|
||||
+ int64_t avail, used=0;
|
||||
|
||||
fetchswap();
|
||||
#ifdef USE_KVM_GETSWAPINFO
|
||||
@ -17,8 +17,8 @@
|
||||
if (kvnsw == 0) {
|
||||
- avail += pagesize * kvmsw[0].ksw_total;
|
||||
- used += pagesize * kvmsw[0].ksw_used;
|
||||
+ avail += pagesize * (long)kvmsw[0].ksw_total;
|
||||
+ used += pagesize * (long)kvmsw[0].ksw_used;
|
||||
+ avail += pagesize * (int64_t)kvmsw[0].ksw_total;
|
||||
+ used += pagesize * (int64_t)kvmsw[0].ksw_used;
|
||||
}
|
||||
*total = avail;
|
||||
*free = avail - used;
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
void
|
||||
-BSDGetSwapInfo(int* total, int* free);
|
||||
+BSDGetSwapInfo(long* total, long* free);
|
||||
+BSDGetSwapInfo(int64_t* total, int64_t* free);
|
||||
|
||||
void
|
||||
-BSDGetSwapCtlInfo(int* total, int* free);
|
||||
+BSDGetSwapCtlInfo(long* total, long* free);
|
||||
+BSDGetSwapCtlInfo(int64_t* total, int64_t* free);
|
||||
|
@ -3,5 +3,5 @@
|
||||
@@ -76,3 +76,3 @@
|
||||
void SwapMeter::getswapinfo( void ){
|
||||
- int total_int, free_int;
|
||||
+ long total_int, free_int;
|
||||
+ int64_t total_int, free_int;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user