summaryrefslogtreecommitdiff
path: root/mate-session
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-11-14 02:15:43 -0800
committerStefano Karapetsas <[email protected]>2012-11-14 02:15:43 -0800
commit6b16710b19e25ddb05f5b99f48cd4bf03d46e56a (patch)
treef96d65ab4c9c2bbd8040e62f77a0bb9bc6ad9c74 /mate-session
parent933f891732a533179682015e1d194a40293f6c9b (diff)
parentdee0e9ab8f63d1b022a7ac011a921db48acc1cd7 (diff)
downloadmate-session-manager-6b16710b19e25ddb05f5b99f48cd4bf03d46e56a.tar.bz2
mate-session-manager-6b16710b19e25ddb05f5b99f48cd4bf03d46e56a.tar.xz
Merge pull request #11 from sbalneav/master
All warnings fixed. Clean compile.
Diffstat (limited to 'mate-session')
-rw-r--r--mate-session/gs-idle-monitor.c10
-rw-r--r--mate-session/gsm-autostart-app.c8
-rw-r--r--mate-session/gsm-consolekit.c13
-rw-r--r--mate-session/gsm-inhibit-dialog.c4
-rw-r--r--mate-session/gsm-manager.c23
-rw-r--r--mate-session/mdm-signal-handler.c8
-rw-r--r--mate-session/test-client-dbus.c8
-rw-r--r--mate-session/test-inhibit.c8
8 files changed, 65 insertions, 17 deletions
diff --git a/mate-session/gs-idle-monitor.c b/mate-session/gs-idle-monitor.c
index bfde3ca..e2d51f0 100644
--- a/mate-session/gs-idle-monitor.c
+++ b/mate-session/gs-idle-monitor.c
@@ -193,7 +193,7 @@ handle_alarm_notify_event (GSIdleMonitor *monitor,
return;
}
- g_debug ("Watch %d fired, idle time = %lld",
+ g_debug ("Watch %d fired, idle time = %ld",
watch->id,
_xsyncvalue_to_int64 (alarm_event->counter_value));
@@ -450,22 +450,22 @@ _xsync_alarm_set (GSIdleMonitor *monitor,
attr.trigger.test_type = XSyncPositiveTransition;
if (watch->xalarm_positive != None) {
- g_debug ("GSIdleMonitor: updating alarm for positive transition wait=%lld",
+ g_debug ("GSIdleMonitor: updating alarm for positive transition wait=%ld",
_xsyncvalue_to_int64 (attr.trigger.wait_value));
XSyncChangeAlarm (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), watch->xalarm_positive, flags, &attr);
} else {
- g_debug ("GSIdleMonitor: creating new alarm for positive transition wait=%lld",
+ g_debug ("GSIdleMonitor: creating new alarm for positive transition wait=%ld",
_xsyncvalue_to_int64 (attr.trigger.wait_value));
watch->xalarm_positive = XSyncCreateAlarm (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), flags, &attr);
}
attr.trigger.test_type = XSyncNegativeTransition;
if (watch->xalarm_negative != None) {
- g_debug ("GSIdleMonitor: updating alarm for negative transition wait=%lld",
+ g_debug ("GSIdleMonitor: updating alarm for negative transition wait=%ld",
_xsyncvalue_to_int64 (attr.trigger.wait_value));
XSyncChangeAlarm (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), watch->xalarm_negative, flags, &attr);
} else {
- g_debug ("GSIdleMonitor: creating new alarm for negative transition wait=%lld",
+ g_debug ("GSIdleMonitor: creating new alarm for negative transition wait=%ld",
_xsyncvalue_to_int64 (attr.trigger.wait_value));
watch->xalarm_negative = XSyncCreateAlarm (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), flags, &attr);
}
diff --git a/mate-session/gsm-autostart-app.c b/mate-session/gsm-autostart-app.c
index 5dd463b..ef22911 100644
--- a/mate-session/gsm-autostart-app.c
+++ b/mate-session/gsm-autostart-app.c
@@ -32,6 +32,12 @@
#include "gsm-autostart-app.h"
#include "gsm-util.h"
+#ifdef __GNUC__
+#define UNUSED_VARIABLE __attribute__ ((unused))
+#else
+#define UNUSED_VARIABLE
+#endif
+
enum {
AUTOSTART_LAUNCH_SPAWN = 0,
AUTOSTART_LAUNCH_ACTIVATE
@@ -316,7 +322,7 @@ setup_condition_monitor (GsmAutostartApp *app)
guint kind;
char *key;
gboolean res;
- gboolean disabled;
+ gboolean UNUSED_VARIABLE disabled;
if (app->priv->condition_monitor != NULL) {
g_file_monitor_cancel (app->priv->condition_monitor);
diff --git a/mate-session/gsm-consolekit.c b/mate-session/gsm-consolekit.c
index c5eadb0..e04ae76 100644
--- a/mate-session/gsm-consolekit.c
+++ b/mate-session/gsm-consolekit.c
@@ -791,6 +791,12 @@ gsm_consolekit_can_restart (GsmConsolekit *manager)
G_TYPE_INVALID,
G_TYPE_BOOLEAN, &can_restart,
G_TYPE_INVALID);
+ if (res == FALSE) {
+ g_warning ("Could not make DBUS call: %s",
+ error->message);
+ g_error_free (error);
+ return FALSE;
+ }
return can_restart;
}
@@ -819,6 +825,13 @@ gsm_consolekit_can_stop (GsmConsolekit *manager)
G_TYPE_BOOLEAN, &can_stop,
G_TYPE_INVALID);
+ if (res == FALSE) {
+ g_warning ("Could not make DBUS call: %s",
+ error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+
return can_stop;
}
diff --git a/mate-session/gsm-inhibit-dialog.c b/mate-session/gsm-inhibit-dialog.c
index 047524f..3d4e85c 100644
--- a/mate-session/gsm-inhibit-dialog.c
+++ b/mate-session/gsm-inhibit-dialog.c
@@ -401,8 +401,10 @@ get_pixmap_for_window (Window window)
Picture src_picture;
Picture dst_picture;
gboolean has_alpha;
+#if 0
int x;
int y;
+#endif
int width;
int height;
@@ -410,8 +412,10 @@ get_pixmap_for_window (Window window)
format = XRenderFindVisualFormat (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), attr.visual);
has_alpha = (format->type == PictTypeDirect && format->direct.alphaMask);
+#if 0
x = attr.x;
y = attr.y;
+#endif
width = attr.width;
height = attr.height;
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
index 54f7ee2..8b2e024 100644
--- a/mate-session/gsm-manager.c
+++ b/mate-session/gsm-manager.c
@@ -89,6 +89,12 @@
#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
+#ifdef __GNUC__
+#define UNUSED_VARIABLE __attribute__ ((unused))
+#else
+#define UNUSED_VARIABLE
+#endif
+
typedef enum
{
GSM_MANAGER_LOGOUT_NONE,
@@ -288,12 +294,11 @@ app_condition_changed (GsmApp *app,
if (condition) {
if (!gsm_app_is_running (app) && client == NULL) {
- GError *error;
- gboolean res;
+ GError *error = NULL;
+ gboolean UNUSED_VARIABLE res;
g_debug ("GsmManager: starting app '%s'", gsm_app_peek_id (app));
- error = NULL;
res = gsm_app_start (app, &error);
if (error != NULL) {
g_warning ("Not able to start app from its condition: %s",
@@ -305,7 +310,7 @@ app_condition_changed (GsmApp *app,
}
} else {
GError *error;
- gboolean res;
+ gboolean UNUSED_VARIABLE res;
if (client != NULL) {
/* Kill client in case condition if false and make sure it won't
@@ -1473,7 +1478,7 @@ _disconnect_client (GsmManager *manager,
gboolean is_condition_client;
GsmApp *app;
GError *error;
- gboolean res;
+ gboolean UNUSED_VARIABLE res;
const char *app_id;
const char *startup_id;
gboolean app_restart;
@@ -1632,7 +1637,7 @@ static void
remove_inhibitors_for_connection (GsmManager *manager,
const char *service_name)
{
- guint n_removed;
+ guint UNUSED_VARIABLE n_removed;
RemoveClientData data;
data.service_name = service_name;
@@ -2304,10 +2309,12 @@ on_gsettings_key_changed (GSettings *settings,
delay = g_settings_get_int (settings, key);
gsm_presence_set_idle_timeout (manager->priv->presence, delay * 60000);
} else if (g_strcmp0 (key, KEY_LOCK_DISABLE) == 0) {
- gboolean disabled;
+ /* ??? */
+ gboolean UNUSED_VARIABLE disabled;
disabled = g_settings_get_boolean (settings, key);
} else if (g_strcmp0 (key, KEY_USER_SWITCH_DISABLE) == 0) {
- gboolean disabled;
+ /* ??? */
+ gboolean UNUSED_VARIABLE disabled;
disabled = g_settings_get_boolean (settings, key);
} else {
g_debug ("Config key not handled: %s", key);
diff --git a/mate-session/mdm-signal-handler.c b/mate-session/mdm-signal-handler.c
index 9f2ab3c..bded104 100644
--- a/mate-session/mdm-signal-handler.c
+++ b/mate-session/mdm-signal-handler.c
@@ -44,6 +44,12 @@
#define MDM_SIGNAL_HANDLER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), MDM_TYPE_SIGNAL_HANDLER, MdmSignalHandlerPrivate))
+#ifdef __GNUC__
+#define UNUSED_VARIABLE __attribute__ ((unused))
+#else
+#define UNUSED_VARIABLE
+#endif
+
typedef struct {
int signal_number;
MdmSignalHandlerFunc func;
@@ -254,7 +260,7 @@ static void mdm_signal_handler_backtrace(void)
static void signal_handler(int signo)
{
static int in_fatal = 0;
- int ignore;
+ int UNUSED_VARIABLE ignore;
guchar signo_byte = signo;
/* avoid loops */
diff --git a/mate-session/test-client-dbus.c b/mate-session/test-client-dbus.c
index ab9c0a7..fa888ed 100644
--- a/mate-session/test-client-dbus.c
+++ b/mate-session/test-client-dbus.c
@@ -35,6 +35,12 @@
#define SM_CLIENT_DBUS_INTERFACE "org.mate.SessionManager.ClientPrivate"
+#ifdef __GNUC__
+#define UNUSED_VARIABLE __attribute__ ((unused))
+#else
+#define UNUSED_VARIABLE
+#endif
+
static DBusGConnection *bus_connection = NULL;
static DBusGProxy *sm_proxy = NULL;
static char *client_id = NULL;
@@ -72,7 +78,7 @@ on_client_query_end_session (DBusGProxy *proxy,
{
GError *error;
gboolean is_ok;
- gboolean res;
+ gboolean UNUSED_VARIABLE res;
const char *reason;
is_ok = FALSE;
diff --git a/mate-session/test-inhibit.c b/mate-session/test-inhibit.c
index a712449..d314d9d 100644
--- a/mate-session/test-inhibit.c
+++ b/mate-session/test-inhibit.c
@@ -34,6 +34,12 @@
#define SM_DBUS_PATH "/org/mate/SessionManager"
#define SM_DBUS_INTERFACE "org.mate.SessionManager"
+#ifdef __GNUC__
+#define UNUSED_VARIABLE __attribute__ ((unused))
+#else
+#define UNUSED_VARIABLE
+#endif
+
static DBusGConnection *bus_connection = NULL;
static DBusGProxy *sm_proxy = NULL;
static guint cookie = 0;
@@ -73,7 +79,7 @@ do_inhibit_for_window (GdkWindow *window)
{
GError *error;
gboolean res;
- const char *startup_id;
+ const char UNUSED_VARIABLE *startup_id;
const char *app_id;
const char *reason;
guint toplevel_xid;