diff options
author | David Robillard <d@drobilla.net> | 2020-08-15 20:02:09 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-08 23:23:05 -0500 |
commit | 5e95d04014e07013fba6f04d32e7808c6ea9db1c (patch) | |
tree | a4642453bb48ce7246ba6d6528b9793d4d3dadd0 /src | |
parent | badd13ca1dd487a9327481d0f709741ba2127917 (diff) | |
download | serd-5e95d04014e07013fba6f04d32e7808c6ea9db1c.tar.gz serd-5e95d04014e07013fba6f04d32e7808c6ea9db1c.tar.bz2 serd-5e95d04014e07013fba6f04d32e7808c6ea9db1c.zip |
Remove unnecessary parameter from read_LANGTAG()
Diffstat (limited to 'src')
-rw-r--r-- | src/n3.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -641,26 +641,27 @@ read_PN_PREFIX(SerdReader* reader, SerdNode* dest) } static SerdStatus -read_LANGTAG(SerdReader* reader, SerdNode** dest) +read_LANGTAG(SerdReader* reader) { int c = peek_byte(reader); if (!is_alpha(c)) { return r_err(reader, SERD_ERR_BAD_SYNTAX, "unexpected `%c'\n", c); } - if (!(*dest = push_node(reader, SERD_LITERAL, "", 0))) { + SerdNode* node = push_node(reader, SERD_LITERAL, "", 0); + if (!node) { return SERD_ERR_OVERFLOW; } SerdStatus st = SERD_SUCCESS; - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, c))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, c))); while ((c = peek_byte(reader)) && is_alpha(c)) { - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, c))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, c))); } while (peek_byte(reader) == '-') { - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, '-'))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, '-'))); while ((c = peek_byte(reader)) && (is_alpha(c) || is_digit(c))) { - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, c))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, c))); } } return SERD_SUCCESS; @@ -900,12 +901,11 @@ read_literal(SerdReader* reader, SerdNode** dest, bool* ate_dot) } SerdNode* datatype = NULL; - SerdNode* lang = NULL; switch (peek_byte(reader)) { case '@': eat_byte_safe(reader, '@'); (*dest)->flags |= SERD_HAS_LANGUAGE; - if ((st = read_LANGTAG(reader, &lang))) { + if ((st = read_LANGTAG(reader))) { return r_err(reader, st, "bad literal\n"); } break; |