Skip to content

Commit 565d9af

Browse files
Add parenthesis to fix compiler warning
Gcc warns when using = where == seems logical, and adding parenthesis tells gcc you really mean =.
1 parent 05b1451 commit 565d9af

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

examples/mqtt_cc3k/mqtt_cc3k.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void loop() {
121121

122122
// this is our 'wait for incoming subscription packets' busy subloop
123123
Adafruit_MQTT_Subscribe *subscription;
124-
while (subscription = mqtt.readSubscription(1000)) {
124+
while ((subscription = mqtt.readSubscription(1000))) {
125125
if (subscription == &onoffbutton) {
126126
Serial.print(F("Got: "));
127127
Serial.println((char *)onoffbutton.lastread);

examples/mqtt_esp8266/mqtt_esp8266.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void loop() {
104104

105105
// this is our 'wait for incoming subscription packets' busy subloop
106106
Adafruit_MQTT_Subscribe *subscription;
107-
while (subscription = mqtt.readSubscription(1000)) {
107+
while ((subscription = mqtt.readSubscription(1000))) {
108108
if (subscription == &onoffbutton) {
109109
Serial.print(F("Got: "));
110110
Serial.println((char *)onoffbutton.lastread);

examples/mqtt_fona/mqtt_fona.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void loop() {
144144

145145
// this is our 'wait for incoming subscription packets' busy subloop
146146
Adafruit_MQTT_Subscribe *subscription;
147-
while (subscription = mqtt.readSubscription(5000)) {
147+
while ((subscription = mqtt.readSubscription(5000))) {
148148
if (subscription == &onoffbutton) {
149149
Serial.print(F("Got: "));
150150
Serial.println((char *)onoffbutton.lastread);

0 commit comments

Comments
 (0)