Skip to content

Commit

Permalink
Fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
bl0ckeduser committed Dec 4, 2011
1 parent 239b26a commit 24ff120
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
13 changes: 1 addition & 12 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@

/*
* The Clown3D game demo
* (libnds port)
*
* My first attempt at a 3D
* platformer. Very, very
* simple.
*/

/*
* This is a port to libnds
* of clown3d-20111112.
*
* Note that it can also
* compile with SDL + GL
* like the usual clown3d.
*
* The ported code is a bit
* messy, but not too much.
*/

extern char door_model[];
extern char key_model[];
extern char maze_model[]; /* maze world */
Expand Down
42 changes: 21 additions & 21 deletions objlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

void freeObjs(game_obj* objs)
{
/* Free game objs */
/* Free game objs */
game_obj* node = objs;
while(node->prev != NULL) {
if(node->prev != NULL)
free(node->prev);
if(node->data != NULL)
free(node->data);
node = node -> next;
}
while(node->prev != NULL) {
if(node->prev != NULL)
free(node->prev);
if(node->data != NULL)
free(node->data);
node = node -> next;
}

}

Expand All @@ -35,25 +35,25 @@ void deleteNode(game_obj* node)

game_obj* newListNode(game_obj* list)
{
game_obj *curr = list;
game_obj* prev;

while(curr->next)
curr = curr->next;
curr->next = (game_obj *)malloc(sizeof(game_obj));
prev = curr;
curr = curr->next;
curr->prev = prev;
curr->next = NULL;
game_obj *curr = list;
game_obj* prev;

while(curr->next)
curr = curr->next;
curr->next = (game_obj *)malloc(sizeof(game_obj));
prev = curr;
curr = curr->next;
curr->prev = prev;
curr->next = NULL;
return curr;
}

game_obj* newList(void)
{
game_obj* objs = (game_obj *)malloc(sizeof(game_obj));
objs->type = NONE; /* thanks valgrind */
objs->prev = NULL;
objs->data = NULL;
objs->next = NULL;
objs->prev = NULL;
objs->data = NULL;
objs->next = NULL;
return objs;
}

0 comments on commit 24ff120

Please sign in to comment.