allow the examples to build in a more strict env (#3299)

This commit is contained in:
Me No Dev
2019-09-29 23:47:02 +03:00
committed by GitHub
parent 5bff89f0be
commit 1c77790a5b
15 changed files with 31 additions and 36 deletions

View File

@ -693,15 +693,13 @@ void BLECharacteristic::setValue(int& data32) {
} // setValue
void BLECharacteristic::setValue(float& data32) {
uint8_t temp[4];
*((float*)temp) = data32;
setValue(temp, 4);
float temp = data32;
setValue((uint8_t*)&temp, 4);
} // setValue
void BLECharacteristic::setValue(double& data64) {
uint8_t temp[8];
*((double*)temp) = data64;
setValue(temp, 8);
double temp = data64;
setValue((uint8_t*)&temp, 8);
} // setValue