File xosview-1.8.3-float-conv.patch of Package xosview
linux/swapmeter.cc | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
Index: linux/swapmeter.cc
===================================================================
--- linux/swapmeter.cc.orig
+++ linux/swapmeter.cc
@@ -62,13 +62,13 @@ void SwapMeter::getswapinfo( void ){
syscall( SYS_sysinfo, &sinfo );
#endif
unit = (sinfo.mem_unit ? sinfo.mem_unit : 1);
- total_ = sinfo.totalswap * unit;
- fields_[0] = (sinfo.totalswap - sinfo.freeswap) * unit;
- fields_[1] = sinfo.freeswap * unit;
+ total_ = 1.0 * sinfo.totalswap * unit;
+ fields_[0] = 1.0 * (sinfo.totalswap - sinfo.freeswap) * unit;
+ fields_[1] = 1.0 * sinfo.freeswap * unit;
if ( total_ == 0 ){
total_ = 1;
fields_[0] = 0;
fields_[1] = 1;