Skip to content

Commit 5aa8f68

Browse files
committed
Janitorial: Fix coding standard violations identified by integrated audits.
This commit resolves numerous header inclusion and ordering issues to satisfy the new project-wide build gate: - Added missing 'globals.h' to 'iservice.h', 'crgbw.h', 'pixelformat.h'. - Alphabetized system and local includes in 'ledstripeffect.h', 'gfxbase.h', 'ws281xgfx.h', 'webserver.h', 'crgbw.h', 'pixelformat.h', 'ws281xoutputmanager.cpp', 'deviceconfig.cpp', 'webserver.cpp', 'ledstripeffect.cpp', and 'systemcontainer.cpp'. - Enforced tiering by moving system headers before local headers where necessary.
1 parent eec5f76 commit 5aa8f68

13 files changed

Lines changed: 25 additions & 19 deletions

include/crgbw.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
//
3737
//---------------------------------------------------------------------------
3838

39-
#include <cstdint>
39+
#include "globals.h"
40+
4041
#include <algorithm>
42+
#include <cstdint>
4143

4244
struct CRGBW
4345
{

include/gfxbase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
#include <mutex>
7373

7474
#include "Adafruit_GFX.h"
75-
#include "pixeltypes.h"
7675
#include "crgbw.h"
76+
#include "pixeltypes.h"
7777

7878
// Calculates a weight for anti-aliasing in Wu's algorithm.
7979
constexpr static inline uint8_t WU_WEIGHT(uint8_t a, uint8_t b)

include/iservice.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include "globals.h"
4+
35
//+--------------------------------------------------------------------------
46
//
57
// File: iservice.h

include/ledstripeffect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
//---------------------------------------------------------------------------
3232

3333
#include "globals.h"
34+
#include "crgbw.h"
3435
#include "effects.h"
3536
#include "hashing.h"
3637
#include "jsonserializer.h"
37-
#include "crgbw.h"
3838

3939
#include <functional>
4040
#include <memory>

include/pixelformat.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@
3939
//
4040
//---------------------------------------------------------------------------
4141

42-
#include <cstdint>
43-
#include <cstddef>
42+
#include "globals.h"
43+
4444
#include <algorithm>
45+
#include <cstddef>
46+
#include <cstdint>
4547

46-
#include "pixeltypes.h" // FastLED CRGB
4748
#include "crgbw.h" // CRGBW + SplitByCct helper
4849
#include "deviceconfig.h" // DeviceConfig::WS281xColorOrder
50+
#include "pixeltypes.h" // FastLED CRGB
4951

5052
// ---------------------------------------------------------------------
5153
// Abstract base

include/webserver.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@
4343

4444
#if ENABLE_WEBSERVER
4545

46-
#include <ArduinoJson.h>
47-
#include <ESPAsyncWebServer.h>
4846
#include <atomic>
47+
#include <ESPAsyncWebServer.h>
4948
#include <map>
5049

5150
#include "deviceconfig.h"

include/ws281xgfx.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333

3434
#include "globals.h"
3535

36-
#include "gfxbase.h"
3736
#include <mutex>
3837

38+
#include "gfxbase.h"
39+
3940
class DeviceConfig;
4041

4142
// WS281xGfx

platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ build_type = debug
3636
upload_speed = 921600
3737
monitor_speed = 115200
3838
build_flags = -std=gnu++2a
39-
-g3
39+
-g
4040
-Ofast
4141
-ffunction-sections
4242
-fdata-sections
43-
-include string.h
4443
build_src_flags = -Wformat=2 ; Warnings for our code only, excluding libraries
4544
-Wformat-truncation
4645
-Wstack-usage=4096
46+
-g3
4747

4848
# Exclude libraries that we don't control from 'pio check'.
4949
# format is error number(optional :path_with_wildcards(optional :line_number))

src/deviceconfig.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@
3030

3131
#include "globals.h"
3232

33-
#include <HTTPClient.h>
3433
#include <algorithm>
3534
#include <array>
3635
#include <driver/gpio.h>
36+
#include <HTTPClient.h>
3737
#include <memory>
3838
#include <optional>
39-
#include <UrlEncode.h>
4039

4140
#include "deviceconfig.h"
4241
#include "effectmanager.h"
4342
#include "jsonserializer.h"
4443
#include "systemcontainer.h"
44+
#include "UrlEncode.h"
4545

4646
extern const char timezones_start[] asm("_binary_config_timezones_json_start");
4747

src/ledstripeffect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#include "ledstripeffect.h"
3333

3434
#include <algorithm>
35-
#include <cstring>
3635
#include <cstdlib>
36+
#include <cstring>
3737
#include <iterator>
3838
#include <stdexcept>
3939

0 commit comments

Comments
 (0)