Remove some warnings

fix-mingw
Nakidai 2023-11-25 00:11:34 +03:00
parent 970fb66db8
commit 9c54a483bd
3 changed files with 11 additions and 2 deletions

View File

@ -9,6 +9,10 @@ typedef struct input_args_t
bool *alive; bool *alive;
} InputArgs; } InputArgs;
#ifdef _WIN32
void input(void *vargp);
#else
void *input(void *vargp); void *input(void *vargp);
#endif
#endif /* __INPUT_H__ */ #endif /* __INPUT_H__ */

View File

@ -30,7 +30,11 @@ int getch(void)
} }
#endif #endif
#ifdef _WIN32
void input(void *vargp)
#else
void *input(void *vargp) void *input(void *vargp)
#endif
{ {
int *out = ((InputArgs *)vargp)->out; int *out = ((InputArgs *)vargp)->out;
bool *alive = ((InputArgs *)vargp)->alive; bool *alive = ((InputArgs *)vargp)->alive;
@ -39,5 +43,7 @@ void *input(void *vargp)
{ {
*out = getch(); *out = getch();
} }
#ifndef _WIN32
return NULL; return NULL;
#endif
} }

View File

@ -47,10 +47,9 @@ void resetCoordinates(void)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
srand(time(NULL)); srand((unsigned int)time(NULL));
Player *player = playerCreate(DOWN, DEFX, DEFY, 0); Player *player = playerCreate(DOWN, DEFX, DEFY, 0);
Screen *screen = screenCreate(SIZE, SIZE, ' '); Screen *screen = screenCreate(SIZE, SIZE, ' ');
PlayerNode *node;
int i; int i;
int head_x, head_y; int head_x, head_y;
Food food = generateFood(player); Food food = generateFood(player);