From 2e2cbb7db451e2b4ad9e422d57034e2255a274b0 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 5 Oct 2024 21:40:49 +0200 Subject: [PATCH] Don't use std::isalnum for isBase64Char Fixes #356 Signed-off-by: falkTX --- distrho/extra/Base64.hpp | 80 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 74 insertions(+), 6 deletions(-) diff --git a/distrho/extra/Base64.hpp b/distrho/extra/Base64.hpp index d3eed6bee..60787169e 100644 --- a/distrho/extra/Base64.hpp +++ b/distrho/extra/Base64.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2016 Filipe Coelho + * Copyright (C) 2012-2024 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -19,7 +19,6 @@ #include "../DistrhoUtils.hpp" -#include #include // ----------------------------------------------------------------------- @@ -55,7 +54,7 @@ #ifndef DOXYGEN namespace DistrhoBase64Helpers { -static const char* const kBase64Chars = +static constexpr const char* const kBase64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; @@ -63,7 +62,7 @@ static const char* const kBase64Chars = static inline uint8_t findBase64CharIndex(const char c) { - static const uint8_t kBase64CharsLen(static_cast(std::strlen(kBase64Chars))); + static const uint8_t kBase64CharsLen = static_cast(std::strlen(kBase64Chars)); for (uint8_t i=0; i