summary refs log tree commit diff
path: root/url.c
diff options
context:
space:
mode:
authorC. McEnroe2020-02-15 22:19:55 -0500
committerC. McEnroe2020-02-15 22:19:55 -0500
commit700b5d587015faa396b1149525b084960d6524c3 (patch)
tree7452916a9e52a22f480e35ac4ebc401535efd81b /url.c
parent83df94b359c06545cb8f5db9dd2229d0ae1f5914 (diff)
Replace small integers in size_t with uint
Diffstat (limited to 'url.c')
-rw-r--r--url.c18
1 files changed, 9 insertions, 9 deletions
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;