Clean up global variables namespace, save a few 100 bytes of flash (#5368)
* reduce scope of some variables to "static" these are not used anywhere else. Making them static avoid name conflicts, cleans up the global scope and in some cases allows for better optimization by the compiler. * remove unused reference ``tz``from analog clock usermod * side-catch: remove two "local var shadows global var" warnings * reduce scope of functions declared globally, but not used anywhere else Safe to make static * declared in fcn_declare.h, only used locally in one file * not declared in fcn_declare.h, only used locally * HUB75 small optimization make bit array functions "static inline" -> better for optimization, saves some bytes because the compiler does not need to preserve a non-inline function copy for external references. * a few more static functions as suggested by the rabbit.
This commit is contained in:
@@ -19,6 +19,9 @@
|
||||
#include "html_cpal.h"
|
||||
#include "html_edit.h"
|
||||
|
||||
// forward declarations
|
||||
static void createEditHandler();
|
||||
|
||||
|
||||
// define flash strings once (saves flash memory)
|
||||
static const char s_redirecting[] PROGMEM = "Redirecting...";
|
||||
@@ -222,7 +225,7 @@ static void handleUpload(AsyncWebServerRequest *request, const String& filename,
|
||||
|
||||
static const char _edit_htm[] PROGMEM = "/edit.htm";
|
||||
|
||||
void createEditHandler() {
|
||||
static void createEditHandler() {
|
||||
if (editHandler != nullptr) server.removeHandler(editHandler);
|
||||
|
||||
editHandler = &server.on(F("/edit"), static_cast<WebRequestMethod>(HTTP_GET), [](AsyncWebServerRequest *request) {
|
||||
|
||||
Reference in New Issue
Block a user