Re: [Nut-upsdev] [PATCH] Fix logic error in rhino driver

2011-11-12 Thread Arnaud Quette
Hi Silvino, could you please check the below thread? Your lights on this would be much appreciated. thanks, Arnaud 2011/11/3 Thomas Jarosch > On Saturday, 15. October 2011 09:10:18 Arnaud Quette wrote: > > >>> Detected by "cppcheck", not tested on real hardware. > > >>> > > >>> - if( ( B

Re: [Nut-upsdev] [PATCH] Fix logic error in rhino driver

2011-11-03 Thread Thomas Jarosch
On Saturday, 15. October 2011 09:10:18 Arnaud Quette wrote: > >>> Detected by "cppcheck", not tested on real hardware. > >>> > >>> - if( ( BattVoltage > 129 ) || ( BattVoltage < 144 ) ) > >>> + if( ( BattVoltage > 129 ) && ( BattVoltage < 144 ) ) > >> > >> I think the current, ||, l

Re: [Nut-upsdev] [PATCH] Fix logic error in rhino driver

2011-10-15 Thread Arnaud Quette
Fellows, 2011/10/15 Stuart D Gathman : > On 10/14/2011 06:10 PM, Regid Ichira wrote: >> The if() statement always evaluated to true. >>> Detected by "cppcheck", not tested on real hardware. >>> >>> -      if(  ( BattVoltage > 129 ) || ( BattVoltage < 144 ) ) >>> +      if(  ( BattVoltage > 129 ) &

Re: [Nut-upsdev] [PATCH] Fix logic error in rhino driver

2011-10-14 Thread Stuart D Gathman
On 10/14/2011 06:10 PM, Regid Ichira wrote: > The if() statement always evaluated to true. >> Detected by "cppcheck", not tested on real hardware. >> >> - if( ( BattVoltage > 129 ) || ( BattVoltage < 144 ) ) >> + if( ( BattVoltage > 129 ) && ( BattVoltage < 144 ) ) > I think the curre

Re: [Nut-upsdev] [PATCH] Fix logic error in rhino driver

2011-10-14 Thread Regid Ichira
--- On Fri, 10/14/11, Stuart D. Gathman > range checks are more readable when coded this way: > > if( ( 129 < BattVoltage ) && ( BattVoltage < 144 ) ) > result = (int) auton; > else > result = 133; I second this one, but read further. --- On Fri, 10/14/11, Thomas Ja

Re: [Nut-upsdev] [PATCH] Fix logic error in rhino driver

2011-10-14 Thread Stuart D. Gathman
On Fri, 14 Oct 2011, Thomas Jarosch wrote: The if() statement always evaluated to true. Detected by "cppcheck", not tested on real hardware. --- a/drivers/rhino.c +++ b/drivers/rhino.c @@ -187,7 +187,7 @@ AutonomyCalc( int ia ) /* all models */ { currin = ( UtilPowerOut + ConstInt )

[Nut-upsdev] [PATCH] Fix logic error in rhino driver

2011-10-14 Thread Thomas Jarosch
The if() statement always evaluated to true. Detected by "cppcheck", not tested on real hardware. Signed-off-by: Thomas Jarosch --- drivers/rhino.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/rhino.c b/drivers/rhino.c index ca66169..e478bcb 100644 --- a/driv