From 0098654e1f6522305a4f36e46a8a2104aefa6b63 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 8 Jan 2025 14:35:54 +0900 Subject: [PATCH] string.h: rename MRB_STR_EMBED_LEN_BITS (use plurality for bit width) --- include/mruby/string.h | 4 ++-- src/string.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/mruby/string.h b/include/mruby/string.h index 91454f37d..4999c7308 100644 --- a/include/mruby/string.h +++ b/include/mruby/string.h @@ -48,8 +48,8 @@ struct RStringEmbed { #define MRB_STR_TYPE_MASK 15 #define MRB_STR_EMBED_LEN_SHIFT 6 -#define MRB_STR_EMBED_LEN_BIT 5 -#define MRB_STR_EMBED_LEN_MASK (((1 << MRB_STR_EMBED_LEN_BIT) - 1) << MRB_STR_EMBED_LEN_SHIFT) +#define MRB_STR_EMBED_LEN_BITS 5 +#define MRB_STR_EMBED_LEN_MASK (((1 << MRB_STR_EMBED_LEN_BITS) - 1) << MRB_STR_EMBED_LEN_SHIFT) #define MRB_STR_BINARY 16 #define MRB_STR_SINGLE_BYTE 32 diff --git a/src/string.c b/src/string.c index 2f29449db..bb9402355 100644 --- a/src/string.c +++ b/src/string.c @@ -3187,7 +3187,7 @@ mrb_init_string(mrb_state *mrb) { struct RClass *s; - mrb_static_assert(RSTRING_EMBED_LEN_MAX < (1 << MRB_STR_EMBED_LEN_BIT), + mrb_static_assert(RSTRING_EMBED_LEN_MAX < (1 << MRB_STR_EMBED_LEN_BITS), "pointer size too big for embedded string"); mrb->string_class = s = mrb_define_class_id(mrb, MRB_SYM(String), mrb->object_class); /* 15.2.10 */