From 55ce6808cd99ecbb06bd9b0fac181ed2c3bf15ff Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 12 Aug 2022 15:21:59 +0200 Subject: fix some minor warnings --- src/kernel/arch/amd64/driver/pata.c | 2 +- src/kernel/arch/amd64/driver/video.c | 2 +- src/user/app/dvd/dvd.c | 4 ++-- src/user/lib/string.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/kernel/arch/amd64/driver/pata.c b/src/kernel/arch/amd64/driver/pata.c index a21fc2b..b4ec46c 100644 --- a/src/kernel/arch/amd64/driver/pata.c +++ b/src/kernel/arch/amd64/driver/pata.c @@ -7,7 +7,7 @@ #include #include -const int root_id = 100; +static const int root_id = 100; static void accept(struct vfs_request *req); static struct vfs_backend backend = BACKEND_KERN(accept); diff --git a/src/kernel/arch/amd64/driver/video.c b/src/kernel/arch/amd64/driver/video.c index ed4b971..c1aabe1 100644 --- a/src/kernel/arch/amd64/driver/video.c +++ b/src/kernel/arch/amd64/driver/video.c @@ -37,7 +37,7 @@ static int handle(struct vfs_request *req) { } case VFSOP_WRITE: - if ((long)req->id != H_FB) { + if ((long __force)req->id != H_FB) { return -1; } fs_normslice(&req->offset, &req->input.len, fb.size, false); diff --git a/src/user/app/dvd/dvd.c b/src/user/app/dvd/dvd.c index ed9778c..f880782 100644 --- a/src/user/app/dvd/dvd.c +++ b/src/user/app/dvd/dvd.c @@ -30,8 +30,8 @@ int main(void) { uint32_t col = 0x800000; for (;;) { - if (x + dx < 0 || x + dx + w >= fb.width ) dx *= -1; - if (y + dy < 0 || y + dy + h >= fb.height) dy *= -1; + if (x + dx < 0 || (size_t)(x + dx + w) >= fb.width) dx *= -1; + if (y + dy < 0 || (size_t)(y + dy + h) >= fb.height) dy *= -1; x += dx; y += dy; draw_rect(x, y, w, h, col++); diff --git a/src/user/lib/string.c b/src/user/lib/string.c index 92b2e51..a6ac75b 100644 --- a/src/user/lib/string.c +++ b/src/user/lib/string.c @@ -52,7 +52,7 @@ long strtol(const char *restrict s, char **restrict end, int base) { char *strchr(const char *s, int c) { while (*s) { - if (*s == c) return s; + if (*s == c) return (char*)s; s++; } return NULL; -- cgit v1.2.3