diff --git a/sflphone-gtk/configure.ac b/sflphone-gtk/configure.ac index b1372e616df6d9be0f11fa38f1490b08f0f5e245..08d03b3859cf6880d082f09746137e0146c68850 100644 --- a/sflphone-gtk/configure.ac +++ b/sflphone-gtk/configure.ac @@ -15,7 +15,7 @@ AC_ARG_WITH(debug, [with_debug=no] ) if test "x$with_debug" = "xfull" -o "x$with_debug" = "xyes"; then - CFLAGS="$CFLAGS -g -DDEBUG -Wall" + CFLAGS="$CFLAGS -g -DDEBUG -Wall -Wextra" fi AC_PROG_CC diff --git a/sflphone-gtk/src/accountwindow.c b/sflphone-gtk/src/accountwindow.c index e6198eafca5b0483c89f1d423653dea743508d9d..e0bc3b1b27408ea6f1b016020ce184c4af1bc345 100644 --- a/sflphone-gtk/src/accountwindow.c +++ b/sflphone-gtk/src/accountwindow.c @@ -51,7 +51,7 @@ GtkWidget * entryMailbox; /* Signal to entryProtocol 'changed' */ void -change_protocol (account_t * currentAccount) +change_protocol (account_t * currentAccount UNUSED) { gchar* proto = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(entryProtocol)); //g_print("Protocol changed\n"); diff --git a/sflphone-gtk/src/assistant.c b/sflphone-gtk/src/assistant.c index 20c48e189e9b90fb97f28b26428ab66a0abeef07..613716e89ffe491601aa9e008e92b20a49b3f293 100644 --- a/sflphone-gtk/src/assistant.c +++ b/sflphone-gtk/src/assistant.c @@ -38,7 +38,7 @@ static gint forward_page_func( gint current_page , gpointer data ); static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, const gchar *section); void -set_account_type( GtkWidget* widget , gpointer data ) +set_account_type( GtkWidget* widget , gpointer data UNUSED ) { if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( widget )) ){ @@ -370,7 +370,7 @@ build_registration_error() } static gint -forward_page_func( gint current_page , gpointer data ) +forward_page_func( gint current_page , gpointer data UNUSED) { switch( current_page ){ case 0: diff --git a/sflphone-gtk/src/audioconf.c b/sflphone-gtk/src/audioconf.c index 18b1b4e7150151c1b4e34bc769402189b776d3c0..2ff1b9b9aac9b450f137eedc898d916e84277ce2 100644 --- a/sflphone-gtk/src/audioconf.c +++ b/sflphone-gtk/src/audioconf.c @@ -238,7 +238,7 @@ select_active_input_audio_device() * Select the output audio plugin by calling the server */ static void -select_output_audio_plugin(GtkComboBox* widget, gpointer data) +select_output_audio_plugin(GtkComboBox* widget, gpointer data UNUSED) { GtkTreeModel* model; GtkTreeIter iter; @@ -296,7 +296,7 @@ select_active_output_audio_plugin() * Set the audio output device on the server with its index */ static void -select_audio_output_device(GtkComboBox* comboBox, gpointer data) +select_audio_output_device(GtkComboBox* comboBox, gpointer data UNUSED) { GtkTreeModel* model; GtkTreeIter iter; @@ -319,7 +319,7 @@ select_audio_output_device(GtkComboBox* comboBox, gpointer data) * Set the audio input device on the server with its index */ static void -select_audio_input_device(GtkComboBox* comboBox, gpointer data) +select_audio_input_device(GtkComboBox* comboBox, gpointer data UNUSED) { GtkTreeModel* model; GtkTreeIter iter; @@ -363,7 +363,7 @@ select_codec(GtkTreeSelection *selection, GtkTreeModel *model) * and in configuration files */ static void -codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, gpointer data) +codec_active_toggled(GtkCellRendererToggle *renderer UNUSED, gchar *path, gpointer data ) { GtkTreeIter iter; GtkTreePath *treePath; @@ -467,7 +467,7 @@ codec_move(gboolean moveUp, gpointer data) * Called from move up codec button signal */ static void -codec_move_up(GtkButton *button, gpointer data) +codec_move_up(GtkButton *button UNUSED, gpointer data) { // Change tree view ordering and get indice changed codec_move(TRUE, data); @@ -477,7 +477,7 @@ codec_move_up(GtkButton *button, gpointer data) * Called from move down codec button signal */ static void -codec_move_down(GtkButton *button, gpointer data) +codec_move_down(GtkButton *button UNUSED, gpointer data) { // Change tree view ordering and get indice changed codec_move(FALSE, data); @@ -496,7 +496,7 @@ ringtone_enabled( void ) } void -ringtone_changed( GtkFileChooser *chooser , GtkLabel *label) +ringtone_changed( GtkFileChooser *chooser , GtkLabel *label UNUSED) { gchar* tone = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( chooser )); dbus_set_ringtone_choice( tone ); diff --git a/sflphone-gtk/src/calltree.c b/sflphone-gtk/src/calltree.c index 357a07185cdcc6479934bdcaf6ed40f7ad6ddc49..1281f9d53a3bcad1242217082c54054cf7952cb6 100644 --- a/sflphone-gtk/src/calltree.c +++ b/sflphone-gtk/src/calltree.c @@ -55,7 +55,7 @@ switch_tab() */ static gboolean popup_menu (GtkWidget *widget, - gpointer user_data) + gpointer user_data UNUSED) { show_popup_menu(widget, NULL); return TRUE; @@ -89,7 +89,7 @@ button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data) * Make a call */ static void -call_button( GtkWidget *widget, gpointer data ) +call_button( GtkWidget *widget UNUSED, gpointer data UNUSED) { call_t * selectedCall = call_get_selected(active_calltree); call_t* newCall = g_new0 (call_t, 1); @@ -132,7 +132,7 @@ call_button( GtkWidget *widget, gpointer data ) * Hang up the line */ static void -hang_up( GtkWidget *widget, gpointer data ) +hang_up( GtkWidget *widget UNUSED, gpointer data UNUSED) { sflphone_hang_up(); } @@ -141,7 +141,7 @@ hang_up( GtkWidget *widget, gpointer data ) * Hold the line */ static void -hold( GtkWidget *widget, gpointer data ) +hold( GtkWidget *widget UNUSED, gpointer data UNUSED) { sflphone_on_hold(); } @@ -151,7 +151,7 @@ hold( GtkWidget *widget, gpointer data ) */ static void transfert (GtkToggleToolButton *toggle_tool_button, - gpointer user_data) + gpointer user_data UNUSED ) { gboolean up = gtk_toggle_tool_button_get_active(toggle_tool_button); if(up) @@ -168,14 +168,14 @@ transfert (GtkToggleToolButton *toggle_tool_button, * Unhold call */ static void -unhold( GtkWidget *widget, gpointer data ) +unhold( GtkWidget *widget UNUSED, gpointer data UNUSED) { sflphone_off_hold(); } static void -toggle_history(GtkToggleToolButton *toggle_tool_button, - gpointer user_data) +toggle_history(GtkToggleToolButton *toggle_tool_button UNUSED, + gpointer user_data UNUSED) { GtkTreeSelection *sel; if(history_shown){ @@ -197,7 +197,7 @@ toggle_history(GtkToggleToolButton *toggle_tool_button, } static void -call_mailbox( GtkWidget* widget , gpointer data ) +call_mailbox( GtkWidget* widget UNUSED, gpointer data UNUSED) { account_t* current = account_list_get_current(); if( current == NULL ) // Should not happens @@ -314,7 +314,7 @@ toolbar_update_buttons () } /* Call back when the user click on a call in the list */ static void -selected(GtkTreeSelection *sel, void* data) +selected(GtkTreeSelection *sel, void* data UNUSED ) { GtkTreeIter iter; GValue val; @@ -333,10 +333,10 @@ selected(GtkTreeSelection *sel, void* data) } /* A row is activated when it is double clicked */ -void row_activated(GtkTreeView *tree_view, - GtkTreePath *path, - GtkTreeViewColumn *column, - void * data) +void row_activated(GtkTreeView *tree_view UNUSED, + GtkTreePath *path UNUSED, + GtkTreeViewColumn *column UNUSED, + void * data UNUSED) { g_print("double click action\n"); call_t* selectedCall; @@ -491,9 +491,9 @@ create_toolbar () } static gboolean -on_key_released (GtkWidget *widget, +on_key_released (GtkWidget *widget UNUSED, GdkEventKey *event, - gpointer user_data) + gpointer user_data UNUSED) { // If a modifier key is pressed, it's a shortcut, pass along if(event->state & GDK_CONTROL_MASK || diff --git a/sflphone-gtk/src/configwindow.c b/sflphone-gtk/src/configwindow.c index a85d4561232db9bcba18d647be879bc6b731ab87..65dd3ee2368fee1579e1873c20c7cf747ddf5bb3 100644 --- a/sflphone-gtk/src/configwindow.c +++ b/sflphone-gtk/src/configwindow.c @@ -117,7 +117,7 @@ detect_all_audio_settings() * Delete an account */ static void -delete_account(GtkWidget *widget, gpointer data) +delete_account(GtkWidget *widget UNUSED, gpointer data UNUSED) { if(selectedAccount) { @@ -129,7 +129,7 @@ delete_account(GtkWidget *widget, gpointer data) * Edit an account */ static void -edit_account(GtkWidget *widget, gpointer data) +edit_account(GtkWidget *widget UNUSED, gpointer data UNUSED) { if(selectedAccount) { @@ -141,7 +141,7 @@ edit_account(GtkWidget *widget, gpointer data) * Add an account */ static void -add_account(GtkWidget *widget, gpointer data) +add_account(GtkWidget *widget UNUSED, gpointer data UNUSED) { show_account_window(NULL); } @@ -216,7 +216,7 @@ select_account(GtkTreeSelection *selection, GtkTreeModel *model) } static void -enable_account(GtkCellRendererToggle *rend , gchar* path, gpointer data ) +enable_account(GtkCellRendererToggle *rend UNUSED, gchar* path, gpointer data ) { GtkTreeIter iter; GtkTreePath *treePath; @@ -307,7 +307,7 @@ account_move(gboolean moveUp, gpointer data) * Called from move up account button signal */ static void -account_move_up(GtkButton *button, gpointer data) +account_move_up(GtkButton *button UNUSED, gpointer data) { // Change tree view ordering and get indice changed account_move(TRUE, data); @@ -317,7 +317,7 @@ account_move_up(GtkButton *button, gpointer data) * Called from move down account button signal */ static void -account_move_down(GtkButton *button, gpointer data) +account_move_down(GtkButton *button UNUSED, gpointer data) { // Change tree view ordering and get indice changed account_move(FALSE, data); diff --git a/sflphone-gtk/src/dbus.c b/sflphone-gtk/src/dbus.c index ded6aba89d437d2d96d9a8b07cf6fea1c1a897fa..2246666d1c983b1876ae4cbf4474c6d3c8eff228 100644 --- a/sflphone-gtk/src/dbus.c +++ b/sflphone-gtk/src/dbus.c @@ -41,11 +41,11 @@ DBusGProxy * configurationManagerProxy; DBusGProxy * instanceProxy; static void -incoming_call_cb (DBusGProxy *proxy, +incoming_call_cb (DBusGProxy *proxy UNUSED, const gchar* accountID, const gchar* callID, const gchar* from, - void * foo ) + void * foo UNUSED ) { g_print ("Incoming call! %s\n",callID); call_t * c = g_new0 (call_t, 1); @@ -62,40 +62,40 @@ incoming_call_cb (DBusGProxy *proxy, static void -volume_changed_cb (DBusGProxy *proxy, +volume_changed_cb (DBusGProxy *proxy UNUSED, const gchar* device, const gdouble value, - void * foo ) + void * foo UNUSED ) { g_print ("Volume of %s changed to %f. \n",device, value); set_slider(device, value); } static void -voice_mail_cb (DBusGProxy *proxy, +voice_mail_cb (DBusGProxy *proxy UNUSED, const gchar* accountID, const guint nb, - void * foo ) + void * foo UNUSED ) { g_print ("%d Voice mail waiting! \n",nb); sflphone_notify_voice_mail (accountID , nb); } static void -incoming_message_cb (DBusGProxy *proxy, - const gchar* accountID, +incoming_message_cb (DBusGProxy *proxy UNUSED, + const gchar* accountID UNUSED, const gchar* msg, - void * foo ) + void * foo UNUSED ) { g_print ("Message %s! \n",msg); } static void -call_state_cb (DBusGProxy *proxy, +call_state_cb (DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* state, - void * foo ) + void * foo UNUSED ) { g_print ("Call %s state %s\n",callID, state); call_t * c = call_list_get(current_calls, callID); @@ -155,8 +155,8 @@ call_state_cb (DBusGProxy *proxy, } static void -accounts_changed_cb (DBusGProxy *proxy, - void * foo ) +accounts_changed_cb (DBusGProxy *proxy UNUSED, + void * foo UNUSED ) { g_print ("Accounts changed\n"); sflphone_fill_account_list(TRUE); @@ -164,9 +164,9 @@ accounts_changed_cb (DBusGProxy *proxy, } static void -error_alert(DBusGProxy *proxy, +error_alert(DBusGProxy *proxy UNUSED, int errCode, - void * foo ) + void * foo UNUSED ) { g_print ("Error notifying : (%i)\n" , errCode); sflphone_throw_exception( errCode ); diff --git a/sflphone-gtk/src/historyfilter.c b/sflphone-gtk/src/historyfilter.c index 2d98dc91c2845777bf78332006c2359e3191abc6..aa17647f8c8b6bd59f6aa9d8320c6cc5d28058dc 100644 --- a/sflphone-gtk/src/historyfilter.c +++ b/sflphone-gtk/src/historyfilter.c @@ -31,7 +31,7 @@ create_filter(GtkTreeModel* child) } gboolean -is_visible(GtkTreeModel* model, GtkTreeIter* iter, gpointer data) +is_visible(GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED) { if( SHOW_SEARCHBAR ) { @@ -51,14 +51,14 @@ is_visible(GtkTreeModel* model, GtkTreeIter* iter, gpointer data) } void -filter_entry_changed(GtkEntry* entry, gchar* arg1, gpointer data) +filter_entry_changed(GtkEntry* entry UNUSED, gchar* arg1 UNUSED, gpointer data UNUSED) { gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(historyButton), TRUE); gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(histfilter)); } void -clear_filter_entry_if_default(GtkWidget* widget, gpointer user_data) +clear_filter_entry_if_default(GtkWidget* widget UNUSED, gpointer user_data UNUSED) { if(g_ascii_strncasecmp(gtk_entry_get_text(GTK_ENTRY(filter_entry)), _("Search"), 6) == 0) gtk_entry_set_text(GTK_ENTRY(filter_entry), ""); diff --git a/sflphone-gtk/src/mainwindow.c b/sflphone-gtk/src/mainwindow.c index cbf69f6392a310e87911c43291e8b3e95dff6d30..5561aebc9e25609f3b55c4e4af306cbf97cd2584 100644 --- a/sflphone-gtk/src/mainwindow.c +++ b/sflphone-gtk/src/mainwindow.c @@ -47,7 +47,7 @@ GtkWidget * filterEntry = NULL; * Minimize the main window. */ static gboolean -on_delete (GtkWidget * widget, gpointer data) +on_delete (GtkWidget * widget UNUSED, gpointer data UNUSED) { #if GTK_CHECK_VERSION(2,10,0) gtk_widget_hide(GTK_WIDGET( get_main_window() )); diff --git a/sflphone-gtk/src/menus.c b/sflphone-gtk/src/menus.c index 9cb2a2838d19967ced49572c311c418aa99ca447..7d2b43905d009bc592f35de7b311ccb3fb922451 100644 --- a/sflphone-gtk/src/menus.c +++ b/sflphone-gtk/src/menus.c @@ -106,7 +106,7 @@ void update_menus() } /* ----------------------------------------------------------------- */ static void -help_about ( void * foo) +help_about ( void * foo UNUSED) { gchar *authors[] = { "Yan Morin <yan.morin@savoirfairelinux.com>", @@ -159,19 +159,19 @@ create_help_menu() } /* ----------------------------------------------------------------- */ static void -call_new_call ( void * foo) +call_new_call ( void * foo UNUSED) { sflphone_new_call(); } static void -call_quit ( void * foo) +call_quit ( void * foo UNUSED) { sflphone_quit(); } static void -call_minimize ( void * foo) +call_minimize ( void * foo UNUSED) { #if GTK_CHECK_VERSION(2,10,0) gtk_widget_hide(GTK_WIDGET( get_main_window() )); @@ -180,7 +180,7 @@ call_minimize ( void * foo) } static void -switch_account( GtkWidget* item , gpointer data ) +switch_account( GtkWidget* item , gpointer data UNUSED) { account_t* acc = g_object_get_data( G_OBJECT(item) , "account" ); g_print("%s\n" , acc->accountID); @@ -188,7 +188,7 @@ switch_account( GtkWidget* item , gpointer data ) } static void -call_hold (void* foo) +call_hold (void* foo UNUSED) { call_t * selectedCall = call_get_selected(current_calls); @@ -208,19 +208,19 @@ call_hold (void* foo) } static void -call_pick_up ( void * foo) +call_pick_up ( void * foo UNUSED) { sflphone_pick_up(); } static void -call_hang_up ( void * foo) +call_hang_up ( void * foo UNUSED) { sflphone_hang_up(); } static void -call_wizard ( void * foo) +call_wizard ( void * foo UNUSED) { #if GTK_CHECK_VERSION(2,10,0) build_wizard(); @@ -228,7 +228,7 @@ call_wizard ( void * foo) } static void -remove_from_history( void * foo ) +remove_from_history( void * foo UNUSED) { call_t* c = call_get_selected( history ); if(c){ @@ -238,7 +238,7 @@ remove_from_history( void * foo ) } static void -call_back( void * foo ) +call_back( void * foo UNUSED) { call_t* selectedCall = call_get_selected( history ); call_t* newCall = g_new0 (call_t, 1); @@ -355,20 +355,20 @@ create_call_menu() /* ----------------------------------------------------------------- */ static void -edit_preferences ( void * foo) +edit_preferences ( void * foo UNUSED) { show_config_window(); } static void -edit_accounts ( void * foo) +edit_accounts ( void * foo UNUSED) { show_accounts_window(); } // The menu Edit/Copy should copy the current selected call's number static void -edit_copy ( void * foo) +edit_copy ( void * foo UNUSED) { GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); call_t * selectedCall = call_get_selected(current_calls); @@ -400,7 +400,7 @@ edit_copy ( void * foo) // The menu Edit/Paste should paste the clipboard into the current selected call static void -edit_paste ( void * foo) +edit_paste ( void * foo UNUSED) { GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); call_t * selectedCall = call_get_selected(current_calls); @@ -486,7 +486,7 @@ edit_paste ( void * foo) } static void -clear_history( void* foo ) +clear_history( void* foo UNUSED) { gchar *markup; GtkWidget *dialog; @@ -568,8 +568,8 @@ create_edit_menu() } /* ----------------------------------------------------------------- */ static void -view_dialpad (GtkImageMenuItem *imagemenuitem, - void* foo) +view_dialpad (GtkImageMenuItem *imagemenuitem UNUSED, + void* foo UNUSED) { gboolean state; main_window_dialpad( &state ); @@ -585,8 +585,8 @@ view_dialpad (GtkImageMenuItem *imagemenuitem, } static void -view_volume_controls (GtkImageMenuItem *imagemenuitem, - void* foo) +view_volume_controls (GtkImageMenuItem *imagemenuitem UNUSED, + void* foo UNUSED) { gboolean state; main_window_volume_controls( &state ); @@ -600,8 +600,8 @@ view_volume_controls (GtkImageMenuItem *imagemenuitem, } static void -view_searchbar (GtkImageMenuItem *imagemenuitem, - void* foo) +view_searchbar (GtkImageMenuItem *imagemenuitem UNUSED, + void* foo UNUSED) { gboolean state; main_window_searchbar( &state ); diff --git a/sflphone-gtk/src/sflnotify.c b/sflphone-gtk/src/sflnotify.c index 945ec852a50cfa693e00811b7b8bcb689ea0a69f..9153faa3edc670227632c3ef5814b898d08db7bd 100644 --- a/sflphone-gtk/src/sflnotify.c +++ b/sflphone-gtk/src/sflnotify.c @@ -59,7 +59,7 @@ notify_incoming_call( call_t* c ) } } void -answer_call_cb( NotifyNotification *notification, gpointer data ) +answer_call_cb( NotifyNotification *notification, gpointer data UNUSED ) { call_t* c = (call_t*)g_object_get_data( G_OBJECT( notification ) , "call" ); c->history_state = INCOMING; @@ -73,7 +73,7 @@ answer_call_cb( NotifyNotification *notification, gpointer data ) } void -refuse_call_cb( NotifyNotification *notification, gpointer data ) +refuse_call_cb( NotifyNotification *notification, gpointer data UNUSED) { call_t* c = (call_t*)g_object_get_data( G_OBJECT( notification ) , "call" ); dbus_refuse(c); @@ -81,7 +81,7 @@ refuse_call_cb( NotifyNotification *notification, gpointer data ) } void -ignore_call_cb( NotifyNotification *notification, gpointer data ) +ignore_call_cb( NotifyNotification *notification, gpointer data UNUSED) { g_object_unref( notification ); } @@ -190,7 +190,7 @@ notify_no_accounts( ) } void -setup_accounts_cb( NotifyNotification *notification, gpointer data ) +setup_accounts_cb( NotifyNotification *notification, gpointer data UNUSED) { //gtk_widget_set_parent( show_accounts_window() , GTK_WIDGET(get_main_window())); show_accounts_window(); diff --git a/sflphone-gtk/src/sflphone_const.h b/sflphone-gtk/src/sflphone_const.h index 097a8cbbad33a45e59d10c741cce13271184ad3e..134f462cab85e263c4d63806cae8b356bf6dc049 100644 --- a/sflphone-gtk/src/sflphone_const.h +++ b/sflphone-gtk/src/sflphone_const.h @@ -30,6 +30,11 @@ /** Locale */ #define _(STRING) gettext( STRING ) +/** Warnings unused variables **/ +#define UNUSED_VAR(var) (void*)var + +#define UNUSED __attribute__((__unused__)) + /** Account type : SIP / IAX */ #define ACCOUNT_TYPE "Account.type" /** Account alias */ diff --git a/sflphone-gtk/src/statusicon.c b/sflphone-gtk/src/statusicon.c index ccbbc75d6b05416f5a52d69308f4eeadbefa96f3..84c414a8f14306684c2c4931767fc6f05fa43b4c 100644 --- a/sflphone-gtk/src/statusicon.c +++ b/sflphone-gtk/src/statusicon.c @@ -30,7 +30,7 @@ GtkWidget * show_menu_item; gboolean __minimized = MINIMIZED; void -status_quit ( void * foo) +status_quit ( void * foo ) { sflphone_quit(); } @@ -65,10 +65,10 @@ show_hide (void) void -status_click (GtkStatusIcon *status_icon, void * foo) +status_click (GtkStatusIcon *status_icon UNUSED, void * foo UNUSED) { - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), - !gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), + !gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item))); } void menu (GtkStatusIcon *status_icon,