summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2023-03-12 09:20:15 -0500
committerBrian Smith <brian@dbsoft.org>2023-03-12 09:20:15 -0500
commit3089da7aeb84c02d7cd959a03eaaf88708eb1f83 (patch)
treefda6bbe2f681cddd51a0bcebd5aa1d974da2657b
parent16c5b95b9105dceea5268c3a5f1503e57005df6f (diff)
downloaduxp-3089da7aeb84c02d7cd959a03eaaf88708eb1f83.tar.gz
No issue - Use pre-C++17 static_assert() by adding reason for assert.
This fixes warnings with clang and build failures with Visual C versions prior to 2022.
-rw-r--r--xpcom/io/Base64.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/xpcom/io/Base64.cpp b/xpcom/io/Base64.cpp
index a93c78a7f3..ba53ea5b85 100644
--- a/xpcom/io/Base64.cpp
+++ b/xpcom/io/Base64.cpp
@@ -246,7 +246,7 @@ EncodeInputStream(nsIInputStream* aInputStream,
static const char kBase64URLAlphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
-static_assert(mozilla::ArrayLength(kBase64URLAlphabet) == 0x41);
+static_assert(mozilla::ArrayLength(kBase64URLAlphabet) == 0x41, "size of kBase64URLAlphabet must be 0x41");
// Maps an encoded character to a value in the Base64 URL alphabet, per
// RFC 4648, Table 2. Invalid input characters map to UINT8_MAX.
@@ -270,7 +270,7 @@ static const uint8_t kBase64URLDecodeTable[] = {
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, /* a - z */
255, 255, 255, 255, 255
};
-static_assert(mozilla::ArrayLength(kBase64URLDecodeTable) == 0x80);
+static_assert(mozilla::ArrayLength(kBase64URLDecodeTable) == 0x80, "size of kBase64URLDecodeTable must be 0x80");
bool
Base64URLCharToValue(char aChar, uint8_t* aValue) {