summaryrefslogtreecommitdiffhomepage
path: root/src/pattern.c
diff options
context:
space:
mode:
authorSean Kurtz <seankurtz75@gmail.com>2026-11-25 12:52:38 -0600
committerSean Kurtz <seankurtz75@gmail.com>2026-11-25 12:52:38 -0600
commite569552eb9766bc663871b6f3cb203a77e83503c (patch)
treea3bd6f994a6c61aae2430e51de762880b002be03 /src/pattern.c
parent5d830cb1c04da59553d3af848340162a7be9fa58 (diff)
downloadzash-e569552eb9766bc663871b6f3cb203a77e83503c.tar.gz
C23: constexpr internal linkage, naming and trailing commas; clangd at C23
A constexpr at file scope has external linkage, so the CSI offsets and CSI_MAX_CALLS now say static. The naming check gets the C23 spellings wrap the check itself: typed constants keep the macro case, and a local static constexpr table keeps the variable case. .clangd says -std=c23, which it still did not, so the editor could not read constexpr at all.
Diffstat (limited to 'src/pattern.c')
-rw-r--r--src/pattern.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pattern.c b/src/pattern.c
index a60f643..0dabc15 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -30,9 +30,11 @@ static int index_in(const char *set, unsigned char c) {
* alphabet. Any other range is by character code.
*/
static bool in_range(unsigned char lo, unsigned char hi, unsigned char c) {
- static const char *const sets[] = {"abcdefghijklmnopqrstuvwxyz",
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
- "0123456789"};
+ static const char *const sets[] = {
+ "abcdefghijklmnopqrstuvwxyz",
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ "0123456789",
+ };
for (size_t i = 0; i < ARRAY_LEN(sets); i++) {
int a = index_in(sets[i], lo);
int b = index_in(sets[i], hi);