From 7afb37889165d9efb4f12de9f299fe3d9ff0890c Mon Sep 17 00:00:00 2001 From: akagundu <david.akagunduz@gmail.com> Date: Fri, 22 Dec 2023 21:12:26 +0100 Subject: [PATCH] correction dautre warning --- main.h | 2 +- scene.c | 16 +++++++++------- scene.h | 10 +++++----- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/main.h b/main.h index 9a665a5..37bc429 100644 --- a/main.h +++ b/main.h @@ -20,6 +20,6 @@ struct PIXELS { typedef struct PIXELS PIXELS; -PIXELS gen_pastille(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,int longueur_serpent,int longueur_obstacle); +PIXELS gen_pastille(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,unsigned long longueur_serpent,unsigned long longueur_obstacle); #endif diff --git a/scene.c b/scene.c index 10a5056..68b40c7 100644 --- a/scene.c +++ b/scene.c @@ -16,12 +16,13 @@ int ArrondirPixel(int nombre) /* Calcule un arrondi du pixel pour pouvoir respec return arrondi; } -PIXELS gen_pastille(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,int longueur_serpent,int longueur_obstacle) +PIXELS gen_pastille(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,unsigned long longueur_serpent,unsigned long longueur_obstacle) /* nb_pastille = int nombre de pastille voulue , p_pastilles est un pointeur d'un tableau de pixels qui sont des pastilles*/ /*-Elles se génèrent à des endroits qui peuvent être les mêmes ou gêner le snake*/ { - int x_pastille,y_pastille,i; + int x_pastille,y_pastille; + unsigned long i; int ok = 0; PIXELS pastille; do{ @@ -71,12 +72,13 @@ PIXELS gen_pastille(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,int longu return pastille; } -PIXELS gen_obstacle(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,int longueur_serpent,int longueur_pastilles) +PIXELS gen_obstacle(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,unsigned long longueur_serpent,unsigned long longueur_pastilles) /* nb_pastille = int nombre de pastille voulue , p_pastilles est un pointeur d'un tableau de pixels qui sont des pastilles*/ /*-Elles se génèrent à des endroits qui peuvent être les mêmes ou gêner le snake*/ { - int x_obstacles,y_obstacles,i; + int x_obstacles,y_obstacles; + unsigned long i; int ok = 0; PIXELS obstacles; do{ @@ -145,7 +147,7 @@ void InitialisationDuSerpent(PIXELS *p_serpent) /* L'initialisation du serpent * } } -void InitialiserPastilles(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, int longueur_serpent,int longueur_obstacle) { +void InitialiserPastilles(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, unsigned long longueur_serpent,unsigned long longueur_obstacle) { int i; srand(time(NULL)); @@ -156,7 +158,7 @@ void InitialiserPastilles(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, i } } -void InitialiserObstacle(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, int longueur_serpent,int longueur_pastilles) { +void InitialiserObstacle(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, unsigned long longueur_serpent,unsigned long longueur_pastilles) { int i; srand(time(NULL)); @@ -167,7 +169,7 @@ void InitialiserObstacle(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, in } } -void DessinerScene(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, int longueur_serpent,int longueur_pastilles,int longueur_obstacle) /* Dessine la scène */ +void DessinerScene(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, unsigned long longueur_serpent,unsigned long longueur_pastilles,unsigned long longueur_obstacle) /* Dessine la scène */ { couleur bg; couleur border; diff --git a/scene.h b/scene.h index c2c7d02..2cec331 100644 --- a/scene.h +++ b/scene.h @@ -3,11 +3,11 @@ #ifndef SCENE_H #define SCENE_H -PIXELS gen_pastille(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,int longueur_serpent,int longueur_obstacle); -PIXELS gen_obstacle(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,int longueur_serpent,int longueur_pastilles); +PIXELS gen_pastille(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,unsigned long longueur_serpent,unsigned long longueur_obstacle); +PIXELS gen_obstacle(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,unsigned long longueur_serpent,unsigned long longueur_pastilles); -void InitialiserPastilles(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, int longueur_serpent,int longueur_obstacle); -void InitialiserPastilles(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, int longueur_serpent,int longueur_obstacle); -void DessinerScene(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, int longueur_serpent,int longueur_pastilles,int longueur_obstacle); +void InitialiserPastilles(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, unsigned long longueur_serpent,unsigned long longueur_obstacle); +void InitialiserPastilles(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, unsigned long longueur_serpent,unsigned long longueur_obstacle); +void DessinerScene(PIXELS *pastilles, PIXELS *serpent,PIXELS *obstacle, unsigned long longueur_serpent,unsigned long longueur_pastilles,unsigned long longueur_obstacle); #endif \ No newline at end of file