Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fa9572d33a |
@@ -1852,6 +1852,7 @@ static fx_result parse_array_inline(struct ctx *ctx, fx_value *result)
|
||||
|
||||
static fx_result parse_value(struct ctx *ctx, fx_value *result)
|
||||
{
|
||||
|
||||
struct token *tok = peek_token(ctx);
|
||||
if (!tok) {
|
||||
return FX_RESULT_ERR(BAD_FORMAT);
|
||||
|
||||
+1
-21
@@ -25,10 +25,6 @@ static enum fx_status iterator_set_status(
|
||||
|
||||
const fx_iterator *fx_iterator_begin(const fx_iterable *it)
|
||||
{
|
||||
if (!it) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FX_CLASS_DISPATCH_VIRTUAL_0(
|
||||
fx_iterable,
|
||||
FX_TYPE_ITERABLE,
|
||||
@@ -39,19 +35,11 @@ const fx_iterator *fx_iterator_begin(const fx_iterable *it)
|
||||
|
||||
enum fx_status fx_iterator_get_status(const fx_iterator *it)
|
||||
{
|
||||
if (!it) {
|
||||
return FX_ERR_NO_DATA;
|
||||
}
|
||||
|
||||
FX_CLASS_DISPATCH_STATIC_0(FX_TYPE_ITERATOR, iterator_get_status, it);
|
||||
}
|
||||
|
||||
enum fx_status fx_iterator_set_status(const fx_iterator *it, fx_status status)
|
||||
{
|
||||
if (!it) {
|
||||
return FX_ERR_NO_DATA;
|
||||
}
|
||||
|
||||
FX_CLASS_DISPATCH_STATIC(
|
||||
FX_TYPE_ITERATOR,
|
||||
iterator_set_status,
|
||||
@@ -61,10 +49,6 @@ enum fx_status fx_iterator_set_status(const fx_iterator *it, fx_status status)
|
||||
|
||||
enum fx_status fx_iterator_move_next(const fx_iterator *it)
|
||||
{
|
||||
if (!it) {
|
||||
return FX_ERR_NO_DATA;
|
||||
}
|
||||
|
||||
enum fx_status status = FX_ERR_NOT_SUPPORTED;
|
||||
|
||||
fx_iterator_class *iface
|
||||
@@ -81,7 +65,7 @@ enum fx_status fx_iterator_move_next(const fx_iterator *it)
|
||||
|
||||
const fx_value *fx_iterator_get_value(const fx_iterator *it)
|
||||
{
|
||||
if (!it) {
|
||||
if (fx_iterator_get_status(it) != FX_SUCCESS) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -95,10 +79,6 @@ const fx_value *fx_iterator_get_value(const fx_iterator *it)
|
||||
|
||||
fx_status fx_iterator_erase(fx_iterator *it)
|
||||
{
|
||||
if (!it) {
|
||||
return FX_ERR_NO_DATA;
|
||||
}
|
||||
|
||||
enum fx_status status = FX_ERR_NOT_SUPPORTED;
|
||||
|
||||
fx_iterator_class *iface
|
||||
|
||||
@@ -200,19 +200,12 @@ enum fx_status fx_object_get_data(
|
||||
|
||||
struct _fx_object *fx_object_ref(struct _fx_object *p)
|
||||
{
|
||||
if (p) {
|
||||
p->obj_ref++;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
void fx_object_unref(struct _fx_object *p)
|
||||
{
|
||||
if (!p) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p->obj_ref > 1) {
|
||||
p->obj_ref--;
|
||||
return;
|
||||
|
||||
+1
-1
@@ -301,7 +301,7 @@ static fx_string *string_duplicate(const struct fx_string_p *str)
|
||||
const char *src = string_ptr(str);
|
||||
char *dst = string_ptr(new_str_p);
|
||||
|
||||
memcpy(dst, src, str->s_len + 1);
|
||||
memcpy(dst, src, str->s_len);
|
||||
new_str_p->s_len = str->s_len;
|
||||
new_str_p->s_codepoints = str->s_codepoints;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user