[Xfce4-commits] <libxfce4ui:master> Fix compiler warnings and make argc an int.
Nick Schermer
noreply at xfce.org
Sun Oct 18 13:44:02 CEST 2009
Updating branch refs/heads/master
to 34a5e7dafb0c266bb7d2240f7b22e6c73c2d3edc (commit)
from e7e160507f04c685be12abf9cd97ba1324f7da4f (commit)
commit 34a5e7dafb0c266bb7d2240f7b22e6c73c2d3edc
Author: Nick Schermer <nick at xfce.org>
Date: Sun Oct 18 13:34:51 2009 +0200
Fix compiler warnings and make argc an int.
libxfce4ui/xfce-sm-client.c | 30 ++++++++++++++++--------------
libxfce4ui/xfce-sm-client.h | 4 ++--
2 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/libxfce4ui/xfce-sm-client.c b/libxfce4ui/xfce-sm-client.c
index c12afd6..e5d02db 100644
--- a/libxfce4ui/xfce-sm-client.c
+++ b/libxfce4ui/xfce-sm-client.c
@@ -154,7 +154,7 @@ struct _XfceSMClient
needs_save_state:1,
shutdown_cancelled:1;
- guint argc;
+ gint argc;
gchar **argv;
gchar *state_file;
@@ -179,7 +179,7 @@ typedef struct _XfceSMClientClass
typedef struct
{
- guint argc;
+ gint argc;
gchar **argv;
gchar *client_id;
gboolean sm_disable;
@@ -225,10 +225,12 @@ static void xfce_sm_client_finalize(GObject *obj);
static void xfce_sm_client_set_client_id(XfceSMClient *sm_client,
const gchar *client_id);
static void xfce_sm_client_parse_argv(XfceSMClient *sm_client);
+#ifdef HAVE_LIBSM
static void xfce_sm_client_set_property_from_command(XfceSMClient *sm_client,
const char *property_name,
gchar **command,
gint alter_sm_id);
+#endif
static gchar **copy_command(gchar **command,
gchar **value);
@@ -407,11 +409,11 @@ xfce_sm_client_class_init(XfceSMClientClass *klass)
/* these are "private" properties */
g_object_class_install_property(gobject_class, PROP_ARGC,
- g_param_spec_uint("argc",
- "argc",
- "Argument count passed to program",
- 0, G_MAXUINT, 0,
- G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY));
+ g_param_spec_int("argc",
+ "argc",
+ "Argument count passed to program",
+ G_MININT, G_MAXINT, 0,
+ G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property(gobject_class, PROP_ARGV,
g_param_spec_boxed("argv",
"argv",
@@ -511,7 +513,7 @@ xfce_sm_client_set_property(GObject *obj,
if(sm_client->argc)
g_critical("XfceSMClient: Received argc twice");
else {
- sm_client->argc = g_value_get_uint(value);
+ sm_client->argc = g_value_get_int(value);
xfce_sm_client_parse_argv(sm_client);
}
break;
@@ -661,10 +663,10 @@ xfce_sm_client_set_clone_command(XfceSMClient *sm_client,
static void
xfce_sm_client_parse_argv(XfceSMClient *sm_client)
{
- guint argc = 0;
- gchar **argv = NULL;
+ gint argc;
+ gchar **argv;
gchar **clone_command = NULL, **restart_command = NULL;
- guint clone_argc = 0;
+ gint clone_argc = 0;
const gchar *client_id = NULL;
int i;
gboolean got_display = FALSE;
@@ -1383,7 +1385,7 @@ xfce_sm_client_set_clone_restart_commands(XfceSMClient *sm_client)
* Returns: A new #GOptionGroup
**/
GOptionGroup *
-xfce_sm_client_get_option_group(guint argc,
+xfce_sm_client_get_option_group(gint argc,
gchar **argv)
{
const GOptionEntry entries[] = {
@@ -1427,7 +1429,7 @@ xfce_sm_client_get_option_group(guint argc,
* Returns: A new or existing #XfceSMClient
**/
XfceSMClient *
-xfce_sm_client_get()
+xfce_sm_client_get(void)
{
return g_object_new(XFCE_TYPE_SM_CLIENT,
"argc", startup_options.argc,
@@ -1457,7 +1459,7 @@ xfce_sm_client_get()
* Returns: A new #XfceSMClient instance
**/
XfceSMClient *
-xfce_sm_client_get_with_argv(guint argc,
+xfce_sm_client_get_with_argv(gint argc,
gchar **argv,
XfceSMClientRestartStyle restart_style,
guchar priority)
diff --git a/libxfce4ui/xfce-sm-client.h b/libxfce4ui/xfce-sm-client.h
index 82878e9..bd7ba8c 100644
--- a/libxfce4ui/xfce-sm-client.h
+++ b/libxfce4ui/xfce-sm-client.h
@@ -63,12 +63,12 @@ typedef struct _XfceSMClient XfceSMClient;
GType xfce_sm_client_get_type(void) G_GNUC_CONST;
-GOptionGroup *xfce_sm_client_get_option_group(guint argc,
+GOptionGroup *xfce_sm_client_get_option_group(gint argc,
gchar **argv);
XfceSMClient *xfce_sm_client_get(void);
-XfceSMClient *xfce_sm_client_get_with_argv(guint argc,
+XfceSMClient *xfce_sm_client_get_with_argv(gint argc,
gchar **argv,
XfceSMClientRestartStyle restart_style,
guchar priority);
More information about the Xfce4-commits
mailing list