From 700b5d587015faa396b1149525b084960d6524c3 Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Sat, 15 Feb 2020 22:19:55 -0500 Subject: Replace small integers in size_t with uint --- url.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'url.c') diff --git a/url.c b/url.c index 43c2ee9..64fdd8b 100644 --- a/url.c +++ b/url.c @@ -59,7 +59,7 @@ static void compile(void) { } struct URL { - size_t id; + uint id; char *nick; char *url; }; @@ -71,7 +71,7 @@ static struct { } ring; static_assert(!(Cap & (Cap - 1)), "Cap is power of two"); -static void push(size_t id, const char *nick, const char *str, size_t len) { +static void push(uint id, const char *nick, const char *str, size_t len) { struct URL *url = &ring.urls[ring.len++ % Cap]; free(url->nick); free(url->url); @@ -85,7 +85,7 @@ static void push(size_t id, const char *nick, const char *str, size_t len) { if (!url->url) err(EX_OSERR, "strndup"); } -void urlScan(size_t id, const char *nick, const char *mesg) { +void urlScan(uint id, const char *nick, const char *mesg) { if (!mesg) return; compile(); regmatch_t match = {0}; @@ -175,8 +175,8 @@ static void urlCopy(const char *url) { _exit(EX_CONFIG); } -void urlOpenCount(size_t id, size_t count) { - for (size_t i = 1; i <= Cap; ++i) { +void urlOpenCount(uint id, uint count) { + for (uint i = 1; i <= Cap; ++i) { const struct URL *url = &ring.urls[(ring.len - i) % Cap]; if (!url->url) break; if (url->id != id) continue; @@ -185,8 +185,8 @@ void urlOpenCount(size_t id, size_t count) { } } -void urlOpenMatch(size_t id, const char *str) { - for (size_t i = 1; i <= Cap; ++i) { +void urlOpenMatch(uint id, const char *str) { + for (uint i = 1; i <= Cap; ++i) { const struct URL *url = &ring.urls[(ring.len - i) % Cap]; if (!url->url) break; if (url->id != id) continue; @@ -197,8 +197,8 @@ void urlOpenMatch(size_t id, const char *str) { } } -void urlCopyMatch(size_t id, const char *str) { - for (size_t i = 1; i <= Cap; ++i) { +void urlCopyMatch(uint id, const char *str) { + for (uint i = 1; i <= Cap; ++i) { const struct URL *url = &ring.urls[(ring.len - i) % Cap]; if (!url->url) break; if (url->id != id) continue; -- cgit 1.4.1-2-gfad0