aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradnano <me@adnano.co>2023-12-28 11:26:38 -0500
committeradnano <me@adnano.co>2023-12-28 11:26:38 -0500
commitd77ff0e64de510cf0aaec92107339f5b8c997702 (patch)
tree78e8365a11825282a4baa47a615bd66e7252eee6
parentad40b9173cf2d9596d2747be7c1c3210f3dcb12f (diff)
downloadwmenu-d77ff0e64de510cf0aaec92107339f5b8c997702.tar.gz
Fix various type issues
-rw-r--r--main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.c b/main.c
index 056e0a3..c7d3c34 100644
--- a/main.c
+++ b/main.c
@@ -938,12 +938,12 @@ void insert(struct menu_state *state, const char *s, ssize_t n) {
match(state);
}
-char * fstrstr(struct menu_state *state, const char *s, const char *sub) {
+const char * fstrstr(struct menu_state *state, const char *s, const char *sub) {
size_t len;
for(len = strlen(sub); *s; s++)
if(!state->fstrncmp(s, sub, len))
- return (char *)s;
+ return s;
return NULL;
}
@@ -1116,12 +1116,12 @@ bool parse_color(const char *color, uint32_t *result) {
if (color[0] == '#') {
++color;
}
- int len = strlen(color);
+ size_t len = strlen(color);
if ((len != 6 && len != 8) || !isxdigit(color[0]) || !isxdigit(color[1])) {
return false;
}
char *ptr;
- uint32_t parsed = strtoul(color, &ptr, 16);
+ uint32_t parsed = (uint32_t)strtoul(color, &ptr, 16);
if (*ptr != '\0') {
return false;
}
@@ -1225,7 +1225,7 @@ int main(int argc, char **argv) {
{ wl_display_get_fd(state.display), POLLIN },
{ state.repeat_timer, POLLIN },
};
- const int nfds = sizeof(fds) / sizeof(*fds);
+ const size_t nfds = sizeof(fds) / sizeof(*fds);
while (state.run) {
errno = 0;