string.h: rename MRB_STR_EMBED_LEN_BITS (use plurality for bit width)

This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-01-08 14:35:54 +09:00
parent 8c184d4566
commit 0098654e1f
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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 */