Skip to content

Commit 195af00

Browse files
authored
Merge pull request wled#1779 from Aircoookie/fixwarnings
Fix warnings
2 parents befeb55 + 38db8d2 commit 195af00

File tree

20 files changed

+46
-56
lines changed

20 files changed

+46
-56
lines changed

platformio.ini

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,6 @@ debug_flags = -D DEBUG=1 -D WLED_DEBUG -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT
9595
# This reduces the OTA size with ~45KB, so it's especially useful on low memory boards (512k/1m).
9696
# ------------------------------------------------------------------------------
9797
build_flags =
98-
-Wno-switch
99-
-Wno-deprecated-declarations
100-
-Wno-write-strings
101-
-Wno-unused-variable
102-
-Wno-unused-value
103-
-Wno-sign-compare
104-
-Wno-unused-but-set-variable
105-
-Wno-return-type
106-
-Wno-sequence-point
107-
-Wno-narrowing
10898
-DMQTT_MAX_PACKET_SIZE=1024
10999
-DSECURE_CLIENT=SECURE_CLIENT_BEARSSL
110100
-DBEARSSL_SSL_BASIC
@@ -121,9 +111,6 @@ build_flags =
121111
; -D USERMOD_SENSORSTOMQTT
122112

123113
build_unflags =
124-
-Wall
125-
-Wreorder
126-
-Wdeprecated-declarations
127114

128115
# enables all features for travis CI
129116
build_flags_all_features =
@@ -159,7 +146,7 @@ build_flags =
159146
-DMIMETYPE_MINIMAL
160147

161148
[esp32]
162-
build_flags = -w -g
149+
build_flags = -g
163150
-DARDUINO_ARCH_ESP32
164151
-DCONFIG_LITTLEFS_FOR_IDF_3_2
165152

@@ -197,7 +184,7 @@ lib_deps =
197184
AsyncTCP @ 1.0.3
198185
IRremoteESP8266 @ 2.7.3
199186
https://github.com/lorol/LITTLEFS.git
200-
https://github.com/Aircoookie/ESPAsyncWebServer.git @ ~2.0.0
187+
https://github.com/Aircoookie/ESPAsyncWebServer.git @ ~2.0.2
201188
#For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line
202189
#TFT_eSPI
203190
#For use SSD1306 OLED display uncomment following

wled00/FX.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ uint16_t WS2812FX::dissolve(uint32_t color) {
545545
}
546546
}
547547

