2006-01-16 Robert Love <rml@novell.com>

* gnome/applet/eggtrayicon.c, src/nm-device.c, src/nm-ap-security.c,
	  gnome/applet/nm-gconf-wso-wep.c, gnome/applet/nm-gconf-wso-wpa-psk.c,
	  gnome/applet/nm-gconf-wso.c, src/nm-device-802-3-ethernet.c,
	  gnome/vpn-properties/nm-vpn-properties.c, src/nm-ap-security-wep.c,
	  src/nm-ap-security-wpa-psk.c, src/nm-device-802-11-wireless.c,
	  src/nm-netlink-monitor.c: Don't miss any initializers on structure
	  declarations, ever.
	* gnome/applet/applet.c: Remove useless check (NMState is unsigned and
	  NM_STATE_DISCONNECTED is zero).


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1351 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Robert Love 2006-01-17 18:22:56 +00:00 committed by Robert Love
parent f8fa67c46e
commit 8eb99d62fc
14 changed files with 99 additions and 74 deletions

View file

@ -1,3 +1,15 @@
2006-01-16 Robert Love <rml@novell.com>
* gnome/applet/eggtrayicon.c, src/nm-device.c, src/nm-ap-security.c,
gnome/applet/nm-gconf-wso-wep.c, gnome/applet/nm-gconf-wso-wpa-psk.c,
gnome/applet/nm-gconf-wso.c, src/nm-device-802-3-ethernet.c,
gnome/vpn-properties/nm-vpn-properties.c, src/nm-ap-security-wep.c,
src/nm-ap-security-wpa-psk.c, src/nm-device-802-11-wireless.c,
src/nm-netlink-monitor.c: Don't miss any initializers on structure
declarations, ever.
* gnome/applet/applet.c: Remove useless check (NMState is unsigned and
NM_STATE_DISCONNECTED is zero).
2006-01-16 Robert Love <rml@novell.com>
* src/nm-device-802-11-wireless.c: argv[3], not argv[4]. Fix

View file

@ -2158,7 +2158,7 @@ static inline void nmwa_enable_networking_set_active (NMWirelessApplet *applet)
void nmwa_set_state (NMWirelessApplet *applet, enum NMState state)
{
g_return_if_fail (applet != NULL);
g_return_if_fail (state >= NM_STATE_UNKNOWN && state <= NM_STATE_DISCONNECTED);
g_return_if_fail (state <= NM_STATE_DISCONNECTED);
applet->nm_state = state;
nmwa_enable_networking_set_active (applet);
}

View file

@ -90,7 +90,8 @@ egg_tray_icon_get_type (void)
NULL, /* class_data */
sizeof (EggTrayIcon),
0, /* n_preallocs */
(GInstanceInitFunc) egg_tray_icon_init
(GInstanceInitFunc) egg_tray_icon_init,
NULL /* value_table */
};
our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0);

View file

@ -147,18 +147,19 @@ nm_gconf_wso_wep_get_type (void)
if (type == 0) {
static const GTypeInfo info = {
sizeof (NMGConfWSOWEPClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) nm_gconf_wso_wep_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NMGConfWSOWEP),
0, /* n_preallocs */
(GInstanceInitFunc) nm_gconf_wso_wep_init
0, /* n_preallocs */
(GInstanceInitFunc) nm_gconf_wso_wep_init,
NULL /* value_table */
};
type = g_type_register_static (NM_TYPE_GCONF_WSO,
"NMGConfWSOWEP",
&info, 0);
"NMGConfWSOWEP",
&info, 0);
}
return type;
}

View file

@ -164,18 +164,19 @@ nm_gconf_wso_wpa_psk_get_type (void)
if (type == 0) {
static const GTypeInfo info = {
sizeof (NMGConfWSOWPA_PSKClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) nm_gconf_wso_wpa_psk_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NMGConfWSOWPA_PSK),
0, /* n_preallocs */
(GInstanceInitFunc) nm_gconf_wso_wpa_psk_init
0, /* n_preallocs */
(GInstanceInitFunc) nm_gconf_wso_wpa_psk_init,
NULL /* value_table */
};
type = g_type_register_static (NM_TYPE_GCONF_WSO,
"NMGConfWSOWPA_PSK",
&info, 0);
"NMGConfWSOWPA_PSK",
&info, 0);
}
return type;
}

View file

@ -348,18 +348,19 @@ nm_gconf_wso_get_type (void)
if (type == 0) {
static const GTypeInfo info = {
sizeof (NMGConfWSOClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) nm_gconf_wso_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NMGConfWSO),
0, /* n_preallocs */
(GInstanceInitFunc) nm_gconf_wso_init
0, /* n_preallocs */
(GInstanceInitFunc) nm_gconf_wso_init,
NULL /* value_table */
};
type = g_type_register_static (G_TYPE_OBJECT,
"NMGConfWSO",
&info, 0);
"NMGConfWSO",
&info, 0);
}
return type;
}

View file

