1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

qrtplib: fixed compiler warning

This commit is contained in:
f4exb 2018-02-23 00:13:23 +01:00
parent f1f7a0058c
commit bf58108ac3

View File

@ -70,9 +70,11 @@ uint8_t RTPRandomURandom::GetRandom8()
uint8_t value; uint8_t value;
fread(&value, sizeof(uint8_t), 1, device); if (fread(&value, sizeof(uint8_t), 1, device) == sizeof(uint8_t)) {
return value;
return value; } else {
return 0;
}
} }
uint16_t RTPRandomURandom::GetRandom16() uint16_t RTPRandomURandom::GetRandom16()
@ -82,9 +84,11 @@ uint16_t RTPRandomURandom::GetRandom16()
uint16_t value; uint16_t value;
fread(&value, sizeof(uint16_t), 1, device); if (fread(&value, sizeof(uint16_t), 1, device) == sizeof(uint16_t)) {
return value;
return value; } else {
return 0;
}
} }
uint32_t RTPRandomURandom::GetRandom32() uint32_t RTPRandomURandom::GetRandom32()
@ -94,7 +98,11 @@ uint32_t RTPRandomURandom::GetRandom32()
uint32_t value; uint32_t value;
fread(&value, sizeof(uint32_t), 1, device); if (fread(&value, sizeof(uint32_t), 1, device) == sizeof(uint32_t)) {
return value;
} else {
return 0;
}
return value; return value;
} }
@ -106,15 +114,17 @@ double RTPRandomURandom::GetRandomDouble()
uint64_t value; uint64_t value;
fread(&value, sizeof(uint64_t), 1, device); if (fread(&value, sizeof(uint64_t), 1, device) == sizeof(uint64_t))
{
value &= 0x7fffffffffffffffULL; value &= 0x7fffffffffffffffULL;
int64_t value2 = (int64_t)value;
int64_t value2 = (int64_t)value; double x = RTPRANDOM_2POWMIN63*(double)value2;
double x = RTPRANDOM_2POWMIN63*(double)value2; return x;
}
return x; else
{
return 0;
}
} }
} // end namespace } // end namespace