From 9c54a483bda5e5b2e21797b340446ceb0a91e42b Mon Sep 17 00:00:00 2001 From: Nakidai Date: Sat, 25 Nov 2023 00:11:34 +0300 Subject: [PATCH] Remove some warnings --- include/input.h | 4 ++++ src/input.c | 6 ++++++ src/main.c | 3 +-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/input.h b/include/input.h index fcb9e6f..d73a36a 100644 --- a/include/input.h +++ b/include/input.h @@ -9,6 +9,10 @@ typedef struct input_args_t bool *alive; } InputArgs; +#ifdef _WIN32 +void input(void *vargp); +#else void *input(void *vargp); +#endif #endif /* __INPUT_H__ */ diff --git a/src/input.c b/src/input.c index 192d566..f970dfb 100644 --- a/src/input.c +++ b/src/input.c @@ -30,7 +30,11 @@ int getch(void) } #endif +#ifdef _WIN32 +void input(void *vargp) +#else void *input(void *vargp) +#endif { int *out = ((InputArgs *)vargp)->out; bool *alive = ((InputArgs *)vargp)->alive; @@ -39,5 +43,7 @@ void *input(void *vargp) { *out = getch(); } +#ifndef _WIN32 return NULL; +#endif } diff --git a/src/main.c b/src/main.c index 52a2a30..f772ae6 100644 --- a/src/main.c +++ b/src/main.c @@ -47,10 +47,9 @@ void resetCoordinates(void) int main(int argc, char **argv) { - srand(time(NULL)); + srand((unsigned int)time(NULL)); Player *player = playerCreate(DOWN, DEFX, DEFY, 0); Screen *screen = screenCreate(SIZE, SIZE, ' '); - PlayerNode *node; int i; int head_x, head_y; Food food = generateFood(player);