Commit c2ac4756 authored by Dan Williams's avatar Dan Williams
Browse files

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
parent 39c3b4f8
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>
Patch from Derek Atkins <warlord@MIT.EDU>
......
......@@ -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)
{
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 (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);
}
/*
......
......@@ -88,7 +88,7 @@ out:
GSList *
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"*/,
"-s", NULL /*"org.freedesktop.vpnc"*/,
"-r",
......@@ -161,8 +161,8 @@ nmwa_vpn_request_password (NMWirelessApplet *applet, const char *name, const cha
/* Fix up parameters with what we got */
argv[0] = auth_dialog_binary;
argv[2] = (char *) name;
argv[4] = (char *) service;
argv[2] = name;
argv[4] = service;
if (!retry)
argv[5] = NULL;
......@@ -171,7 +171,7 @@ nmwa_vpn_request_password (NMWirelessApplet *applet, const char *name, const cha
child_status = -1;
if (!g_spawn_async_with_pipes (NULL, /* working_directory */
argv, /* argv */
(gchar **) argv, /* argv */
NULL, /* envp */
G_SPAWN_DO_NOT_REAP_CHILD, /* flags */
NULL, /* child_setup */
......
......@@ -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. */
args[0] = &dev->worker_started;
args[1] = "nm_device_new(): waiting for device's worker thread to start";
args[2] = (void *)LOG_INFO;
args[3] = 0;
args[1] = (gpointer) "nm_device_new(): waiting for device's worker thread to start";
args[2] = GINT_TO_POINTER (LOG_INFO);
args[3] = GINT_TO_POINTER (0);
nm_wait_for_completion (NM_COMPLETION_TRIES_INFINITY,
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;
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}},
{{0x12, 0x34, 0x56, 0x78, 0x90, 0xab}},
{{0xcd, 0xef, 0x12, 0x34, 0x56, 0x78}},
......
......@@ -79,7 +79,7 @@ static MutexDesc *nm_find_mutex_desc (GMutex *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)))
{
......@@ -375,7 +375,7 @@ void nm_dispose_scan_results (wireless_scan *result_list)
* Wrap g_spawn_sync in a usable manner
*
*/
int nm_spawn_process (char *args)
int nm_spawn_process (const char *args)
{
gint num_args;
char **argv = NULL;
......
......@@ -47,7 +47,7 @@ typedef struct NMSock NMSock;
gboolean nm_try_acquire_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_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);
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);
int nm_spawn_process (char *args);
int nm_spawn_process (const char *args);
NMDriverSupportLevel nm_get_driver_support_level (LibHalContext *ctx, NMDevice *dev);
......
......@@ -85,8 +85,8 @@ static gboolean nm_dhcp_manager_exec_daemon (NMDHCPManager *manager)
g_return_val_if_fail (manager != NULL, FALSE);
dhcp_argv = g_ptr_array_new ();
g_ptr_array_add (dhcp_argv, DHCDBD_BINARY_PATH);
g_ptr_array_add (dhcp_argv, "--system");
g_ptr_array_add (dhcp_argv, (gpointer) DHCDBD_BINARY_PATH);
g_ptr_array_add (dhcp_argv, (gpointer) "--system");
g_ptr_array_add (dhcp_argv, NULL);
if (!g_spawn_async ("/", (char **) dhcp_argv->pdata, NULL, 0, NULL, NULL, &pid, &error))
......
......@@ -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))
{
char *error_msg;
char *blank_msg = "";
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_dbus_vpn_signal_vpn_failed (manager->app_data->dbus_connection, member, active, error_msg);
}
......
......@@ -30,13 +30,14 @@
#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 *reply;
DBusError error;
char *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);
if (message == NULL)
......@@ -45,7 +46,8 @@ char * get_network_string_property (DBusConnection *connection, char *network, c
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);
reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error);
dbus_message_unref (message);
......@@ -78,12 +80,13 @@ char * get_network_string_property (DBusConnection *connection, char *network, c
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 *reply;
DBusError error;
gboolean trusted = FALSE;
gint32 type_as_int;
g_return_val_if_fail (connection != 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_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);
dbus_message_unref (message);
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 *reply;
DBusMessageIter iter;
DBusError error;
gint32 type_as_int;
char **networks;
int num_networks;
int i;
......@@ -144,7 +149,8 @@ void get_networks_of_type (DBusConnection *connection, NMNetworkType type)
}
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);
dbus_message_unref (message);
if (dbus_error_is_set (&error))
......@@ -195,7 +201,7 @@ void get_networks_of_type (DBusConnection *connection, NMNetworkType type)
g_strfreev (networks);
}
void get_user_key_for_network (DBusConnection *connection)
static void get_user_key_for_network (DBusConnection *connection)
{
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;
const char *device;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment