Skip to content

Commit 8e496b3

Browse files
committed
use short instead of long/float
Signed-off-by: moonbuggy <3319867+moonbuggy@users.noreply.github.com>
1 parent 14f6dd1 commit 8e496b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/optiups.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -488,22 +488,22 @@ void upsdrv_updateinfo(void)
488488
optifill( _pollv_ps, sizeof(_pollv_ps)/sizeof(_pollv_ps[0]) );
489489

490490
r = optiquery( "NV" );
491-
float inV = strtol ( _buf, NULL, 10);
491+
short inV = atoi ( _buf );
492492
r = optiquery( "OV" );
493-
float outV = strtol ( _buf, NULL, 10);
493+
short outV = atoi ( _buf );
494494

495495
r = optiquery( "FV" );
496496
if ( r >= 1 )
497497
{
498-
float f = strtol ( _buf, NULL, 10 );
498+
short f = atoi ( _buf );
499499
if ( f > 180 )
500500
{
501501
inV = inV * 2;
502502
outV = outV * 2;
503503
}
504504
}
505-
dstate_setinfo( "input.voltage", "%.1f", inV );
506-
dstate_setinfo( "output.voltage", "%.1f", outV );
505+
dstate_setinfo( "input.voltage", "%d", inV );
506+
dstate_setinfo( "output.voltage", "%d", outV );
507507
}
508508
else
509509
optifill( _pollv, sizeof(_pollv)/sizeof(_pollv[0]) );

0 commit comments

Comments
 (0)