@ -1071,9 +1071,9 @@ main (int argc, char *argv[])
static gchar *import_file = NULL;
static GOptionEntry entries[] =
{
{ "import-service", 's', 0,G_OPTION_ARG_STRING, &import_svc, "VPN Service for importing", NULL},
{ "import-service", 's', 0, G_OPTION_ARG_STRING, &import_svc, "VPN Service for importing", NULL},
{ "import-file", 'f', 0, G_OPTION_ARG_STRING, &import_file, "File to import", NULL},
{ NULL }
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
bindtextdomain (GETTEXT_PACKAGE, NULL);

View file

@ -191,18 +191,19 @@ nm_ap_security_wep_get_type (void)
if (type == 0) {
static const GTypeInfo info = {
sizeof (NMAPSecurityWEPClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) nm_ap_security_wep_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NMAPSecurityWEP),
0, /* n_preallocs */
(GInstanceInitFunc) nm_ap_security_wep_init
0, /* n_preallocs */
(GInstanceInitFunc) nm_ap_security_wep_init,
NULL /* value_table */
};
type = g_type_register_static (NM_TYPE_AP_SECURITY,
"NMAPSecurityWEP",
&info, 0);
"NMAPSecurityWEP",
&info, 0);
}
return type;
}

View file

@ -244,18 +244,19 @@ nm_ap_security_wpa_psk_get_type (void)
if (type == 0) {
static const GTypeInfo info = {
sizeof (NMAPSecurityWPA_PSKClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) nm_ap_security_wpa_psk_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NMAPSecurityWPA_PSK),
0, /* n_preallocs */
(GInstanceInitFunc) nm_ap_security_wpa_psk_init
0, /* n_preallocs */
(GInstanceInitFunc) nm_ap_security_wpa_psk_init,
NULL /* value_table */
};
type = g_type_register_static (NM_TYPE_AP_SECURITY,
"NMAPSecurityWPA_PSK",
&info, 0);
"NMAPSecurityWPA_PSK",
&info, 0);
}
return type;
}

View file

@ -377,18 +377,20 @@ nm_ap_security_get_type (void)
if (type == 0) {
static const GTypeInfo info = {
sizeof (NMAPSecurityClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) nm_ap_security_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NMAPSecurity),
0, /* n_preallocs */
(GInstanceInitFunc) nm_ap_security_init
0, /* n_preallocs */
(GInstanceInitFunc) nm_ap_security_init,
NULL /* value_table */
};
type = g_type_register_static (G_TYPE_OBJECT,
"NMAPSecurity",
&info, 0);
"NMAPSecurity",
&info, 0);
}
return type;
}

View file

@ -2905,14 +2905,15 @@ nm_device_802_11_wireless_get_type (void)
static const GTypeInfo info =
{
sizeof (NMDevice80211WirelessClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) nm_device_802_11_wireless_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NMDevice80211Wireless),
0, /* n_preallocs */
(GInstanceInitFunc) nm_device_802_11_wireless_init
0, /* n_preallocs */
(GInstanceInitFunc) nm_device_802_11_wireless_init,
NULL /* value_table */
};
type = g_type_register_static (NM_TYPE_DEVICE,
"NMDevice80211Wireless",

View file

@ -293,14 +293,15 @@ nm_device_802_3_ethernet_get_type (void)
static const GTypeInfo info =
{
sizeof (NMDevice8023EthernetClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) nm_device_802_3_ethernet_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NMDevice8023Ethernet),
0, /* n_preallocs */
(GInstanceInitFunc) nm_device_802_3_ethernet_init
0, /* n_preallocs */
(GInstanceInitFunc) nm_device_802_3_ethernet_init,
NULL /* value_table */
};
type = g_type_register_static (NM_TYPE_DEVICE,
"NMDevice8023Ethernet",

View file

@ -1977,14 +1977,15 @@ nm_device_get_type (void)
static const GTypeInfo info =
{
sizeof (NMDeviceClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) nm_device_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NMDevice),
0, /* n_preallocs */
(GInstanceInitFunc) nm_device_init
0, /* n_preallocs */
(GInstanceInitFunc) nm_device_init,
NULL /* value_table */
};
type = g_type_register_static (G_TYPE_OBJECT,
"NMDevice",

View file

@ -136,7 +136,7 @@ gboolean
nm_netlink_monitor_open_connection (NmNetlinkMonitor *monitor,
GError **error)
{
struct sockaddr_nl monitor_address = { 0 };
struct sockaddr_nl monitor_address = { .nl_family = 0 };
int fd, saved_errno;
GError *channel_error;
GIOFlags channel_flags;
@ -323,8 +323,9 @@ nm_netlink_monitor_request_status (NmNetlinkMonitor *monitor,
struct nlmsghdr header;
struct rtgenmsg request;
} NmNetlinkMonitorStatusPacket;
NmNetlinkMonitorStatusPacket packet = { { 0 } };
struct sockaddr_nl recipient = { 0 };
NmNetlinkMonitorStatusPacket packet;
struct sockaddr_nl recipient = { .nl_pad = 0 };
static guint32 sequence_number;
int fd, saved_errno;
ssize_t num_bytes_sent;
@ -339,6 +340,7 @@ nm_netlink_monitor_request_status (NmNetlinkMonitor *monitor,
recipient.nl_pid = 0; /* going to kernel */
recipient.nl_groups = RTMGRP_LINK;
memset (&packet, 0, sizeof (NmNetlinkMonitorStatusPacket));
packet.header.nlmsg_len = NLMSG_LENGTH (sizeof (struct rtgenmsg));
packet.header.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
packet.header.nlmsg_type = RTM_GETLINK;
@ -432,7 +434,7 @@ receive_pending_bytes (GIOChannel *channel,
GString *pending_bytes;
ssize_t num_bytes_read;
gboolean succeeded;
struct sockaddr_nl sender = { 0 };
struct sockaddr_nl sender = { .nl_pad = 0 };
gchar buffer[4096];
static const size_t buffer_capacity = (size_t) sizeof (buffer);
socklen_t sender_size;