summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/cursesplugin.c7
-rw-r--r--lib/textplugin.c13
-rw-r--r--lib/x11plugin.c12
3 files changed, 15 insertions, 17 deletions
diff --git a/lib/cursesplugin.c b/lib/cursesplugin.c
index 872ad15..06b1cba 100644
--- a/lib/cursesplugin.c
+++ b/lib/cursesplugin.c
@@ -124,17 +124,16 @@ curses_plugin_init (GObject * object)
}
static GObject *
-curses_plugin_constructor (GType type,
- guint n_construct_properties,
+curses_plugin_constructor (GType type,
+ guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GObject *object;
CursesPlugin *curses;
- gint color_pair;
/* Chain up to the parent first */
object = parent_class->constructor (type, n_construct_properties, construct_properties);
-
+
curses = CURSES_PLUGIN (object);
/* Initialize curses mode */
diff --git a/lib/textplugin.c b/lib/textplugin.c
index da08710..61110d5 100644
--- a/lib/textplugin.c
+++ b/lib/textplugin.c
@@ -21,6 +21,7 @@
*/
#include <glib.h>
+#include <glib/gprintf.h>
#include <stdio.h>
#include "configs.h"
#include "textplugin.h"
@@ -127,25 +128,25 @@ text_plugin_init (GObject * object)
}
static GObject *
-text_plugin_constructor (GType type,
- guint n_construct_properties,
+text_plugin_constructor (GType type,
+ guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GObject *object;
/* Chain up to the parent first */
object = parent_class->constructor (type, n_construct_properties, construct_properties);
-
+
g_printf ("GNU Robots starting..\n");
-
+
return object;
}
-static void
+static void
text_plugin_dispose (GObject * object)
{
TextPlugin *text = TEXT_PLUGIN (object);
-
+
if (text->map != NULL) {
g_object_unref (G_OBJECT (text->map));
diff --git a/lib/x11plugin.c b/lib/x11plugin.c
index 93f0ae5..1459530 100644
--- a/lib/x11plugin.c
+++ b/lib/x11plugin.c
@@ -21,6 +21,7 @@
*/
#include <glib.h>
+#include <glib/gprintf.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -28,6 +29,7 @@
#include "x11plugin.h"
#include <readline.h>
+#include <history.h>
enum
{
@@ -155,7 +157,6 @@ x11_plugin_constructor (GType type,
XWMHints wmhints;
XGCValues values;
Atom delete_win;
- gint x;
/* Chain up to the parent first */
object = parent_class->constructor (type, n_construct_properties, construct_properties);
@@ -613,19 +614,19 @@ inline void x11_update_status (X11Plugin *x11,
XDrawString (x11->dpy, x11->win_buf, x11->gc, 3, x11->map_size->num_rows * TILE_SIZE + 16, s, strlen (s));
if (energy > -1) {
- g_sprintf (status, "Robot Energy: %3d", energy);
+ g_sprintf (status, "Robot Energy: %3ld", energy);
XDrawString (x11->dpy, x11->win_buf, x11->gc, 240, x11->map_size->num_rows * TILE_SIZE + 12, status,
strlen (status));
}
if (score > -1) {
- g_sprintf (status, "Robot Score: %3d", score);
+ g_sprintf (status, "Robot Score: %3ld", score);
XDrawString (x11->dpy, x11->win_buf, x11->gc, 240, x11->map_size->num_rows * TILE_SIZE + 25, status,
strlen (status));
}
if (shields > -1) {
- g_sprintf (status, "Robot Shields: %3d", shields);
+ g_sprintf (status, "Robot Shields: %3ld", shields);
XDrawString (x11->dpy, x11->win_buf, x11->gc, 480, x11->map_size->num_rows * TILE_SIZE + 12, status,
strlen (status));
}
@@ -637,7 +638,6 @@ inline void x11_plugin_update_status (X11Plugin *x11,
glong score,
glong shields)
{
- gint x;
XEvent ev;
x11_update_status (x11, s, energy, score, shields);
@@ -671,8 +671,6 @@ shm_error_handler (X11Plugin *x11, Display * d, XErrorEvent * e)
static void
setup_winbuf (X11Plugin *x11)
{
- gint major, minor;
- Bool shared;
XVisualInfo *matches;
XVisualInfo plate;
gint count;