2005-07-13 Dan Williams <dcbw@redhat.com>

Patch from Ray Strode <halfline@gmail.com>
	* Random cleanups for strict CFLAGS


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@796 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2005-07-13 16:58:13 +00:00
parent 39c3b4f895
commit c2ac475604
9 changed files with 36 additions and 26 deletions

View File

@@ -1,3 +1,8 @@
2005-07-13 Dan Williams <dcbw@redhat.com>
Patch from Ray Strode <halfline@gmail.com>
* Random cleanups for strict CFLAGS
2005-07-07 Dan Williams <dcbw@redhat.com> 2005-07-07 Dan Williams <dcbw@redhat.com>
Patch from Derek Atkins <warlord@MIT.EDU> Patch from Derek Atkins <warlord@MIT.EDU>

View File

@@ -1344,12 +1344,12 @@ static void nmwa_menu_vpn_item_activate (GtkMenuItem *item, gpointer user_data)
static void nmwa_menu_configure_vpn_item_activate (GtkMenuItem *item, gpointer user_data) static void nmwa_menu_configure_vpn_item_activate (GtkMenuItem *item, gpointer user_data)
{ {
NMWirelessApplet *applet = (NMWirelessApplet *)user_data; NMWirelessApplet *applet = (NMWirelessApplet *)user_data;
char *argv[2] = {BINDIR "/nm-vpn-properties", NULL}; const char *argv[] = { BINDIR "/nm-vpn-properties", NULL};
g_return_if_fail (item != NULL); g_return_if_fail (item != NULL);
g_return_if_fail (applet != NULL); g_return_if_fail (applet != NULL);
g_spawn_async (NULL, argv, NULL, 0, NULL, NULL, NULL, NULL); g_spawn_async (NULL, (gchar **) argv, NULL, 0, NULL, NULL, NULL, NULL);
} }
/* /*

View File

@@ -88,7 +88,7 @@ out:
GSList * GSList *
nmwa_vpn_request_password (NMWirelessApplet *applet, const char *name, const char *service, gboolean retry) nmwa_vpn_request_password (NMWirelessApplet *applet, const char *name, const char *service, gboolean retry)
{ {
char *argv[] = {NULL /*"/usr/libexec/nm-vpnc-auth-dialog"*/, const char *argv[] = {NULL /*"/usr/libexec/nm-vpnc-auth-dialog"*/,
"-n", NULL /*"davidznet42"*/, "-n", NULL /*"davidznet42"*/,
"-s", NULL /*"org.freedesktop.vpnc"*/, "-s", NULL /*"org.freedesktop.vpnc"*/,
"-r", "-r",
@@ -161,8 +161,8 @@ nmwa_vpn_request_password (NMWirelessApplet *applet, const char *name, const cha
/* Fix up parameters with what we got */ /* Fix up parameters with what we got */
argv[0] = auth_dialog_binary; argv[0] = auth_dialog_binary;
argv[2] = (char *) name; argv[2] = name;
argv[4] = (char *) service; argv[4] = service;
if (!retry) if (!retry)
argv[5] = NULL; argv[5] = NULL;
@@ -171,7 +171,7 @@ nmwa_vpn_request_password (NMWirelessApplet *applet, const char *name, const cha
child_status = -1; child_status = -1;
if (!g_spawn_async_with_pipes (NULL, /* working_directory */ if (!g_spawn_async_with_pipes (NULL, /* working_directory */
argv, /* argv */ (gchar **) argv, /* argv */
NULL, /* envp */ NULL, /* envp */
G_SPAWN_DO_NOT_REAP_CHILD, /* flags */ G_SPAWN_DO_NOT_REAP_CHILD, /* flags */
NULL, /* child_setup */ NULL, /* child_setup */

View File

@@ -396,9 +396,9 @@ NMDevice *nm_device_new (const char *iface, const char *udi, gboolean test_dev,
/* Block until our device thread has actually had a chance to start. */ /* Block until our device thread has actually had a chance to start. */
args[0] = &dev->worker_started; args[0] = &dev->worker_started;
args[1] = "nm_device_new(): waiting for device's worker thread to start"; args[1] = (gpointer) "nm_device_new(): waiting for device's worker thread to start";
args[2] = (void *)LOG_INFO; args[2] = GINT_TO_POINTER (LOG_INFO);
args[3] = 0; args[3] = GINT_TO_POINTER (0);
nm_wait_for_completion (NM_COMPLETION_TRIES_INFINITY, nm_wait_for_completion (NM_COMPLETION_TRIES_INFINITY,
G_USEC_PER_SEC / 20, nm_completion_boolean_test, NULL, args); G_USEC_PER_SEC / 20, nm_completion_boolean_test, NULL, args);
@@ -3637,7 +3637,7 @@ static void nm_device_fake_ap_list (NMDevice *dev)
int i; int i;
NMAccessPointList * old_ap_list = nm_device_ap_list_get (dev); NMAccessPointList * old_ap_list = nm_device_ap_list_get (dev);
char *fake_essids[NUM_FAKE_APS] = { "green", "bay", "packers", "rule" }; const char *fake_essids[NUM_FAKE_APS] = { "green", "bay", "packers", "rule" };
struct ether_addr fake_addrs[NUM_FAKE_APS] = {{{0x70, 0x37, 0x03, 0x70, 0x37, 0x03}}, struct ether_addr fake_addrs[NUM_FAKE_APS] = {{{0x70, 0x37, 0x03, 0x70, 0x37, 0x03}},
{{0x12, 0x34, 0x56, 0x78, 0x90, 0xab}}, {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab}},
{{0xcd, 0xef, 0x12, 0x34, 0x56, 0x78}}, {{0xcd, 0xef, 0x12, 0x34, 0x56, 0x78}},

View File

@@ -79,7 +79,7 @@ static MutexDesc *nm_find_mutex_desc (GMutex *mutex)
* Associate a description with a particular mutex. * Associate a description with a particular mutex.
* *
*/ */
void nm_register_mutex_desc (GMutex *mutex, char *string) void nm_register_mutex_desc (GMutex *mutex, const char *string)
{ {
if (!(nm_find_mutex_desc (mutex))) if (!(nm_find_mutex_desc (mutex)))
{ {
@@ -375,7 +375,7 @@ void nm_dispose_scan_results (wireless_scan *result_list)
* Wrap g_spawn_sync in a usable manner * Wrap g_spawn_sync in a usable manner
* *
*/ */
int nm_spawn_process (char *args) int nm_spawn_process (const char *args)
{ {
gint num_args; gint num_args;
char **argv = NULL; char **argv = NULL;

View File

@@ -47,7 +47,7 @@ typedef struct NMSock NMSock;
gboolean nm_try_acquire_mutex (GMutex *mutex, const char *func); gboolean nm_try_acquire_mutex (GMutex *mutex, const char *func);
void nm_lock_mutex (GMutex *mutex, const char *func); void nm_lock_mutex (GMutex *mutex, const char *func);
void nm_unlock_mutex (GMutex *mutex, const char *func); void nm_unlock_mutex (GMutex *mutex, const char *func);
void nm_register_mutex_desc (GMutex *mutex, char *string); void nm_register_mutex_desc (GMutex *mutex, const char *string);
NMSock * nm_dev_sock_open (NMDevice *dev, SockType type, const char *func_name, const char *desc); NMSock * nm_dev_sock_open (NMDevice *dev, SockType type, const char *func_name, const char *desc);
void nm_dev_sock_close (NMSock *sock); void nm_dev_sock_close (NMSock *sock);
@@ -60,7 +60,7 @@ gboolean nm_ethernet_address_is_valid (const struct ether_addr *test_addr);
void nm_dispose_scan_results (wireless_scan *result_list); void nm_dispose_scan_results (wireless_scan *result_list);
int nm_spawn_process (char *args); int nm_spawn_process (const char *args);
NMDriverSupportLevel nm_get_driver_support_level (LibHalContext *ctx, NMDevice *dev); NMDriverSupportLevel nm_get_driver_support_level (LibHalContext *ctx, NMDevice *dev);

View File

@@ -85,8 +85,8 @@ static gboolean nm_dhcp_manager_exec_daemon (NMDHCPManager *manager)
g_return_val_if_fail (manager != NULL, FALSE); g_return_val_if_fail (manager != NULL, FALSE);
dhcp_argv = g_ptr_array_new (); dhcp_argv = g_ptr_array_new ();
g_ptr_array_add (dhcp_argv, DHCDBD_BINARY_PATH); g_ptr_array_add (dhcp_argv, (gpointer) DHCDBD_BINARY_PATH);
g_ptr_array_add (dhcp_argv, "--system"); g_ptr_array_add (dhcp_argv, (gpointer) "--system");
g_ptr_array_add (dhcp_argv, NULL); g_ptr_array_add (dhcp_argv, NULL);
if (!g_spawn_async ("/", (char **) dhcp_argv->pdata, NULL, 0, NULL, NULL, &pid, &error)) if (!g_spawn_async ("/", (char **) dhcp_argv->pdata, NULL, 0, NULL, NULL, &pid, &error))

View File

@@ -562,10 +562,9 @@ gboolean nm_vpn_manager_process_signal (NMVPNManager *manager, DBusMessage *mess
|| dbus_message_is_signal (message, service_name, NM_DBUS_VPN_SIGNAL_IP_CONFIG_BAD)) || dbus_message_is_signal (message, service_name, NM_DBUS_VPN_SIGNAL_IP_CONFIG_BAD))
{ {
char *error_msg; char *error_msg;
char *blank_msg = "";
if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &error_msg, DBUS_TYPE_INVALID)) if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &error_msg, DBUS_TYPE_INVALID))
error_msg = blank_msg; error_msg = (char *) "";
nm_warning ("VPN failed for service '%s', signal '%s', with message '%s'.", service_name, member, error_msg); nm_warning ("VPN failed for service '%s', signal '%s', with message '%s'.", service_name, member, error_msg);
nm_dbus_vpn_signal_vpn_failed (manager->app_data->dbus_connection, member, active, error_msg); nm_dbus_vpn_signal_vpn_failed (manager->app_data->dbus_connection, member, active, error_msg);
} }

View File

@@ -30,13 +30,14 @@
#include "NetworkManager.h" #include "NetworkManager.h"
char * get_network_string_property (DBusConnection *connection, char *network, char *method, NMNetworkType type) static char * get_network_string_property (DBusConnection *connection, const char *network, const char *method, NMNetworkType type)
{ {
DBusMessage *message; DBusMessage *message;
DBusMessage *reply; DBusMessage *reply;
DBusError error; DBusError error;
char *string = NULL; char *string = NULL;
char *ret_string = NULL; char *ret_string = NULL;
gint32 type_as_int;
message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH, NMI_DBUS_INTERFACE, method); message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH, NMI_DBUS_INTERFACE, method);
if (message == NULL) if (message == NULL)
@@ -45,7 +46,8 @@ char * get_network_string_property (DBusConnection *connection, char *network, c
return NULL; return NULL;
} }
dbus_message_append_args (message, DBUS_TYPE_STRING, network, DBUS_TYPE_INT32, type, DBUS_TYPE_INVALID); type_as_int = (gint32) type;
dbus_message_append_args (message, DBUS_TYPE_STRING, &network, DBUS_TYPE_INT32, &type_as_int, DBUS_TYPE_INVALID);
dbus_error_init (&error); dbus_error_init (&error);
reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error); reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error);
dbus_message_unref (message); dbus_message_unref (message);
@@ -78,12 +80,13 @@ char * get_network_string_property (DBusConnection *connection, char *network, c
return (ret_string); return (ret_string);
} }
gboolean get_network_trusted (DBusConnection *connection, char *network, NMNetworkType type) static gboolean get_network_trusted (DBusConnection *connection, const char *network, NMNetworkType type)
{ {
DBusMessage *message; DBusMessage *message;
DBusMessage *reply; DBusMessage *reply;
DBusError error; DBusError error;
gboolean trusted = FALSE; gboolean trusted = FALSE;
gint32 type_as_int;
g_return_val_if_fail (connection != NULL, -1); g_return_val_if_fail (connection != NULL, -1);
g_return_val_if_fail (network != NULL, -1); g_return_val_if_fail (network != NULL, -1);
@@ -96,7 +99,8 @@ gboolean get_network_trusted (DBusConnection *connection, char *network, NMNetwo
} }
dbus_error_init (&error); dbus_error_init (&error);
dbus_message_append_args (message, DBUS_TYPE_STRING, network, DBUS_TYPE_INT32, type, DBUS_TYPE_INVALID); type_as_int = (gint32) type;
dbus_message_append_args (message, DBUS_TYPE_STRING, &network, DBUS_TYPE_INT32, &type_as_int, DBUS_TYPE_INVALID);
reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error); reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error);
dbus_message_unref (message); dbus_message_unref (message);
if (dbus_error_is_set (&error)) if (dbus_error_is_set (&error))
@@ -126,12 +130,13 @@ gboolean get_network_trusted (DBusConnection *connection, char *network, NMNetwo
} }
void get_networks_of_type (DBusConnection *connection, NMNetworkType type) static void get_networks_of_type (DBusConnection *connection, NMNetworkType type)
{ {
DBusMessage *message; DBusMessage *message;
DBusMessage *reply; DBusMessage *reply;
DBusMessageIter iter; DBusMessageIter iter;
DBusError error; DBusError error;
gint32 type_as_int;
char **networks; char **networks;
int num_networks; int num_networks;
int i; int i;
@@ -144,7 +149,8 @@ void get_networks_of_type (DBusConnection *connection, NMNetworkType type)
} }
dbus_error_init (&error); dbus_error_init (&error);
dbus_message_append_args (message, DBUS_TYPE_INT32, type, DBUS_TYPE_INVALID); type_as_int = (gint32) type;
dbus_message_append_args (message, DBUS_TYPE_INT32, &type_as_int, DBUS_TYPE_INVALID);
reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error); reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error);
dbus_message_unref (message); dbus_message_unref (message);
if (dbus_error_is_set (&error)) if (dbus_error_is_set (&error))
@@ -195,7 +201,7 @@ void get_networks_of_type (DBusConnection *connection, NMNetworkType type)
g_strfreev (networks); g_strfreev (networks);
} }
void get_user_key_for_network (DBusConnection *connection) static void get_user_key_for_network (DBusConnection *connection)
{ {
DBusMessage *message; DBusMessage *message;
@@ -219,7 +225,7 @@ void get_user_key_for_network (DBusConnection *connection)
} }
void set_user_key_for_network (DBusConnection *connection, DBusMessage *message, GMainLoop *loop) static void set_user_key_for_network (DBusConnection *connection, DBusMessage *message, GMainLoop *loop)
{ {
DBusError error; DBusError error;
const char *device; const char *device;