]> git.itanic.dy.fi Git - sdl-planets/commitdiff
Utilize lists correctly
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 7 Mar 2010 11:13:20 +0000 (13:13 +0200)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 7 Mar 2010 11:13:20 +0000 (13:13 +0200)
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
planet.c
planet.h

index df16acb7310c7bc7ab9f1296bf07d3e312b561ee..0a76081a4edb21c81207b4626d66bfb7a7be0d67 100644 (file)
--- a/planet.c
+++ b/planet.c
@@ -26,7 +26,7 @@ void init_planet(const SDL_Surface *screen, struct planet *p)
        p->g = get_random() % 256;
        p->b = get_random() % 256;
 
-       LIST_HEAD_INIT(p->list);
+       INIT_LIST_HEAD(&p->list);
 }
 
 void draw_planet(SDL_Surface *screen, struct planet *p)
index 79f918a6656eac1605ee6cb91d5670771d5e8969..ac0d8e37d77412750ce6395d020dfbae9edd8daf 100644 (file)
--- a/planet.h
+++ b/planet.h
@@ -16,7 +16,7 @@ struct planet {
        unsigned char r, g, b;
 };
 
-#define list_to_planet(planet) container_of((planet), struct planet, list)
+#define list_to_planet(list_head) container_of((list_head), struct planet, list)
 
 void init_planet(const SDL_Surface *screen, struct planet *p);
 void draw_planet(SDL_Surface *screen, struct planet *p);