From a59a68b6f553f7f813db4a43ca1b4fd89ee37a1e Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Tue, 2 Jul 2024 11:09:40 +0800 Subject: [PATCH] Update str.h --- include/pocketpy/common/str.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/pocketpy/common/str.h b/include/pocketpy/common/str.h index 0ed6dbd8..aab9a64f 100644 --- a/include/pocketpy/common/str.h +++ b/include/pocketpy/common/str.h @@ -16,13 +16,11 @@ typedef struct c11_sv{ } c11_sv; /* string */ -typedef struct c11_bytes{ +typedef struct c11_string{ + // int size | char[] | '\0' int size; - const char data[]; -} c11_bytes; - -// int size | char[] | '\0' -typedef c11_bytes c11_string; + const char data[]; // flexible array member +} c11_string; int c11_sv__cmp(c11_sv self, c11_sv other); int c11_sv__cmp2(c11_sv self, const char* other, int size);