This is a bogus warning by GCC, but it's easy to fix by having an "else"
case with no extra conditions.
Change-Id: I0f99527065138ff96c0613a57b0462613139900c
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
uint32_t base;
uint32_t diff;
uint32_t result;
- if(firstBound == secondBound){
- return secondBound;
- }else if(firstBound > secondBound){
+ if(firstBound > secondBound){
base = secondBound;
diff = firstBound - secondBound;
}else if(firstBound < secondBound){
base = firstBound;
diff = secondBound - firstBound;
+ }else{
+ return secondBound;
}
result = ((float)OCGetRandom()/((float)(0xFFFFFFFF))*(float)diff) + (float) base;
return result;