aboutsummaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-06-10 22:39:55 -0300
committerGitHub <noreply@github.com>2024-06-11 09:39:55 +0800
commitc92ecda53337490633c95e6ae00e322dc9ad1fb8 (patch)
tree47185f92938547b2c70fcf00b02c9acef772ac9c /strbuf.c
parentd20576d5cef3d7aa3b6d62db7aee9d9d5f03cc70 (diff)
downloadlua-cjson-c92ecda53337490633c95e6ae00e322dc9ad1fb8.tar.gz
lua-cjson-c92ecda53337490633c95e6ae00e322dc9ad1fb8.tar.bz2
lua-cjson-c92ecda53337490633c95e6ae00e322dc9ad1fb8.zip
feature: Lua 5.3 + 5.4 integer support, with CI and conflicts fixed.
Co-Authored-By: Hisham Muhammad <hisham@gobolinux.org> Co-authored-by: Mark Pulford <mark@kyne.com.au> Co-authored-by: ichenq <ichenq@gmail.com> Co-authored-by: Cloud Wu <cloudwu@gmail.com> Co-authored-by: caijietao <t0350.prog@gmail.com> Co-authored-by: actboy168 <actboy168@gmail.com> Co-authored-by: wudeng <wudeng256@gmail.com> Co-authored-by: caiyiheng <rangercyh@qq.com>
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/strbuf.c b/strbuf.c
index 2dc30be..73cd9b8 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -59,7 +59,7 @@ void strbuf_init(strbuf_t *s, size_t len)
59 s->reallocs = 0; 59 s->reallocs = 0;
60 s->debug = 0; 60 s->debug = 0;
61 61
62 s->buf = malloc(size); 62 s->buf = (char *)malloc(size);
63 if (!s->buf) 63 if (!s->buf)
64 die("Out of memory"); 64 die("Out of memory");
65 65
@@ -70,7 +70,7 @@ strbuf_t *strbuf_new(size_t len)
70{ 70{
71 strbuf_t *s; 71 strbuf_t *s;
72 72
73 s = malloc(sizeof(strbuf_t)); 73 s = (strbuf_t*)malloc(sizeof(strbuf_t));
74 if (!s) 74 if (!s)
75 die("Out of memory"); 75 die("Out of memory");
76 76
@@ -169,7 +169,7 @@ void strbuf_resize(strbuf_t *s, size_t len)
169 } 169 }
170 170
171 s->size = newsize; 171 s->size = newsize;
172 s->buf = realloc(s->buf, s->size); 172 s->buf = (char *)realloc(s->buf, s->size);
173 if (!s->buf) 173 if (!s->buf)
174 die("Out of memory, len: %zu", len); 174 die("Out of memory, len: %zu", len);
175 s->reallocs++; 175 s->reallocs++;