diff --git a/lua_cjson.c b/lua_cjson.c index f1aa4ad..f9348e5 100644 --- a/lua_cjson.c +++ b/lua_cjson.c @@ -826,7 +826,8 @@ static void json_append_newline_and_indent(strbuf_t *json, json_config_t *cfg, i static void json_append_array(lua_State *l, json_config_t *cfg, int current_depth, strbuf_t *json, int array_length, int raw) { - int comma, i, json_pos, err; + int comma, i, err; + size_t json_pos; int has_items = 0; strbuf_append_char(json, '['); @@ -1024,7 +1025,8 @@ static int cmp_key_entries(const void *a, const void *b) static void json_append_object(lua_State *l, json_config_t *cfg, int current_depth, strbuf_t *json) { - int comma, keytype, json_pos, err; + int comma, keytype, err; + size_t json_pos; int has_items = 0; keybuf_t *keybuf; key_entry_t key_entry; diff --git a/strbuf.h b/strbuf.h index d77e0f4..1f2cddc 100644 --- a/strbuf.h +++ b/strbuf.h @@ -64,7 +64,7 @@ static char *strbuf_string(strbuf_t *s, size_t *len); static void strbuf_ensure_empty_length(strbuf_t *s, size_t len); static char *strbuf_empty_ptr(strbuf_t *s); static void strbuf_extend_length(strbuf_t *s, size_t len); -static void strbuf_set_length(strbuf_t *s, int len); +static void strbuf_set_length(strbuf_t *s, size_t len); /* Update */ static void strbuf_append_mem(strbuf_t *s, const char *c, size_t len); @@ -101,7 +101,7 @@ static inline char *strbuf_empty_ptr(strbuf_t *s) return s->buf + s->length; } -static inline void strbuf_set_length(strbuf_t *s, int len) +static inline void strbuf_set_length(strbuf_t *s, size_t len) { s->length = len; }