patch to get rid of int32 vs. uint32 error
- From: j bootlab org
- To: networkmanager-list gnome org
- Subject: patch to get rid of int32 vs. uint32 error
- Date: Mon, 10 Jan 2005 16:40:55 +0100
current version of cvs causes NetworkManagerInfo to print this error:
nmwa_dbus_call_nm_method(): error while getting args:
name='org.freedesktop.DBus.Error.InvalidArgs' message='Argument 0 is
specified to be of type "int32", but
is actually of type "uint32"
'
attached patch adds DBUS_TYPE_UINT32 as valid arg_type and changes the
type for getMode to DBUS_TYPE_UINT32.
this removes the error messages and makes NetworkManager more stable for
me(its was loosing the connection for a short period each time getMode
failed)
j
Index: panel-applet/NMWirelessAppletDbus.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/panel-applet/NMWirelessAppletDbus.c,v
retrieving revision 1.34
diff -u -r1.34 NMWirelessAppletDbus.c
--- panel-applet/NMWirelessAppletDbus.c 22 Dec 2004 00:21:42 -0000 1.34
+++ panel-applet/NMWirelessAppletDbus.c 10 Jan 2005 15:47:16 -0000
@@ -58,7 +58,7 @@
g_return_val_if_fail (con != NULL, RETURN_FAILURE);
g_return_val_if_fail (path != NULL, RETURN_FAILURE);
g_return_val_if_fail (method != NULL, RETURN_FAILURE);
- g_return_val_if_fail (((arg_type == DBUS_TYPE_STRING) || (arg_type == DBUS_TYPE_INT32) || (arg_type == DBUS_TYPE_BOOLEAN) || (arg_type == DBUS_TYPE_STRING_ARRAY)), RETURN_FAILURE);
+ g_return_val_if_fail (((arg_type == DBUS_TYPE_STRING) || (arg_type == DBUS_TYPE_INT32) || (arg_type == DBUS_TYPE_UINT32) || (arg_type == DBUS_TYPE_BOOLEAN) || (arg_type == DBUS_TYPE_STRING_ARRAY)), RETURN_FAILURE);
g_return_val_if_fail (arg != NULL, RETURN_FAILURE);
if ((arg_type == DBUS_TYPE_STRING) || (arg_type == DBUS_TYPE_STRING_ARRAY))
@@ -119,6 +119,9 @@
case DBUS_TYPE_INT32:
ret = dbus_message_get_args (reply, &error, DBUS_TYPE_INT32, &dbus_int, DBUS_TYPE_INVALID);
break;
+ case DBUS_TYPE_UINT32:
+ ret = dbus_message_get_args (reply, &error, DBUS_TYPE_UINT32, &dbus_int, DBUS_TYPE_INVALID);
+ break;
case DBUS_TYPE_BOOLEAN:
ret = dbus_message_get_args (reply, &error, DBUS_TYPE_BOOLEAN, &dbus_bool, DBUS_TYPE_INVALID);
break;
@@ -148,6 +151,7 @@
*item_count = num_items;
break;
case DBUS_TYPE_INT32:
+ case DBUS_TYPE_UINT32:
*((int *)(arg)) = dbus_int;
break;
case DBUS_TYPE_BOOLEAN:
@@ -334,7 +338,7 @@
{
NMNetworkMode mode = NETWORK_MODE_INFRA;
- switch (nmwa_dbus_call_nm_method (applet->connection, path, "getMode", DBUS_TYPE_INT32, (void **)(&mode), NULL))
+ switch (nmwa_dbus_call_nm_method (applet->connection, path, "getMode", DBUS_TYPE_UINT32, (void **)(&mode), NULL))
{
case (RETURN_NO_NM):
applet->applet_state = APPLET_STATE_NO_NM;
Index: src/NetworkManagerDbus.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/NetworkManagerDbus.c,v
retrieving revision 1.55
diff -u -r1.55 NetworkManagerDbus.c
--- src/NetworkManagerDbus.c 9 Jan 2005 23:15:36 -0000 1.55
+++ src/NetworkManagerDbus.c 10 Jan 2005 15:47:16 -0000
@@ -1152,7 +1152,7 @@
else if (strcmp ("getEncrypted", request) == 0)
dbus_message_append_args (reply_message, DBUS_TYPE_BOOLEAN, nm_ap_get_encrypted (ap), DBUS_TYPE_INVALID);
else if (strcmp ("getMode", request) == 0)
- dbus_message_append_args (reply_message, DBUS_TYPE_INT32, nm_ap_get_mode (ap), DBUS_TYPE_INVALID);
+ dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, nm_ap_get_mode (ap), DBUS_TYPE_INVALID);
else
{
/* Must destroy the allocated message */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]