Skip to content

Commit c674461

Browse files
Run CI with add'l warning -Wdouble-promotion (#3128)
See #3127, #3126
1 parent 60d1e4d commit c674461

File tree

15 files changed

+22
-21
lines changed

15 files changed

+22
-21
lines changed

libraries/BluetoothHIDMaster/examples/KeyboardPiano/KeyboardPiano.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void mb(void *cbdata, int butt, bool down) {
9191
inline uint32_t stepForHz(float hz) {
9292
const float stepHz = 1000.0 / 44100.0;
9393
const float step = hz * stepHz;
94-
return (uint32_t)(step * 65536.0);
94+
return (uint32_t)(step * 65536.0f);
9595
}
9696

9797
uint32_t keyStepMap[128]; // The frequency of any raw HID key

libraries/BluetoothHIDMaster/examples/KeyboardPianoBLE/KeyboardPianoBLE.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void mb(void *cbdata, int butt, bool down) {
9191
inline uint32_t stepForHz(float hz) {
9292
const float stepHz = 1000.0 / 44100.0;
9393
const float step = hz * stepHz;
94-
return (uint32_t)(step * 65536.0);
94+
return (uint32_t)(step * 65536.0f);
9595
}
9696

9797
uint32_t keyStepMap[128]; // The frequency of any raw HID key

libraries/LittleFS/examples/SpeedTest/SpeedTest.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ const char *rate(unsigned long start, unsigned long stop, unsigned long bytes) {
2121
strcpy_P(buff, PSTR("Inf b/s"));
2222
} else {
2323
unsigned long delta = stop - start;
24-
float r = 1000.0 * (float)bytes / (float)delta;
25-
if (r >= 1000000.0) {
26-
sprintf_P(buff, PSTR("%0.2f MB/s"), r / 1000000.0);
27-
} else if (r >= 1000.0) {
28-
sprintf_P(buff, PSTR("%0.2f KB/s"), r / 1000.0);
24+
float r = 1000.0f * (float)bytes / (float)delta;
25+
if (r >= 1000000.0f) {
26+
sprintf_P(buff, PSTR("%0.2f MB/s"), (double)r / 1000000.0);
27+
} else if (r >= 1000.0f) {
28+
sprintf_P(buff, PSTR("%0.2f KB/s"), (double)r / 1000.0);
2929
} else {
3030
sprintf_P(buff, PSTR("%d bytes/s"), (int)r);
3131
}

libraries/Mouse/examples/Circle/Circle.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void loop() {
1717
float r = 100;
1818
float ox = 0.0;
1919
float oy = 0.0;
20-
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
20+
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
2121
float ax = r * cos(a);
2222
float ay = r * sin(a);
2323
float dx = ax - ox;

libraries/MouseAbsolute/examples/CircleAbsolute/CircleAbsolute.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void loop() {
1717
float r = 1000;
1818
for (float cx = 1000; cx <= 16000; cx += 4000) {
1919
for (float cy = 1000; cy <= 16000; cy += 4000) {
20-
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
20+
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
2121
float ax = r * cos(a);
2222
float ay = r * sin(a);
2323
MouseAbsolute.move(ax + cx, ay + cy, 0);

libraries/MouseBLE/examples/BLECircle/BLECircle.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void loop() {
1616
float r = 100;
1717
float ox = 0.0;
1818
float oy = 0.0;
19-
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
19+
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
2020
float ax = r * cos(a);
2121
float ay = r * sin(a);
2222
float dx = ax - ox;

libraries/MouseBLE/examples/BLECircleAbsolute/BLECircleAbsolute.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void loop() {
1717
float r = 1000;
1818
for (float cx = 1000; cx <= 16000; cx += 4000) {
1919
for (float cy = 1000; cy <= 16000; cy += 4000) {
20-
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
20+
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
2121
float ax = r * cos(a);
2222
float ay = r * sin(a);
2323
MouseBLE.move(ax + cx, ay + cy, 0);

libraries/MouseBLE/examples/BLECircleKeysJoystick/BLECircleKeysJoystick.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void loop() {
5959
float r = 100;
6060
float ox = 0.0;
6161
float oy = 0.0;
62-
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
62+
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
6363
float ax = r * cos(a);
6464
float ay = r * sin(a);
6565
float dx = ax - ox;

libraries/MouseBT/examples/BTCircle/BTCircle.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void loop() {
1717
float r = 100;
1818
float ox = 0.0;
1919
float oy = 0.0;
20-
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
20+
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
2121
float ax = r * cos(a);
2222
float ay = r * sin(a);
2323
float dx = ax - ox;

libraries/MouseBT/examples/BTCircleAbsolute/BTCircleAbsolute.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void loop() {
1717
float r = 1000;
1818
for (float cx = 1000; cx <= 16000; cx += 4000) {
1919
for (float cy = 1000; cy <= 16000; cy += 4000) {
20-
for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
20+
for (float a = 0.0f; a < 2.0f * 3.14159f; a += 0.1f) {
2121
float ax = r * cos(a);
2222
float ay = r * sin(a);
2323
MouseBT.move(ax + cx, ay + cy, 0);

0 commit comments

Comments
 (0)