548-
if (SEGENV.call > (255 - SEGMENT.speed) + 15)
548+
if (SEGENV.call > (255 - SEGMENT.speed) + 15U)
549549
{
550550
SEGENV.aux0 = !SEGENV.aux0;
551551
SEGENV.call = 0;
@@ -1034,7 +1034,7 @@ uint16_t WS2812FX::mode_running_random(void) {
10341034
}
10351035

10361036
SEGENV.step++;
1037-
if (SEGENV.step > ((255-SEGMENT.intensity) >> 4))
1037+
if (SEGENV.step > (uint8_t)((255-SEGMENT.intensity) >> 4))
10381038
{
10391039
SEGENV.step = 0;
10401040
}
@@ -1568,9 +1568,9 @@ uint16_t WS2812FX::mode_oscillate(void)
15681568

15691569
if (SEGENV.call == 0)
15701570
{
1571-
oscillators[0] = {SEGLEN/4, SEGLEN/8, 1, 1};
1572-
oscillators[1] = {SEGLEN/4*3, SEGLEN/8, 1, 2};
1573-
oscillators[2] = {SEGLEN/4*2, SEGLEN/8, -1, 1};
1571+
oscillators[0] = {(int16_t)(SEGLEN/4), (int8_t)(SEGLEN/8), 1, 1};
1572+
oscillators[1] = {(int16_t)(SEGLEN/4*3), (int8_t)(SEGLEN/8), 1, 2};
1573+
oscillators[2] = {(int16_t)(SEGLEN/4*2), (int8_t)(SEGLEN/8), -1, 1};
15741574
}
15751575

15761576
uint32_t cycleTime = 20 + (2 * (uint32_t)(255 - SEGMENT.speed));
@@ -1919,7 +1919,6 @@ uint16_t WS2812FX::mode_noise16_2()
19191919
for (uint16_t i = 0; i < SEGLEN; i++) {
19201920

19211921
uint16_t shift_x = SEGENV.step >> 6; // x as a function of time
1922-
uint16_t shift_y = SEGENV.step/42;
19231922

19241923
uint32_t real_x = (i + shift_x) * scale; // calculate the coordinates within the noise field
19251924

@@ -3198,8 +3197,8 @@ uint16_t WS2812FX::mode_plasma(void) {
31983197
uint8_t thatPhase = beatsin8(7,-64,64);
31993198

32003199
for (int i = 0; i < SEGLEN; i++) { // For each of the LED's in the strand, set color & brightness based on a wave as follows:
3201-
uint8_t colorIndex = cubicwave8((i*(1+ 3*(SEGMENT.speed >> 5)))+(thisPhase) & 0xFF)/2 // factor=23 // Create a wave and add a phase change and add another wave with its own phase change.
3202-
+ cos8((i*(1+ 2*(SEGMENT.speed >> 5)))+(thatPhase) & 0xFF)/2; // factor=15 // Hey, you can even change the frequencies if you wish.
3200+
uint8_t colorIndex = cubicwave8(((i*(1+ 3*(SEGMENT.speed >> 5)))+(thisPhase)) & 0xFF)/2 // factor=23 // Create a wave and add a phase change and add another wave with its own phase change.
3201+
+ cos8(((i*(1+ 2*(SEGMENT.speed >> 5)))+(thatPhase)) & 0xFF)/2; // factor=15 // Hey, you can even change the frequencies if you wish.
32033202
uint8_t thisBright = qsub8(colorIndex, beatsin8(6,0, (255 - SEGMENT.intensity)|0x01 ));
32043203
CRGB color = ColorFromPalette(currentPalette, colorIndex, thisBright, LINEARBLEND);
32053204
setPixelColor(i, color.red, color.green, color.blue);

wled00/FX_fcn.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ uint8_t WS2812FX::getPaletteCount()
381381

382382

383383
bool WS2812FX::setEffectConfig(uint8_t m, uint8_t s, uint8_t in, uint8_t p) {
384-
uint8_t mainSeg = getMainSegmentId();
385384
Segment& seg = _segments[getMainSegmentId()];
386385
uint8_t modePrev = seg.mode, speedPrev = seg.speed, intensityPrev = seg.intensity, palettePrev = seg.palette;
387386

wled00/cfg.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ void serializeConfig() {
448448

449449
JsonArray hw_led_ins = hw_led.createNestedArray("ins");
450450

451-
uint16_t start = 0;
452451
for (uint8_t s = 0; s < busses.getNumBusses(); s++) {
453452
Bus *bus = busses.getBus(s);
454453
if (!bus || bus->getLength()==0) break;

wled00/e131.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ void handleDDPPacket(e131_packet_t* p) {
3535
realtimeLock(realtimeTimeoutMs, REALTIME_MODE_DDP);
3636

3737
for (uint16_t i = start; i < stop; i++) {
38-
setRealtimePixel(i, data[c++], data[c++], data[c++], 0);
38+
setRealtimePixel(i, data[c], data[c+1], data[c+2], 0);
39+
c+=3;
3940
}
4041

4142
bool push = p->flags & DDP_PUSH_FLAG;
@@ -187,11 +188,13 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
187188
uint16_t ledsTotal = previousLeds + (dmxChannels - dmxOffset +1) / dmxChannelsPerLed;
188189
if (!is4Chan) {
189190
for (uint16_t i = previousLeds; i < ledsTotal; i++) {
190-
setRealtimePixel(i, e131_data[dmxOffset++], e131_data[dmxOffset++], e131_data[dmxOffset++], 0);
191+
setRealtimePixel(i, e131_data[dmxOffset], e131_data[dmxOffset+1], e131_data[dmxOffset+2], 0);
192+
dmxOffset+=3;
191193
}
192194
} else {
193195
for (uint16_t i = previousLeds; i < ledsTotal; i++) {
194-
setRealtimePixel(i, e131_data[dmxOffset++], e131_data[dmxOffset++], e131_data[dmxOffset++], e131_data[dmxOffset++]);
196+
setRealtimePixel(i, e131_data[dmxOffset], e131_data[dmxOffset+1], e131_data[dmxOffset+2], e131_data[dmxOffset+3]);
197+
dmxOffset+=4;
195198
}
196199
}
197200
break;

wled00/file.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ File f;
3333

3434
//wrapper to find out how long closing takes
3535
void closeFile() {
36-
DEBUGFS_PRINT(F("Close -> "));
37-
uint32_t s = millis();
36+
#ifdef WLED_DEBUG_FS
37+
DEBUGFS_PRINT(F("Close -> "));
38+
uint32_t s = millis();
39+
#endif
3840
f.close();
3941
DEBUGFS_PRINTF("took %d ms\n", millis() - s);
4042
doCloseFile = false;
@@ -53,7 +55,6 @@ bool bufferedFind(const char *target, bool fromStart = true) {
5355
size_t targetLen = strlen(target);
5456

5557
size_t index = 0;
56-
byte c;
5758
uint16_t bufsize = 0, count = 0;
5859
byte buf[FS_BUFSIZE];
5960
if (fromStart) f.seek(0);

wled00/json.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void deserializeSegment(JsonObject elem, byte it)
134134
if (sz == 0 && sz > 4) break;
135135

136136
int rgbw[] = {0,0,0,0};
137-
byte cp = copyArray(icol, rgbw);
137+
copyArray(icol, rgbw);
138138

139139
if (set < 2) stop = start + 1;
140140
for (uint16_t i = start; i < stop; i++) {
@@ -200,8 +200,8 @@ bool deserializeState(JsonObject root)
200200
receiveNotifications = udpn[F("recv")] | receiveNotifications;
201201
bool noNotification = udpn[F("nn")]; //send no notification just for this request
202202

203-
unsigned long timein = root[F("time")] | -1;
204-
if (timein != -1) {
203+
unsigned long timein = root[F("time")] | UINT32_MAX;
204+
if (timein != UINT32_MAX) {
205205
if (millis() - ntpLastSyncTime > 50000000L) setTime(timein);
206206
if (presetsModifiedTime == 0) presetsModifiedTime = timein;
207207
}

wled00/lx_parser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ bool parseLx(int lxValue, byte rgbw[4])
2323
ok = true;
2424
float tmpBri = floor((lxValue - 200000000) / 10000); ;
2525
uint16_t ct = (lxValue - 200000000) - (((uint8_t)tmpBri) * 10000);
26-
float temp = 0;
2726

2827
tmpBri *= 2.55;
29-
constrain(tmpBri, 0, 255);
28+
tmpBri = constrain(tmpBri, 0, 255);
3029

3130
colorKtoRGB(ct, rgbw);
3231
lxRed = rgbw[0]; lxGreen = rgbw[1]; lxBlue = rgbw[2];

wled00/src/dependencies/async-mqtt-client/AsyncMqttClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ AsyncMqttClient::AsyncMqttClient()
3737
_client.onPoll([](void* obj, AsyncClient* c) { (static_cast<AsyncMqttClient*>(obj))->_onPoll(c); }, this);
3838

3939
#ifdef ESP32
40-
sprintf(_generatedClientId, "esp32%06x", ESP.getEfuseMac());
40+
sprintf(_generatedClientId, "esp32%06x", (uint32_t)ESP.getEfuseMac());
4141
_xSemaphore = xSemaphoreCreateMutex();
4242
#elif defined(ESP8266)
43-
sprintf(_generatedClientId, "esp8266%06x", ESP.getChipId());
43+
sprintf(_generatedClientId, "esp8266%06x", (uint32_t)ESP.getChipId());
4444
#endif
4545
_clientId = _generatedClientId;
4646

wled00/src/dependencies/blynk/Blynk/BlynkProtocolDefs.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ struct BlynkHeader
9393
}
9494
BLYNK_ATTR_PACKED;
9595

96-
#if !defined(htons) && (defined(ARDUINO) || defined(ESP8266) || defined(PARTICLE) || defined(__MBED__))
96+
#if defined(ESP32)
97+
#include <lwip/ip_addr.h>
98+
#elif !defined(htons) && (defined(ARDUINO) || defined(ESP8266) || defined(PARTICLE) || defined(__MBED__))
9799
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
98100
#define htons(x) ( ((x)<<8) | (((x)>>8)&0xFF) )
99101
#define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \

0 commit comments

Comments
 (0)