diff --git a/ChangeLog b/ChangeLog index 09538213d4..be253e6c78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-01-16 Robert Love + + * 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 * src/nm-device-802-11-wireless.c: argv[3], not argv[4]. Fix diff --git a/gnome/applet/applet.c b/gnome/applet/applet.c index 2b735a922f..2d3c391c23 100644 --- a/gnome/applet/applet.c +++ b/gnome/applet/applet.c @@ -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); } diff --git a/gnome/applet/eggtrayicon.c b/gnome/applet/eggtrayicon.c index 07ce5dfce0..c52fa0722f 100644 --- a/gnome/applet/eggtrayicon.c +++ b/gnome/applet/eggtrayicon.c @@ -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); diff --git a/gnome/applet/nm-gconf-wso-wep.c b/gnome/applet/nm-gconf-wso-wep.c index a3556b492c..96149bf998 100644 --- a/gnome/applet/nm-gconf-wso-wep.c +++ b/gnome/applet/nm-gconf-wso-wep.c @@ -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; } diff --git a/gnome/applet/nm-gconf-wso-wpa-psk.c b/gnome/applet/nm-gconf-wso-wpa-psk.c index 8b0cf13f07..3526a7a6fd 100644 --- a/gnome/applet/nm-gconf-wso-wpa-psk.c +++ b/gnome/applet/nm-gconf-wso-wpa-psk.c @@ -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; } diff --git a/gnome/applet/nm-gconf-wso.c b/gnome/applet/nm-gconf-wso.c index d7b77450b8..582856f985 100644 --- a/gnome/applet/nm-gconf-wso.c +++ b/gnome/applet/nm-gconf-wso.c @@ -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; } diff --git a/gnome/vpn-properties/nm-vpn-properties.c b/gnome/vpn-properties/nm-vpn-properties.c index 952b151905..c36bb9b17a 100644 --- a/gnome/vpn-properties/nm-vpn-properties.c +++ b/gnome/vpn-properties/nm-vpn-properties.c @@ -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); diff --git a/src/nm-ap-security-wep.c b/src/nm-ap-security-wep.c index 09672fd649..59f9c959c1 100644 --- a/src/nm-ap-security-wep.c +++ b/src/nm-ap-security-wep.c @@ -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; } diff --git a/src/nm-ap-security-wpa-psk.c b/src/nm-ap-security-wpa-psk.c index 42001eb184..1528c2f1d1 100644 --- a/src/nm-ap-security-wpa-psk.c +++ b/src/nm-ap-security-wpa-psk.c @@ -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; } diff --git a/src/nm-ap-security.c b/src/nm-ap-security.c index 7311b9af7d..da349aa5f1 100644 --- a/src/nm-ap-security.c +++ b/src/nm-ap-security.c @@ -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; } diff --git a/src/nm-device-802-11-wireless.c b/src/nm-device-802-11-wireless.c index 4e1de2405e..21c929d245 100644 --- a/src/nm-device-802-11-wireless.c +++ b/src/nm-device-802-11-wireless.c @@ -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", diff --git a/src/nm-device-802-3-ethernet.c b/src/nm-device-802-3-ethernet.c index fba24cb337..614f6d7011 100644 --- a/src/nm-device-802-3-ethernet.c +++ b/src/nm-device-802-3-ethernet.c @@ -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", diff --git a/src/nm-device.c b/src/nm-device.c index c8e8ca2166..4e4d3cd278 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -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", diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index d581e84885..98e9c17967 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -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;