Skip to content

Commit 17d8a20

Browse files
committed
fix build warnings about uninitialized fields
1 parent 92e6cab commit 17d8a20

File tree

1 file changed

+43
-37
lines changed

1 file changed

+43
-37
lines changed

Fields.h

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -242,57 +242,63 @@ String setSHueMax(String value) {
242242
sHueMax = value.toInt(); return value;
243243
}
244244

245+
// name, label, type, min, max, getValue, getOptions, setValue
245246
FieldList fields = {
246-
{"name", "Name", LabelFieldType, 0, 0, getName},
247+
{"name", "Name", LabelFieldType, 0, 0, getName, nullptr, nullptr},
247248

248-
{"power", "Power", BooleanFieldType, 0, 1, getPower},
249-
{"brightness", "Brightness", NumberFieldType, 1, 255, getBrightness},
250-
{"pattern", "Pattern", SelectFieldType, 0, patternCount, getPattern, getPatterns},
251-
{"palette", "Palette", SelectFieldType, 0, paletteCount, getPalette, getPalettes},
252-
{"speed", "Speed", NumberFieldType, 1, 255, getSpeed},
249+
{"power", "Power", BooleanFieldType, 0, 1, getPower, nullptr, nullptr},
250+
{"brightness", "Brightness", NumberFieldType, 1, 255, getBrightness, nullptr, nullptr},
251+
{"pattern", "Pattern", SelectFieldType, 0, patternCount, getPattern, getPatterns, nullptr},
252+
{"palette", "Palette", SelectFieldType, 0, paletteCount, getPalette, getPalettes, nullptr},
253+
{"speed", "Speed", NumberFieldType, 1, 255, getSpeed, nullptr, nullptr},
253254

254-
{"autoplaySection", "Autoplay", SectionFieldType},
255-
{"autoplay", "Autoplay", BooleanFieldType, 0, 1, getAutoplay},
256-
{"autoplayDuration", "Autoplay Duration", NumberFieldType, 0, 255, getAutoplayDuration},
255+
//--------------------------------------------------------------------------------------------------------
256+
{"autoplaySection", "Autoplay", SectionFieldType, 0, 0, nullptr, nullptr, nullptr},
257+
{"autoplay", "Autoplay", BooleanFieldType, 0, 1, getAutoplay, nullptr, nullptr},
258+
{"autoplayDuration", "Autoplay Duration", NumberFieldType, 0, 255, getAutoplayDuration, nullptr, nullptr},
257259

258-
{"solidColorSection", "Solid Color", SectionFieldType},
259-
{"solidColor", "Color", ColorFieldType, 0, 255, getSolidColor},
260+
//--------------------------------------------------------------------------------------------------------
261+
{"solidColorSection", "Solid Color", SectionFieldType, 0, 0, nullptr, nullptr, nullptr},
262+
{"solidColor", "Color", ColorFieldType, 0, 255, getSolidColor, nullptr, nullptr},
260263

261-
{"fireSection", "Fire & Water", SectionFieldType},
262-
{"cooling", "Cooling", NumberFieldType, 0, 255, getCooling},
263-
{"sparking", "Sparking", NumberFieldType, 0, 255, getSparking},
264+
//--------------------------------------------------------------------------------------------------------
265+
{"fireSection", "Fire & Water", SectionFieldType, 0, 0, nullptr, nullptr, nullptr},
266+
{"cooling", "Cooling", NumberFieldType, 0, 255, getCooling, nullptr, nullptr},
267+
{"sparking", "Sparking", NumberFieldType, 0, 255, getSparking, nullptr, nullptr},
264268

265-
{"twinklesSection", "Twinkles", SectionFieldType},
266-
{"twinkleSpeed", "Twinkle Speed", NumberFieldType, 0, 8, getTwinkleSpeed},
267-
{"twinkleDensity", "Twinkle Density", NumberFieldType, 0, 8, getTwinkleDensity},
268-
{"coolLikeIncandescent", "Incandescent Cool", BooleanFieldType, 0, 1, getCoolLikeIncandescent},
269+
//--------------------------------------------------------------------------------------------------------
270+
{"twinklesSection", "Twinkles", SectionFieldType, 0, 0, nullptr, nullptr, nullptr},
271+
{"twinkleSpeed", "Twinkle Speed", NumberFieldType, 0, 8, getTwinkleSpeed, nullptr, nullptr},
272+
{"twinkleDensity", "Twinkle Density", NumberFieldType, 0, 8, getTwinkleDensity, nullptr, nullptr},
273+
{"coolLikeIncandescent", "Incandescent Cool", BooleanFieldType, 0, 1, getCoolLikeIncandescent, nullptr, nullptr},
269274

270275

271-
{"prideSection", "Pride", SectionFieldType},
276+
//--------------------------------------------------------------------------------------------------------
277+
{"prideSection", "Pride", SectionFieldType, 0, 0, nullptr, nullptr, nullptr},
272278

273-
{"saturationBpm", "Saturation BPM", NumberFieldType, 0, 255, getSaturationBpm, NULL, setSaturationBpm},
274-
{"saturationMin", "Saturation Min", NumberFieldType, 0, 255, getSaturationMin, NULL, setSaturationMin},
275-
{"saturationMax", "Saturation Max", NumberFieldType, 0, 255, getSaturationMax, NULL, setSaturationMax},
279+
{"saturationBpm", "Saturation BPM", NumberFieldType, 0, 255, getSaturationBpm, nullptr, setSaturationBpm},
280+
{"saturationMin", "Saturation Min", NumberFieldType, 0, 255, getSaturationMin, nullptr, setSaturationMin},
281+
{"saturationMax", "Saturation Max", NumberFieldType, 0, 255, getSaturationMax, nullptr, setSaturationMax},
276282

277-
{"brightDepthBpm", "Brightness Depth BPM", NumberFieldType, 0, 255, getBrightDepthBpm, NULL, setBrightDepthBpm},
278-
{"brightDepthMin", "Brightness Depth Min", NumberFieldType, 0, 255, getBrightDepthMin, NULL, setBrightDepthMin},
279-
{"brightDepthMax", "Brightness Depth Max", NumberFieldType, 0, 255, getBrightDepthMax, NULL, setBrightDepthMax},
283+
{"brightDepthBpm", "Brightness Depth BPM", NumberFieldType, 0, 255, getBrightDepthBpm, nullptr, setBrightDepthBpm},
284+
{"brightDepthMin", "Brightness Depth Min", NumberFieldType, 0, 255, getBrightDepthMin, nullptr, setBrightDepthMin},
285+
{"brightDepthMax", "Brightness Depth Max", NumberFieldType, 0, 255, getBrightDepthMax, nullptr, setBrightDepthMax},
280286

281-
{"brightThetaIncBpm", "Bright Theta Inc BPM", NumberFieldType, 0, 255, getBrightThetaIncBpm, NULL, setBrightThetaIncBpm},
282-
{"brightThetaIncMin", "Bright Theta Inc Min", NumberFieldType, 0, 255, getBrightThetaIncMin, NULL, setBrightThetaIncMin},
283-
{"brightThetaIncMax", "Bright Theta Inc Max", NumberFieldType, 0, 255, getBrightThetaIncMax, NULL, setBrightThetaIncMax},
287+
{"brightThetaIncBpm", "Bright Theta Inc BPM", NumberFieldType, 0, 255, getBrightThetaIncBpm, nullptr, setBrightThetaIncBpm},
288+
{"brightThetaIncMin", "Bright Theta Inc Min", NumberFieldType, 0, 255, getBrightThetaIncMin, nullptr, setBrightThetaIncMin},
289+
{"brightThetaIncMax", "Bright Theta Inc Max", NumberFieldType, 0, 255, getBrightThetaIncMax, nullptr, setBrightThetaIncMax},
284290

285-
{"msMultiplierBpm", "Time Multiplier BPM", NumberFieldType, 0, 255, getMsMultiplierBpm, NULL, setMsMultiplierBpm},
286-
{"msMultiplierMin", "Time Multiplier Min", NumberFieldType, 0, 255, getMsMultiplierMin, NULL, setMsMultiplierMin},
287-
{"msMultiplierMax", "Time Multiplier Max", NumberFieldType, 0, 255, getMsMultiplierMax, NULL, setMsMultiplierMax},
291+
{"msMultiplierBpm", "Time Multiplier BPM", NumberFieldType, 0, 255, getMsMultiplierBpm, nullptr, setMsMultiplierBpm},
292+
{"msMultiplierMin", "Time Multiplier Min", NumberFieldType, 0, 255, getMsMultiplierMin, nullptr, setMsMultiplierMin},
293+
{"msMultiplierMax", "Time Multiplier Max", NumberFieldType, 0, 255, getMsMultiplierMax, nullptr, setMsMultiplierMax},
288294

289-
{"hueIncBpm", "Hue Inc BPM", NumberFieldType, 0, 255, getHueIncBpm, NULL, setHueIncBpm},
290-
{"hueIncMin", "Hue Inc Min", NumberFieldType, 0, 255, getHueIncMin, NULL, setHueIncMin},
291-
{"hueIncMax", "Hue Inc Max", NumberFieldType, 0, 255, getHueIncMax, NULL, setHueIncMax},
295+
{"hueIncBpm", "Hue Inc BPM", NumberFieldType, 0, 255, getHueIncBpm, nullptr, setHueIncBpm},
296+
{"hueIncMin", "Hue Inc Min", NumberFieldType, 0, 255, getHueIncMin, nullptr, setHueIncMin},
297+
{"hueIncMax", "Hue Inc Max", NumberFieldType, 0, 255, getHueIncMax, nullptr, setHueIncMax},
292298

293-
{"sHueBpm", "S Hue BPM", NumberFieldType, 0, 255, getSHueBpm, NULL, setSHueBpm},
294-
{"sHueMin", "S Hue Min", NumberFieldType, 0, 255, getSHueMin, NULL, setSHueMin},
295-
{"sHueMax", "S Hue Max", NumberFieldType, 0, 255, getSHueMax, NULL, setSHueMax},
299+
{"sHueBpm", "S Hue BPM", NumberFieldType, 0, 255, getSHueBpm, nullptr, setSHueBpm},
300+
{"sHueMin", "S Hue Min", NumberFieldType, 0, 255, getSHueMin, nullptr, setSHueMin},
301+
{"sHueMax", "S Hue Max", NumberFieldType, 0, 255, getSHueMax, nullptr, setSHueMax},
296302
};
297303

298304
uint8_t fieldCount = ARRAY_SIZE(fields);

0 commit comments

Comments
 (0)