2007-11-26 Dan Williams <dcbw@redhat.com>

* Fix warnings so everything compiles with --enable-more-warnings



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3108 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2007-11-26 16:59:47 +00:00
parent 9bcfe25991
commit 6076621fd0
10 changed files with 64 additions and 57 deletions

View File

@@ -1,3 +1,7 @@
2007-11-26 Dan Williams <dcbw@redhat.com>
* Fix warnings so everything compiles with --enable-more-warnings
2007-11-25 Dan Williams <dcbw@redhat.com> 2007-11-25 Dan Williams <dcbw@redhat.com>
* system-settings/* * system-settings/*

View File

@@ -43,7 +43,7 @@
* @return TRUE on success, FALSE on failure * @return TRUE on success, FALSE on failure
* *
*/ */
dbus_bool_t wpa_dbus_dict_open_write(DBusMessageIter *iter, static dbus_bool_t wpa_dbus_dict_open_write(DBusMessageIter *iter,
DBusMessageIter *iter_dict) DBusMessageIter *iter_dict)
{ {
dbus_bool_t result; dbus_bool_t result;
@@ -73,7 +73,7 @@ dbus_bool_t wpa_dbus_dict_open_write(DBusMessageIter *iter,
* @return TRUE on success, FALSE on failure * @return TRUE on success, FALSE on failure
* *
*/ */
dbus_bool_t wpa_dbus_dict_close_write(DBusMessageIter *iter, static dbus_bool_t wpa_dbus_dict_close_write(DBusMessageIter *iter,
DBusMessageIter *iter_dict) DBusMessageIter *iter_dict)
{ {
if (!iter || !iter_dict) if (!iter || !iter_dict)
@@ -162,7 +162,7 @@ static dbus_bool_t _wpa_dbus_add_dict_entry_byte_array(
* @return TRUE on success, FALSE on failure * @return TRUE on success, FALSE on failure
* *
*/ */
dbus_bool_t wpa_dbus_dict_append_byte_array(DBusMessageIter *iter_dict, static dbus_bool_t wpa_dbus_dict_append_byte_array(DBusMessageIter *iter_dict,
const char *key, const char *key,
const char *value, const char *value,
const dbus_uint32_t value_len) const dbus_uint32_t value_len)
@@ -178,7 +178,7 @@ dbus_bool_t wpa_dbus_dict_append_byte_array(DBusMessageIter *iter_dict,
static const char * ignore[] = {"PATH", "SHLVL", "_", "PWD", "dhc_dbus", NULL}; static const char * ignore[] = {"PATH", "SHLVL", "_", "PWD", "dhc_dbus", NULL};
dbus_bool_t static dbus_bool_t
build_message (DBusMessage * message) build_message (DBusMessage * message)
{ {
char ** env = NULL; char ** env = NULL;
@@ -229,7 +229,7 @@ out:
return success; return success;
} }
DBusConnection * static DBusConnection *
dbus_init (void) dbus_init (void)
{ {
DBusConnection * connection; DBusConnection * connection;

View File

@@ -174,7 +174,7 @@ nm_object_get_path (NMObject *object)
} }
/* Stolen from dbus-glib */ /* Stolen from dbus-glib */
char* static char*
wincaps_to_uscore (const char *caps) wincaps_to_uscore (const char *caps)
{ {
const char *p; const char *p;

View File

@@ -7,6 +7,7 @@ struct _NMParamSpecSpecialized {
}; };
#include <string.h> #include <string.h>
#include <math.h>
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
/***********************************************************/ /***********************************************************/
@@ -35,6 +36,8 @@ type_is_fixed_size (GType type)
} }
} }
#define FLOAT_FACTOR 0.00000001
static gint static gint
nm_gvalues_compare_fixed (const GValue *value1, const GValue *value2) nm_gvalues_compare_fixed (const GValue *value1, const GValue *value2)
{ {
@@ -107,14 +110,15 @@ nm_gvalues_compare_fixed (const GValue *value1, const GValue *value2)
case G_TYPE_FLOAT: { case G_TYPE_FLOAT: {
gfloat val1 = g_value_get_float (value1); gfloat val1 = g_value_get_float (value1);
gfloat val2 = g_value_get_float (value2); gfloat val2 = g_value_get_float (value2);
if (val1 != val2) /* Can't use == or != here due to inexactness of FP */
if (fabsf (val1 - val2) > FLOAT_FACTOR)
ret = val1 < val2 ? -1 : val1 > val2; ret = val1 < val2 ? -1 : val1 > val2;
break; break;
} }
case G_TYPE_DOUBLE: { case G_TYPE_DOUBLE: {
gdouble val1 = g_value_get_double (value1); gdouble val1 = g_value_get_double (value1);
gdouble val2 = g_value_get_double (value2); gdouble val2 = g_value_get_double (value2);
if (val1 != val2) if (fabs (val1 - val2) > FLOAT_FACTOR)
ret = val1 < val2 ? -1 : val1 > val2; ret = val1 < val2 ? -1 : val1 > val2;
break; break;
} }

View File

@@ -27,6 +27,7 @@
#include <errno.h> #include <errno.h>
#include <iwlib.h> #include <iwlib.h>
#include <wireless.h> #include <wireless.h>
#include <arpa/inet.h>
#include <glib.h> #include <glib.h>
#include <glib-object.h> #include <glib-object.h>
@@ -329,7 +330,7 @@ value_destroy (gpointer data)
static void static void
value_dup (gpointer key, gpointer val, gpointer user_data) value_dup (gpointer key, gpointer val, gpointer user_data)
{ {
GHashTable *dup = (GHashTable *) user_data; GHashTable *table = (GHashTable *) user_data;
GValue *value = (GValue *) val; GValue *value = (GValue *) val;
GValue *dup_value; GValue *dup_value;
@@ -337,23 +338,23 @@ value_dup (gpointer key, gpointer val, gpointer user_data)
g_value_init (dup_value, G_VALUE_TYPE (val)); g_value_init (dup_value, G_VALUE_TYPE (val));
g_value_copy (value, dup_value); g_value_copy (value, dup_value);
g_hash_table_insert (dup, g_strdup ((char *) key), dup_value); g_hash_table_insert (table, g_strdup ((char *) key), dup_value);
} }
GHashTable * GHashTable *
nm_utils_gvalue_hash_dup (GHashTable *hash) nm_utils_gvalue_hash_dup (GHashTable *hash)
{ {
GHashTable *dup; GHashTable *table;
g_return_val_if_fail (hash != NULL, NULL); g_return_val_if_fail (hash != NULL, NULL);
dup = g_hash_table_new_full (g_str_hash, g_str_equal, table = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free, (GDestroyNotify) g_free,
value_destroy); value_destroy);
g_hash_table_foreach (hash, value_dup, dup); g_hash_table_foreach (hash, value_dup, table);
return dup; return table;
} }
char * char *

View File

@@ -799,12 +799,6 @@ nm_named_manager_finalize (GObject *object)
G_OBJECT_CLASS (nm_named_manager_parent_class)->finalize (object); G_OBJECT_CLASS (nm_named_manager_parent_class)->finalize (object);
} }
NMNamedManager *
nm_named_manager_new (void)
{
return NM_NAMED_MANAGER (g_object_new (NM_TYPE_NAMED_MANAGER, NULL));
}
static void static void
nm_named_manager_class_init (NMNamedManagerClass *klass) nm_named_manager_class_init (NMNamedManagerClass *klass)
{ {

View File

@@ -14,6 +14,9 @@
#include "nm-ppp-status.h" #include "nm-ppp-status.h"
#include "nm-pppd-plugin-glue.h" #include "nm-pppd-plugin-glue.h"
GType nm_pppd_plugin_get_type (void);
int plugin_init (void);
char pppd_version[] = VERSION; char pppd_version[] = VERSION;
#define NM_TYPE_PPPD_PLUGIN (nm_pppd_plugin_get_type ()) #define NM_TYPE_PPPD_PLUGIN (nm_pppd_plugin_get_type ())
@@ -115,9 +118,9 @@ nm_pppd_plugin_new (DBusGConnection *bus)
} }
static void static void
nm_pppd_plugin_state_changed (NMPppdPlugin *plugin, NMPPPStatus status) nm_pppd_plugin_state_changed (NMPppdPlugin *plugin, NMPPPStatus ppp_status)
{ {
g_signal_emit (plugin, signals[STATE_CHANGED], 0, status); g_signal_emit (plugin, signals[STATE_CHANGED], 0, ppp_status);
} }
static void static void
@@ -132,72 +135,72 @@ static void
nm_phasechange (void *data, int arg) nm_phasechange (void *data, int arg)
{ {
NMPppdPlugin *plugin = NM_PPPD_PLUGIN (data); NMPppdPlugin *plugin = NM_PPPD_PLUGIN (data);
NMPPPStatus status = NM_PPP_STATUS_UNKNOWN; NMPPPStatus ppp_status = NM_PPP_STATUS_UNKNOWN;
char *phase; char *ppp_phase;
switch (arg) { switch (arg) {
case PHASE_DEAD: case PHASE_DEAD:
status = NM_PPP_STATUS_DEAD; ppp_status = NM_PPP_STATUS_DEAD;
phase = "dead"; ppp_phase = "dead";
break; break;
case PHASE_INITIALIZE: case PHASE_INITIALIZE:
status = NM_PPP_STATUS_INITIALIZE; ppp_status = NM_PPP_STATUS_INITIALIZE;
phase = "initialize"; ppp_phase = "initialize";
break; break;
case PHASE_SERIALCONN: case PHASE_SERIALCONN:
status = NM_PPP_STATUS_SERIALCONN; ppp_status = NM_PPP_STATUS_SERIALCONN;
phase = "serial connection"; ppp_phase = "serial connection";
break; break;
case PHASE_DORMANT: case PHASE_DORMANT:
status = NM_PPP_STATUS_DORMANT; ppp_status = NM_PPP_STATUS_DORMANT;
phase = "dormant"; ppp_phase = "dormant";
break; break;
case PHASE_ESTABLISH: case PHASE_ESTABLISH:
status = NM_PPP_STATUS_ESTABLISH; ppp_status = NM_PPP_STATUS_ESTABLISH;
phase = "establish"; ppp_phase = "establish";
break; break;
case PHASE_AUTHENTICATE: case PHASE_AUTHENTICATE:
status = NM_PPP_STATUS_AUTHENTICATE; ppp_status = NM_PPP_STATUS_AUTHENTICATE;
phase = "authenticate"; ppp_phase = "authenticate";
break; break;
case PHASE_CALLBACK: case PHASE_CALLBACK:
status = NM_PPP_STATUS_CALLBACK; ppp_status = NM_PPP_STATUS_CALLBACK;
phase = "callback"; ppp_phase = "callback";
break; break;
case PHASE_NETWORK: case PHASE_NETWORK:
status = NM_PPP_STATUS_NETWORK; ppp_status = NM_PPP_STATUS_NETWORK;
phase = "network"; ppp_phase = "network";
break; break;
case PHASE_RUNNING: case PHASE_RUNNING:
status = NM_PPP_STATUS_RUNNING; ppp_status = NM_PPP_STATUS_RUNNING;
phase = "running"; ppp_phase = "running";
break; break;
case PHASE_TERMINATE: case PHASE_TERMINATE:
status = NM_PPP_STATUS_TERMINATE; ppp_status = NM_PPP_STATUS_TERMINATE;
phase = "terminate"; ppp_phase = "terminate";
break; break;
case PHASE_DISCONNECT: case PHASE_DISCONNECT:
status = NM_PPP_STATUS_DISCONNECT; ppp_status = NM_PPP_STATUS_DISCONNECT;
phase = "disconnect"; ppp_phase = "disconnect";
break; break;
case PHASE_HOLDOFF: case PHASE_HOLDOFF:
status = NM_PPP_STATUS_HOLDOFF; ppp_status = NM_PPP_STATUS_HOLDOFF;
phase = "holdoff"; ppp_phase = "holdoff";
break; break;
case PHASE_MASTER: case PHASE_MASTER:
status = NM_PPP_STATUS_MASTER; ppp_status = NM_PPP_STATUS_MASTER;
phase = "master"; ppp_phase = "master";
break; break;
default: default:
phase = "unknown"; ppp_phase = "unknown";
break; break;
} }
g_message ("pppd reported new phase: %s", phase); g_message ("pppd reported new phase: %s", ppp_phase);
if (status != NM_PPP_STATUS_UNKNOWN) if (ppp_status != NM_PPP_STATUS_UNKNOWN)
nm_pppd_plugin_state_changed (plugin, status); nm_pppd_plugin_state_changed (plugin, ppp_status);
} }
static GValue * static GValue *

View File

@@ -171,7 +171,7 @@ nm_supplicant_config_add_blob (NMSupplicantConfig *self,
priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self); priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self);
type = nm_supplicant_settings_verify_setting (key, value->data, value->len); type = nm_supplicant_settings_verify_setting (key, (const char *) value->data, value->len);
if (type == TYPE_INVALID) { if (type == TYPE_INVALID) {
nm_debug ("Key '%s' and/or it's contained value is invalid.", key); nm_debug ("Key '%s' and/or it's contained value is invalid.", key);
return FALSE; return FALSE;
@@ -272,7 +272,7 @@ get_hash_cb (gpointer key, gpointer value, gpointer user_data)
break; break;
case TYPE_BYTES: case TYPE_BYTES:
array = g_byte_array_sized_new (opt->len); array = g_byte_array_sized_new (opt->len);
g_byte_array_append (array, opt->value, opt->len); g_byte_array_append (array, (const guint8 *) opt->value, opt->len);
g_value_init (variant, DBUS_TYPE_G_UCHAR_ARRAY); g_value_init (variant, DBUS_TYPE_G_UCHAR_ARRAY);
g_value_set_boxed (variant, array); g_value_set_boxed (variant, array);
g_byte_array_free (array, TRUE); g_byte_array_free (array, TRUE);

View File

@@ -141,7 +141,7 @@ typedef struct {
DBusGProxyCall *call; DBusGProxyCall *call;
} NMSupplicantInfo; } NMSupplicantInfo;
NMSupplicantInfo * static NMSupplicantInfo *
nm_supplicant_info_new (NMSupplicantInterface *interface, nm_supplicant_info_new (NMSupplicantInterface *interface,
DBusGProxy *proxy, DBusGProxy *proxy,
NMCallStore *store) NMCallStore *store)

View File

@@ -61,6 +61,7 @@ void nm_vpn_connection_activate (NMVPNConnection *connect
const char *nm_vpn_connection_get_object_path (NMVPNConnection *connection); const char *nm_vpn_connection_get_object_path (NMVPNConnection *connection);
const char *nm_vpn_connection_get_name (NMVPNConnection *connection); const char *nm_vpn_connection_get_name (NMVPNConnection *connection);
NMVPNConnectionState nm_vpn_connection_get_state (NMVPNConnection *connection); NMVPNConnectionState nm_vpn_connection_get_state (NMVPNConnection *connection);
const char * nm_vpn_connection_get_banner (NMVPNConnection *connection);
void nm_vpn_connection_fail (NMVPNConnection *connection, void nm_vpn_connection_fail (NMVPNConnection *connection,
NMVPNConnectionStateReason reason); NMVPNConnectionStateReason reason);
void nm_vpn_connection_disconnect (NMVPNConnection *connection, void nm_vpn_connection_disconnect (NMVPNConnection *connection,