Commit 0402864d authored by Colin Walters's avatar Colin Walters Committed by Colin Walters
Browse files

2004-12-01 Colin Walters <walters@redhat.com>

	* configure.in: Suck in gcc warnings code from Rhythmbox,
	but use fewer default flags, and in particular add -Wno-unused,
	since the codebase has a lot of unused variables.

	* test/nmtestdevices.c (create_device):
	* test/nminfotest.c (get_network_string_property)
	(get_networks_of_type):
	* test/nmclienttest.c (main):
	* src/NetworkManagerDbus.c (nm_dbus_create_error_message):
	* initscript/NMLaunchHelper.c (get_nm_status):
	* info-daemon/NetworkManagerInfoPassphraseDialog.c (update_button_cb):
	* info-daemon/NetworkManagerInfoDbus.c (nmi_dbus_create_error_message):
	Fix declarations after statements.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@331 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent 9507950c
2004-12-01 Colin Walters <walters@redhat.com>
* configure.in: Suck in gcc warnings code from Rhythmbox,
but use fewer default flags, and in particular add -Wno-unused,
since the codebase has a lot of unused variables.
* test/nmtestdevices.c (create_device):
* test/nminfotest.c (get_network_string_property)
(get_networks_of_type):
* test/nmclienttest.c (main):
* src/NetworkManagerDbus.c (nm_dbus_create_error_message):
* initscript/NMLaunchHelper.c (get_nm_status):
* info-daemon/NetworkManagerInfoPassphraseDialog.c (update_button_cb):
* info-daemon/NetworkManagerInfoDbus.c (nmi_dbus_create_error_message):
Fix declarations after statements.
2004-12-01 Colin Walters <walters@redhat.com>
* info-daemon/NetworkManagerInfoDbus.c (nmi_dbus_return_vpn_password): New method.
......
......@@ -189,6 +189,39 @@ AC_DEFINE_UNQUOTED(EXPANDED_BINDIR, "$EXPANDED_BINDIR", [Where the executables a
prefix=$old_prefix
exec_prefix=$old_exec_prefix
AC_ARG_ENABLE(more-warnings,
[ --enable-more-warnings Maximum compiler warnings],
set_more_warnings="$enableval",[
if test -d "$srcdir/{arch}" || test -d "$srcdir/CVS"; then
set_more_warnings=yes
else
set_more_warnings=no
fi
])
AC_MSG_CHECKING(for more warnings, including -Werror)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
for option in -Wno-unused -Wno-strict-aliasing -Wno-sign-compare -Wdeclaration-after-statement; do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option"
AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,
has_option=no,)
if test $has_option = no; then
CFLAGS="$SAVE_CFLAGS"
fi
AC_MSG_RESULT($has_option)
unset has_option
unset SAVE_CFLAGS
done
unset option
else
AC_MSG_RESULT(no)
fi
AC_OUTPUT([
Makefile
src/Makefile
......
......@@ -77,6 +77,7 @@ inline gboolean nmi_network_type_valid (NMNetworkType type)
static DBusMessage *nmi_dbus_create_error_message (DBusMessage *message, const char *exception_namespace,
const char *exception, const char *format, ...)
{
char *exception_text;
DBusMessage *reply_message;
va_list args;
char error_text[512];
......@@ -86,7 +87,7 @@ static DBusMessage *nmi_dbus_create_error_message (DBusMessage *message, const c
vsnprintf (error_text, 512, format, args);
va_end (args);
char *exception_text = g_strdup_printf ("%s.%s", exception_namespace, exception);
exception_text = g_strdup_printf ("%s.%s", exception_namespace, exception);
reply_message = dbus_message_new_error (message, exception_text, error_text);
g_free (exception_text);
......
......@@ -48,14 +48,18 @@ enum NMIPassphraseDialogKeyTypes
static void update_button_cb (GtkWidget *widget, GladeXML *xml)
{
GtkButton *button;
GtkComboBox *combo;
GtkEntry *passphrase_entry;
const char *passphrase_text;
gboolean enable = TRUE;
g_return_if_fail (xml != NULL);
GtkButton *button = GTK_BUTTON (glade_xml_get_widget (xml, "login_button"));
GtkComboBox *combo = GTK_COMBO_BOX (glade_xml_get_widget (xml, "key_type_combo"));
GtkEntry *passphrase_entry = GTK_ENTRY (glade_xml_get_widget (xml, "passphrase_entry"));
const char *passphrase_text = gtk_entry_get_text (passphrase_entry);
button = GTK_BUTTON (glade_xml_get_widget (xml, "login_button"));
combo = GTK_COMBO_BOX (glade_xml_get_widget (xml, "key_type_combo"));
passphrase_entry = GTK_ENTRY (glade_xml_get_widget (xml, "passphrase_entry"));
passphrase_text = gtk_entry_get_text (passphrase_entry);
if (passphrase_text[0] == '\000')
enable = FALSE;
......
......@@ -41,6 +41,7 @@ void get_nm_status (DBusConnection *connection)
DBusMessage *reply;
DBusMessageIter iter;
DBusError error;
char *string;
message = dbus_message_new_method_call ("org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager",
......@@ -70,7 +71,6 @@ void get_nm_status (DBusConnection *connection)
/* now analyze reply */
dbus_message_iter_init (reply, &iter);
char *string;
string = dbus_message_iter_get_string (&iter);
if (!string)
{
......
......@@ -46,6 +46,7 @@ static int test_dev_num = 0;
static DBusMessage *nm_dbus_create_error_message (DBusMessage *message, const char *exception_namespace,
const char *exception, const char *format, ...)
{
char *exception_text;
DBusMessage *reply_message;
va_list args;
char error_text[512];
......@@ -55,7 +56,7 @@ static DBusMessage *nm_dbus_create_error_message (DBusMessage *message, const ch
vsnprintf (error_text, 512, format, args);
va_end (args);
char *exception_text = g_strdup_printf ("%s.%s", exception_namespace, exception);
exception_text = g_strdup_printf ("%s.%s", exception_namespace, exception);
reply_message = dbus_message_new_error (message, exception_text, error_text);
g_free (exception_text);
......
......@@ -351,6 +351,8 @@ int main( int argc, char *argv[] )
{
DBusConnection *connection;
DBusError error;
char *path;
char *status;
g_type_init ();
......@@ -363,9 +365,6 @@ int main( int argc, char *argv[] )
return 1;
}
char *path;
char *status;
status = get_nm_status (connection);
if (!status)
{
......
......@@ -36,6 +36,7 @@ char * get_network_string_property (DBusConnection *connection, char *network, c
DBusMessage *reply;
DBusMessageIter iter;
DBusError error;
char *string, *ret_string;
message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH, NMI_DBUS_INTERFACE, method);
if (message == NULL)
......@@ -63,7 +64,6 @@ char * get_network_string_property (DBusConnection *connection, char *network, c
/* now analyze reply */
dbus_message_iter_init (reply, &iter);
char *string, *ret_string;
string = dbus_message_iter_get_string (&iter);
if (!string)
{
......@@ -85,6 +85,7 @@ gboolean get_network_trusted (DBusConnection *connection, char *network, NMNetwo
DBusMessage *reply;
DBusMessageIter iter;
DBusError error;
gboolean trusted = FALSE;
g_return_val_if_fail (connection != NULL, -1);
g_return_val_if_fail (network != NULL, -1);
......@@ -114,7 +115,6 @@ gboolean get_network_trusted (DBusConnection *connection, char *network, NMNetwo
}
/* now analyze reply */
gboolean trusted = FALSE;
dbus_error_init (&error);
if (!dbus_message_get_args (reply, &error, DBUS_TYPE_BOOLEAN, &trusted, DBUS_TYPE_INVALID))
trusted = FALSE;
......@@ -134,6 +134,9 @@ void get_networks_of_type (DBusConnection *connection, NMNetworkType type)
DBusMessage *reply;
DBusMessageIter iter;
DBusError error;
char **networks;
int num_networks;
int i;
message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH, NMI_DBUS_INTERFACE, "getNetworks");
if (message == NULL)
......@@ -161,9 +164,6 @@ void get_networks_of_type (DBusConnection *connection, NMNetworkType type)
/* now analyze reply */
dbus_message_iter_init (reply, &iter);
char **networks;
int num_networks;
if (!dbus_message_iter_get_string_array (&iter, &networks, &num_networks))
{
fprintf (stderr, "NetworkManagerInfo returned no network list" );
......@@ -176,7 +176,6 @@ void get_networks_of_type (DBusConnection *connection, NMNetworkType type)
if (!networks)
fprintf( stderr, "No networks found\n" );
int i;
fprintf( stderr, "Networks of type %d:\n", type );
for (i = 0; i < num_networks; i++)
{
......
......@@ -36,6 +36,7 @@ void create_device (DBusConnection *connection, NMDeviceType type)
DBusMessage *reply;
DBusMessageIter iter;
DBusError error;
char *string;
g_return_if_fail (connection != NULL);
g_return_if_fail (((type == DEVICE_TYPE_WIRED_ETHERNET) || (type == DEVICE_TYPE_WIRELESS_ETHERNET)));
......@@ -67,7 +68,6 @@ void create_device (DBusConnection *connection, NMDeviceType type)
/* now analyze reply */
dbus_message_iter_init (reply, &iter);
char *string;
string = dbus_message_iter_get_string (&iter);
if (!string)
{
......
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