From 1692a2adf49d06b357731ab73e75e3e3562e7f74 Mon Sep 17 00:00:00 2001 From: pablo2048 Date: Sat, 20 May 2023 11:52:41 +0200 Subject: [PATCH] Upravy na zaklade clang-tidy --- src/encString.cpp | 13 +++++++------ src/encString.hpp | 5 +---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/encString.cpp b/src/encString.cpp index 68020e9..2cf06d0 100644 --- a/src/encString.cpp +++ b/src/encString.cpp @@ -13,7 +13,7 @@ bool isBase64(const char *p) return false; do { c = *p; - if (isalnum(c)) // alphanumberics are OK + if (isalnum(c)) // alphanumerics are OK continue; if (c == '/' || c == '+' || c == '=') // + or / or = is OK. continue; @@ -31,7 +31,7 @@ void strEncode(String &str) char c; unsigned int i; uint32_t cid = ESP_getChipId(); - uint32_t *pkey = (uint32_t *)&key[0]; + uint32_t* pkey = (uint32_t *)&key[0]; uint8_t data[str.length()]; *pkey = cid; @@ -54,11 +54,8 @@ void strDecode(String &str) const char *src = &str[0]; uint8_t key[4]; - unsigned int enciphidx = 0; - unsigned int i; - uint8_t b; uint32_t cid = ESP_getChipId(); - uint32_t *pkey = (uint32_t *)&key[0]; + uint32_t* pkey = (uint32_t *)&key[0]; uint8_t data[str.length()]; String result = F(""); @@ -66,6 +63,10 @@ void strDecode(String &str) unsigned int clen = base64_decode_chars(src, str.length(), (char *)data); if (0 != clen) { + unsigned int enciphidx = 0; + unsigned int i; + uint8_t b; + *pkey = cid; for (i = 0; i < clen; i++) { b = data[i]; diff --git a/src/encString.hpp b/src/encString.hpp index f1835fa..7266906 100644 --- a/src/encString.hpp +++ b/src/encString.hpp @@ -1,5 +1,4 @@ -#ifndef _ENCSTRING_HPP_ -#define _ENCSTRING_HPP_ +#pragma once #include /** @@ -24,5 +23,3 @@ void strDecode(String &str); * @return false Retezec neni kodovany pomoci Base64 */ bool isBase64(const char *p); - -#endif