diff options
author | David Robillard <d@drobilla.net> | 2017-06-29 12:53:23 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-06-30 10:29:33 -0400 |
commit | 902d171c5e79561a534c3cbb9cc547cd1fadeab7 (patch) | |
tree | 20b2e3bdadb7e390ab33d5e1163ebdfe8b6280cf /src/uri.c | |
parent | 195e4bcff3c4dfd3fe8bbf0df57d53ce89ca99e8 (diff) | |
download | serd-902d171c5e79561a534c3cbb9cc547cd1fadeab7.tar.gz serd-902d171c5e79561a534c3cbb9cc547cd1fadeab7.tar.bz2 serd-902d171c5e79561a534c3cbb9cc547cd1fadeab7.zip |
Fix various clang-tidy issues
Diffstat (limited to 'src/uri.c')
-rw-r--r-- | src/uri.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -137,9 +137,9 @@ serd_uri_dump(const SerdURI* uri, FILE* file) SERD_API SerdStatus -serd_uri_parse(const uint8_t* utf8, SerdURI* uri) +serd_uri_parse(const uint8_t* utf8, SerdURI* out) { - *uri = SERD_URI_NULL; + *out = SERD_URI_NULL; const uint8_t* ptr = utf8; @@ -155,8 +155,8 @@ serd_uri_parse(const uint8_t* utf8, SerdURI* uri) ptr = utf8; goto path; // Relative URI (starts with path by definition) case ':': - uri->scheme.buf = utf8; - uri->scheme.len = (ptr++) - utf8; + out->scheme.buf = utf8; + out->scheme.len = (ptr++) - utf8; goto maybe_authority; // URI with scheme case '+': case '-': case '.': continue; @@ -175,14 +175,14 @@ serd_uri_parse(const uint8_t* utf8, SerdURI* uri) maybe_authority: if (*ptr == '/' && *(ptr + 1) == '/') { ptr += 2; - uri->authority.buf = ptr; + out->authority.buf = ptr; for (uint8_t c; (c = *ptr) != '\0'; ++ptr) { switch (c) { case '/': goto path; case '?': goto query; case '#': goto fragment; default: - ++uri->authority.len; + ++out->authority.len; } } } @@ -197,14 +197,14 @@ path: case '\0': goto end; default: break; } - uri->path.buf = ptr; - uri->path.len = 0; + out->path.buf = ptr; + out->path.len = 0; for (uint8_t c; (c = *ptr) != '\0'; ++ptr) { switch (c) { case '?': goto query; case '#': goto fragment; default: - ++uri->path.len; + ++out->path.len; } } @@ -214,13 +214,13 @@ path: */ query: if (*ptr == '?') { - uri->query.buf = ++ptr; + out->query.buf = ++ptr; for (uint8_t c; (c = *ptr) != '\0'; ++ptr) { switch (c) { case '#': goto fragment; default: - ++uri->query.len; + ++out->query.len; } } } @@ -231,16 +231,16 @@ query: */ fragment: if (*ptr == '#') { - uri->fragment.buf = ptr; + out->fragment.buf = ptr; while (*ptr++ != '\0') { - ++uri->fragment.len; + ++out->fragment.len; } } end: #ifdef URI_DEBUG fprintf(stderr, "PARSE URI <%s>\n", utf8); - serd_uri_dump(uri, stderr); + serd_uri_dump(out, stderr); fprintf(stderr, "\n"); #endif |