[gnome-games] gnibbles: fix some code style issues. ISO C90 and missing voids
- From: Thomas Hindoe Paaboel Andersen <thomashpa src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-games] gnibbles: fix some code style issues. ISO C90 and missing voids
- Date: Fri, 16 Oct 2009 11:01:29 +0000 (UTC)
commit f2ba60effc65568f051f31d229dc724b6cca00b4
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date: Fri Oct 16 12:57:21 2009 +0200
gnibbles: fix some code style issues. ISO C90 and missing voids
gnibbles/board.c | 11 ++++++-----
gnibbles/gnibbles.c | 6 +++---
gnibbles/main.c | 2 +-
gnibbles/worm.c | 25 ++++++++++++-------------
4 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/gnibbles/board.c b/gnibbles/board.c
index df83c40..ccc2885 100644
--- a/gnibbles/board.c
+++ b/gnibbles/board.c
@@ -177,15 +177,15 @@ gnibbles_board_load_level (GnibblesBoard *board)
void
gnibbles_board_rescale (GnibblesBoard *board, gint tilesize)
{
+ gint i, count;
+ gfloat x_pos, y_pos;
+ ClutterActor *tmp;
+
if (!board->level)
return;
if (!board->surface)
return;
- gint i, count;
- gfloat x_pos, y_pos;
- ClutterActor *tmp;
-
board->width = BOARDWIDTH * tilesize;
board->height = BOARDHEIGHT * tilesize;
@@ -209,7 +209,6 @@ void
gnibbles_board_level_new (GnibblesBoard *board, gint level)
{
- board->current_level = level;
gchar *tmp = NULL;
const char *dirname;
gchar *filename;
@@ -218,6 +217,8 @@ gnibbles_board_level_new (GnibblesBoard *board, gint level)
gint i,j;
gint count = 0;
+ board->current_level = level;
+
tmp = g_strdup_printf("level%03d.gnl", level);
dirname = games_runtime_get_directory (GAMES_RUNTIME_GAME_GAMES_DIRECTORY);
diff --git a/gnibbles/gnibbles.c b/gnibbles/gnibbles.c
index 690bcf8..1f1c2b3 100644
--- a/gnibbles/gnibbles.c
+++ b/gnibbles/gnibbles.c
@@ -194,13 +194,13 @@ gnibbles_load_logo (gint tilesize)
}
void
-gnibbles_init ()
+gnibbles_init (void)
{
+ gint i;
+
if (!board)
return;
- gint i;
-
for (i = 0; i < properties->numworms; i++) {
if (worms[i])
gnibbles_worm_destroy (worms[i]);
diff --git a/gnibbles/main.c b/gnibbles/main.c
index a462de7..fcdc7da 100644
--- a/gnibbles/main.c
+++ b/gnibbles/main.c
@@ -834,7 +834,7 @@ create_menus (GtkUIManager * ui_manager)
}
static void
-setup_window ()
+setup_window (void)
{
GtkWidget *vbox;
GtkWidget *packing;
diff --git a/gnibbles/worm.c b/gnibbles/worm.c
index 8010975..f02f6a4 100644
--- a/gnibbles/worm.c
+++ b/gnibbles/worm.c
@@ -192,12 +192,12 @@ gnibbles_worm_remove_actor (GnibblesWorm *worm)
gboolean
gnibbles_worm_handle_keypress (GnibblesWorm * worm, guint keyval)
{
- if (worm->lives <= 0)
- return FALSE;
-
GnibblesWormProps *props;
guint propsUp, propsLeft, propsDown, propsRight, keyvalUpper;
+ if (worm->lives <= 0)
+ return FALSE;
+
props = properties->wormprops[ggz_network_mode ? 0 : worm->number];
propsUp = toupper(props->up);
propsLeft = toupper(props->left);
@@ -271,12 +271,11 @@ static gboolean
gnibbles_worm_reverse (gpointer data)
{
GnibblesWorm *worm = (GnibblesWorm *) data;
+ gint tmp, old_dir;
worm->list = g_list_reverse (worm->list);
- gint old_dir = gnibbles_worm_get_tail_direction (worm);
-
- gint tmp;
+ old_dir = gnibbles_worm_get_tail_direction (worm);
tmp = worm->xhead;
worm->xhead = worm->xtail;
@@ -584,11 +583,11 @@ gnibbles_worm_show (GnibblesWorm *worm)
void
gnibbles_worm_reset (GnibblesWorm *worm)
{
+ gint i,j;
+
worm->stop = TRUE;
gnibbles_worm_animate_death (worm);
- gint i,j;
-
for (i = 0; i < BOARDHEIGHT; i++)
for (j = 0; j < BOARDWIDTH; j++)
if (board->walls[j][i] == WORMCHAR + worm->number)
@@ -640,17 +639,17 @@ gnibbles_worm_destroy (GnibblesWorm *worm)
void
gnibbles_worm_rescale (GnibblesWorm *worm, gint tilesize)
{
- if (!worm)
- return;
- if (!worm->actors)
- return;
-
int i;
gfloat x_pos, y_pos;
gint count;
ClutterActor *tmp;
GError *err = NULL;
+ if (!worm)
+ return;
+ if (!worm->actors)
+ return;
+
count = clutter_group_get_n_children (CLUTTER_GROUP (worm->actors));
for (i = 0; i < count; i++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]