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>
* system-settings/*

View file

@ -43,7 +43,7 @@
* @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)
{
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
*
*/
dbus_bool_t wpa_dbus_dict_close_write(DBusMessageIter *iter,
static dbus_bool_t wpa_dbus_dict_close_write(DBusMessageIter *iter,
DBusMessageIter *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
*
*/
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 *value,
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};
dbus_bool_t
static dbus_bool_t
build_message (DBusMessage * message)
{
char ** env = NULL;
@ -229,7 +229,7 @@ out:
return success;
}
DBusConnection *
static DBusConnection *
dbus_init (void)
{
DBusConnection * connection;

View file

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

View file

@ -7,6 +7,7 @@ struct _NMParamSpecSpecialized {
};
#include <string.h>
#include <math.h>
#include <dbus/dbus-glib.h>
/***********************************************************/
@ -35,6 +36,8 @@ type_is_fixed_size (GType type)
}
}
#define FLOAT_FACTOR 0.00000001
static gint
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: {
gfloat val1 = g_value_get_float (value1);
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;
break;
}
case G_TYPE_DOUBLE: {
gdouble val1 = g_value_get_double (value1);
gdouble val2 = g_value_get_double (value2);
if (val1 != val2)
if (fabs (val1 - val2) > FLOAT_FACTOR)
ret = val1 < val2 ? -1 : val1 > val2;
break;
}

View file

@ -27,6 +27,7 @@
#include <errno.h>
#include <iwlib.h>
#include <wireless.h>
#include <arpa/inet.h>
#include <glib.h>
#include <glib-object.h>
@ -329,7 +330,7 @@ value_destroy (gpointer data)
static void
value_dup (gpointer key, gpointer val, gpointer user_data)
{
GHashTable *dup = (GHashTable *) user_data;
GHashTable *table = (GHashTable *) user_data;
GValue *value = (GValue *) val;
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_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 *
nm_utils_gvalue_hash_dup (GHashTable *hash)
{
GHashTable *dup;
GHashTable *table;
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,
value_destroy);
g_hash_table_foreach (hash, value_dup, dup);
g_hash_table_foreach (hash, value_dup, table);
return dup;
return table;
}
char *

View file

@ -799,12 +799,6 @@ nm_named_manager_finalize (GObject *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
nm_named_manager_class_init (NMNamedManagerClass *klass)
{

View file

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

View file

@ -171,7 +171,7 @@ nm_supplicant_config_add_blob (NMSupplicantConfig *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) {
nm_debug ("Key '%s' and/or it's contained value is invalid.", key);
return FALSE;
@ -272,7 +272,7 @@ get_hash_cb (gpointer key, gpointer value, gpointer user_data)
break;
case TYPE_BYTES:
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_set_boxed (variant, array);
g_byte_array_free (array, TRUE);

View file

@ -141,7 +141,7 @@ typedef struct {
DBusGProxyCall *call;
} NMSupplicantInfo;
NMSupplicantInfo *
static NMSupplicantInfo *
nm_supplicant_info_new (NMSupplicantInterface *interface,
DBusGProxy *proxy,
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_name (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,
NMVPNConnectionStateReason reason);
void nm_vpn_connection_disconnect (NMVPNConnection *connection,