From 2ce7cbf7725fe37b9e9cfcccb2fc2cfdb7947f84 Mon Sep 17 00:00:00 2001 From: Pablo2048 Date: Mon, 29 Jul 2024 16:14:38 +0200 Subject: [PATCH] Prejmenovani TRACE_SYSVARS na DEBUG_SYSVARS (kompatibilita) --- src/sysvars.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/sysvars.cpp b/src/sysvars.cpp index ad8970c..ba05f87 100644 --- a/src/sysvars.cpp +++ b/src/sysvars.cpp @@ -10,8 +10,8 @@ #include #include -#ifndef TRACE_SYSVARS -# define TRACE_SYSVARS 0 +#ifndef DEBUG_SYSVARS +# define DEBUG_SYSVARS 0 #endif #if not defined(SYSVAR_FILE) @@ -26,19 +26,19 @@ T svGetV(const String & name, const T deflt) File f = USEDFS.open(F(SYSVAR_FILE), "r"); if (f) { JsonDocument doc; - DeserializationError err = deserializeJson(doc, f); + const DeserializationError err = deserializeJson(doc, f); if (err) { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: Deserialize error '%s'", err.c_str()); // wrong JSON file (malformed) + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: Deserialize error '%s'", err.c_str()); // wrong JSON file (malformed) } else { if (!doc.containsKey(name)) { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: Key '%s' not found", name.c_str()); + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: Key '%s' not found", name.c_str()); } else { rv = doc[name].as(); } } } else { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: File not found"); + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: File not found"); } return rv; } @@ -51,19 +51,19 @@ T svGetVFile(const String & name, const String & fname, const T deflt) if (f) { JsonDocument doc; - DeserializationError err = deserializeJson(doc, f); + const DeserializationError err = deserializeJson(doc, f); if (err) { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: Deserialize error '%s'", err.c_str()); // wrong JSON file (malformed) + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: Deserialize error '%s'", err.c_str()); // wrong JSON file (malformed) } else { if (!doc.containsKey(name)) { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: Key '%s' not found", name.c_str()); + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: Key '%s' not found", name.c_str()); } else { rv = doc[name].as(); } } } else { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: File not found '%s'", fname.c_str()); + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: File not found '%s'", fname.c_str()); } return rv; } @@ -86,7 +86,7 @@ int svSetV(const String & name, T value) File f = USEDFS.open(F(SYSVAR_FILE), "r"); if (f) { - DeserializationError err = deserializeJson(doc, f); + const DeserializationError err = deserializeJson(doc, f); if (err) { res = SV_DESERIALIZE_ERROR; // wrong (malformed) JSON file } @@ -123,7 +123,7 @@ int svSetVFile(const String & name, T value, const String & fname) File f = USEDFS.open(fname, "r"); if (f) { - DeserializationError err = deserializeJson(doc, f); + const DeserializationError err = deserializeJson(doc, f); if (err) { res = SV_DESERIALIZE_ERROR; // wrong (malformed) JSON file }