[easytag/wip/easytag-next: 12/19] Fix missing prototype warnings



commit 0eb0473683c9e0a169c6a39076d4215717bddfe6
Author: David King <amigadave amigadave com>
Date:   Tue Dec 4 22:32:18 2012 +0000

    Fix missing prototype warnings
    
    Additionally, make the missing prototypes warning an error in the list
    of compiler warnings in configure.ac.

 Makefile.am              |    1 -
 configure.ac             |    2 +-
 src/browser.c            |   34 +++---------
 src/cddb.c               |    3 +-
 src/crc32.c              |   27 ----------
 src/crc32.h              |    1 -
 src/dlm.c                |    2 +
 src/easytag.c            |   45 +++++++++++------
 src/et_core.c            |   12 +---
 src/flac_header.c        |    1 +
 src/id3_tag.c            |    3 +-
 src/libapetag/info_mpc.c |    7 ---
 src/libmpg123/getbits.c  |  126 ----------------------------------------------
 src/libmpg123/layer1.c   |    6 ++-
 src/libmpg123/layer2.c   |    6 ++-
 src/misc.c               |    8 +--
 src/prefs.c              |    9 ++-
 src/setting.c            |    9 ++-
 18 files changed, 71 insertions(+), 231 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a3f47bb..54e542a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,7 +23,6 @@ easytag_SOURCES = \
 	src/libapetag/info_mpc.c \
 	src/libmpg123/common.c \
 	src/libmpg123/dxhead.c \
-	src/libmpg123/getbits.c \
 	src/libmpg123/layer1.c \
 	src/libmpg123/layer2.c \
 	src/libmpg123/layer3.c \
diff --git a/configure.ac b/configure.ac
index 02f2b22..226ec5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -223,7 +223,7 @@ dnl Check the pkg-config dependencies
 PKG_CHECK_MODULES([EASYTAG], [$GTK_DEPS $OGG_DEPS $SPEEX_DEPS $FLAC_DEPS $ID3TAG_DEPS $TAGLIB_DEPS $WAVPACK_DEPS])
 
 dnl Check that the compiler accepts the given warning flags.
-warning_flags="-Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs"
+warning_flags="-Wall -Wstrict-prototypes -Wnested-externs -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs"
 
 realsave_CFLAGS="$CFLAGS"
 for option in $warning_flags; do
diff --git a/src/browser.c b/src/browser.c
index 1966aba..639e950 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -480,7 +480,8 @@ gboolean Browser_Tree_Key_Press (GtkWidget *tree, GdkEvent *event, gpointer data
 /*
  * Key Press events into browser list
  */
-gboolean Browser_List_Stop_Timer (guint *flag)
+static gboolean
+Browser_List_Stop_Timer (guint *flag)
 {
     *flag = FALSE;
     return FALSE;
@@ -2001,24 +2002,6 @@ void Browser_List_Invert_File_Selection (void)
 }
 
 
-/*
- * Load the list of Artists found in the tags
- */
-gint Browser_Artist_List_Data_Comp_Func_Sort_By_Ascending_Album (ET_File *ETFile1, ET_File *ETFile2)
-{
-    gchar *current_album1 = ((File_Tag *)((GList *)ETFile1->FileTag)->data)->album;
-    gchar *current_album2 = ((File_Tag *)((GList *)ETFile2->FileTag)->data)->album;
-
-    if (!current_album1 && !current_album2)
-        return 0;
-    else if (!current_album1)
-        return -1;
-    else if (!current_album2)
-        return 1;
-    else
-        return strcmp(current_album1,current_album2);
-}
-
 void Browser_Artist_List_Load_Files (ET_File *etfile_to_select)
 {
     GList *ArtistList;
@@ -2838,13 +2821,14 @@ GdkPixbuf *Pixmap_From_Directory_Permission (gchar *path)
  * The select function should return TRUE if the state of the node may be toggled,
  * and FALSE if the state of the node should be left unchanged.
  */
-gboolean Browser_List_Select_Func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer data)
+static gboolean
+Browser_List_Select_Func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer data)
 {
-    // This line will be selected at the end of the event.
-    // We store the last ETFile selected, as gtk_tree_selection_get_selected_rows
-    // returns the selection, in the ascending line order, instead of the real
-    // order of line selection (so we can't displayed the last selected file)
-    // FIXME : should generate a list to get the previous selected file if unselected the last selected file
+    /* This line will be selected at the end of the event.
+     * We store the last ETFile selected, as gtk_tree_selection_get_selected_rows
+     * returns the selection, in the ascending line order, instead of the real
+     * order of line selection (so we can't displayed the last selected file)
+     * FIXME : should generate a list to get the previous selected file if unselected the last selected file */
     if (!path_currently_selected)
     {
         GtkTreeIter iter;
diff --git a/src/cddb.c b/src/cddb.c
index 904201e..a23669d 100644
--- a/src/cddb.c
+++ b/src/cddb.c
@@ -1509,7 +1509,8 @@ gboolean Cddb_Track_List_Button_Press (GtkTreeView *treeView, GdkEventButton *ev
  * Create_Browser_Tree_Popup_Menu: Create a popup menu for the tree browser
  * Create_Browser_List_Popup_Menu: Create a popup menu for the list of files of browser
  */
-gboolean Cddb_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
+static gboolean
+Cddb_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
 {
     if (event && (event->type==GDK_BUTTON_PRESS) && (event->button==3))
     {
diff --git a/src/crc32.c b/src/crc32.c
index bd68609..1802195 100644
--- a/src/crc32.c
+++ b/src/crc32.c
@@ -24,33 +24,6 @@
 #include "crc32.h"
 
 /*
- * Initial crc32 function
- * This function was renamed from crc32(...) to crc32_easytag(...) to avoid a
- * strange problem with some gtk theme that may use the same name of function.
- */
-int crc32_easytag(register int fd, unsigned long *main_val)
-{
-    char          buf[BUFFERSIZE], *p;
-    int           nr;
-    unsigned long crc = ~0, crc32_total = ~0;
-
-    while ((nr = read(fd, &buf, sizeof(buf))) > 0)
-        for (p = buf; nr--; ++p)
-        {
-            crc = (crc >> 8) ^ crctable[(crc ^ *p) & 0xff];
-            crc32_total = (crc >> 8) ^ crctable[(crc32_total ^ *p) & 0xff];
-        }
-    if (nr < 0)
-        return 1;
-
-    *main_val = ~crc;
-
-    return 0;
-}
-
-
-
-/*
  * Calculate the CRC-32 value of audio data (doesn't read the ID3v2 and ID3v1 tags).
  * Return 0 if OK
  */
diff --git a/src/crc32.h b/src/crc32.h
index 7f29a70..724d3d5 100644
--- a/src/crc32.h
+++ b/src/crc32.h
@@ -91,7 +91,6 @@ static const unsigned long crctable[256] = {
   0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,
 };
 
-int crc32_easytag(register int fd, unsigned long *main_val);
 int crc32_file_with_ID3_tag(char *filename, unsigned long *main_val);
 
 
diff --git a/src/dlm.c b/src/dlm.c
index 19c14e3..f908c06 100644
--- a/src/dlm.c
+++ b/src/dlm.c
@@ -3,6 +3,8 @@
 #include <glib.h>
 #include <string.h>
 
+#include "dlm.h"
+
 int dlm_cost    (const gchar, const gchar);
 int dlm_minimum (int a, int b, int c, int d);
 
diff --git a/src/easytag.c b/src/easytag.c
index 74db013..8864234 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -3770,7 +3770,8 @@ void Action_Main_Stop_Button_Pressed (void)
     g_object_set(uiaction, "sensitive", FALSE, NULL);
 }
 
-void ui_widget_set_sensitive (const gchar *menu, const gchar *action, gboolean sensitive)
+static void
+ui_widget_set_sensitive (const gchar *menu, const gchar *action, gboolean sensitive)
 {
     GtkAction *uiaction;
     gchar *path;
@@ -4475,7 +4476,8 @@ void Init_Load_Default_Dir (void)
 
 
 
-void Convert_P20_And_Undescore_Into_Spaces (GtkWidget *entry)
+static void
+Convert_P20_And_Underscore_Into_Spaces (GtkWidget *entry)
 {
     gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
 
@@ -4485,7 +4487,8 @@ void Convert_P20_And_Undescore_Into_Spaces (GtkWidget *entry)
     g_free(string);
 }
 
-void Convert_Space_Into_Undescore (GtkWidget *entry)
+static void
+Convert_Space_Into_Underscore (GtkWidget *entry)
 {
     gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
 
@@ -4494,7 +4497,8 @@ void Convert_Space_Into_Undescore (GtkWidget *entry)
     g_free(string);
 }
 
-void Convert_All_Uppercase (GtkWidget *entry)
+static void
+Convert_All_Uppercase (GtkWidget *entry)
 {
     gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
 
@@ -4503,7 +4507,8 @@ void Convert_All_Uppercase (GtkWidget *entry)
     g_free(string);
 }
 
-void Convert_All_Downcase (GtkWidget *entry)
+static void
+Convert_All_Lowercase (GtkWidget *entry)
 {
     gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
 
@@ -4512,7 +4517,8 @@ void Convert_All_Downcase (GtkWidget *entry)
     g_free(string);
 }
 
-void Convert_Letter_Uppercase (GtkWidget *entry)
+static void
+Convert_Letter_Uppercase (GtkWidget *entry)
 {
     gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
 
@@ -4521,7 +4527,8 @@ void Convert_Letter_Uppercase (GtkWidget *entry)
     g_free(string);
 }
 
-void Convert_First_Letters_Uppercase (GtkWidget *entry)
+static void
+Convert_First_Letters_Uppercase (GtkWidget *entry)
 {
     gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
 
@@ -4530,7 +4537,8 @@ void Convert_First_Letters_Uppercase (GtkWidget *entry)
     g_free(string);
 }
 
-void Convert_Remove_Space (GtkWidget *entry)
+static void
+Convert_Remove_Space (GtkWidget *entry)
 {
     gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
 
@@ -4539,7 +4547,8 @@ void Convert_Remove_Space (GtkWidget *entry)
     g_free(string);
 }
 
-void Convert_Insert_Space (GtkWidget *entry)
+static void
+Convert_Insert_Space (GtkWidget *entry)
 {
     // FIX ME : we suppose that it will not grow more than 2 times its size...
     guint string_length = 2 * strlen(gtk_entry_get_text(GTK_ENTRY(entry)));
@@ -4552,7 +4561,8 @@ void Convert_Insert_Space (GtkWidget *entry)
     g_free(string);
 }
 
-void Convert_Only_One_Space (GtkWidget *entry)
+static void
+Convert_Only_One_Space (GtkWidget *entry)
 {
     gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
 
@@ -4564,7 +4574,8 @@ void Convert_Only_One_Space (GtkWidget *entry)
 /*
  * Entry_Popup_Menu_Handler: show the popup menu when the third mouse button is pressed.
  */
-gboolean Entry_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
+static gboolean
+Entry_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
 {
     if (event && (event->type==GDK_BUTTON_PRESS) && (event->button==3))
     {
@@ -4610,14 +4621,14 @@ void Attach_Popup_Menu_To_Tag_Entries (GtkEntry *entry)
     gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
     gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
     g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
-        G_CALLBACK(Convert_P20_And_Undescore_Into_Spaces),G_OBJECT(entry));
+        G_CALLBACK(Convert_P20_And_Underscore_Into_Spaces),G_OBJECT(entry));
 
     MenuItem = gtk_image_menu_item_new_with_label(_("Convert ' ' to '_'"));
     Image = gtk_image_new_from_stock(GTK_STOCK_CONVERT,GTK_ICON_SIZE_MENU);
     gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
     gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
     g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
-        G_CALLBACK(Convert_Space_Into_Undescore),G_OBJECT(entry));
+        G_CALLBACK(Convert_Space_Into_Underscore),G_OBJECT(entry));
 
     /* Separator */
     MenuItem = gtk_menu_item_new();
@@ -4635,7 +4646,7 @@ void Attach_Popup_Menu_To_Tag_Entries (GtkEntry *entry)
     gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
     gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
     g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
-        G_CALLBACK(Convert_All_Downcase),G_OBJECT(entry));
+        G_CALLBACK(Convert_All_Lowercase),G_OBJECT(entry));
 
     MenuItem = gtk_image_menu_item_new_with_label(_("First letter uppercase"));
     Image = gtk_image_new_from_stock("easytag-first-letter-uppercase",GTK_ICON_SIZE_MENU);
@@ -4881,7 +4892,8 @@ void EasyTAG_Exit (void)
     exit(0);
 }
 
-void Quit_MainWindow_Confirmed (void)
+static void
+Quit_MainWindow_Confirmed (void)
 {
     // Save the configuration when exiting...
     Save_Changes_Of_UI();
@@ -4890,7 +4902,8 @@ void Quit_MainWindow_Confirmed (void)
     EasyTAG_Exit();
 }
 
-void Quit_MainWindow_Save_And_Quit (void)
+static void
+Quit_MainWindow_Save_And_Quit (void)
 {
     /* Save modified tags */
     if (Save_All_Files_With_Answer(FALSE) == -1)
diff --git a/src/et_core.c b/src/et_core.c
index 9dedab5..8a1e553 100644
--- a/src/et_core.c
+++ b/src/et_core.c
@@ -4463,10 +4463,12 @@ gboolean ET_Check_If_All_Files_Are_Saved (void)
  * Set to TRUE the value of 'FileTag->saved' for the File_Tag item passed in parameter.
  * And set ALL other values of the list to FALSE.
  */
-void Set_Saved_Value_Of_File_Tag (File_Tag *FileTag, gboolean saved)
+static void
+Set_Saved_Value_Of_File_Tag (File_Tag *FileTag, gboolean saved)
 {
     if (FileTag) FileTag->saved = saved;
 }
+
 void ET_Mark_File_Tag_As_Saved (ET_File *ETFile)
 {
     File_Tag *FileTag;
@@ -4479,14 +4481,6 @@ void ET_Mark_File_Tag_As_Saved (ET_File *ETFile)
 }
 
 
-/*
- * Set to TRUE the value of 'FileName->saved' for the File_Name item passed in parameter.
- * And set ALL other values of the list to FALSE.
- */
-void Set_Saved_Value_Of_File_Name (File_Name *FileName, gboolean saved)
-{
-    if (FileName) FileName->saved = saved;
-}
 void ET_Mark_File_Name_As_Saved (ET_File *ETFile)
 {
     File_Name *FileNameNew;
diff --git a/src/flac_header.c b/src/flac_header.c
index 7cdd2ad..6e9d778 100644
--- a/src/flac_header.c
+++ b/src/flac_header.c
@@ -38,6 +38,7 @@
 
 #include "easytag.h"
 #include "et_core.h"
+#include "flac_header.h"
 #include "log.h"
 #include "misc.h"
 #include "charset.h"
diff --git a/src/id3_tag.c b/src/id3_tag.c
index 4325600..5575951 100644
--- a/src/id3_tag.c
+++ b/src/id3_tag.c
@@ -82,7 +82,8 @@ gboolean Id3tag_Check_If_Id3lib_Is_Bugged (void);
 /*
  * Write the ID3 tags to the file. Returns TRUE on success, else 0.
  */
-gboolean Id3tag_Write_File_v23Tag (ET_File *ETFile)
+static gboolean
+Id3tag_Write_File_v23Tag (ET_File *ETFile)
 {
     File_Tag *FileTag;
     gchar    *filename;
diff --git a/src/libapetag/info_mpc.c b/src/libapetag/info_mpc.c
index 18ee71b..a659bce 100644
--- a/src/libapetag/info_mpc.c
+++ b/src/libapetag/info_mpc.c
@@ -57,13 +57,6 @@ profile_stringify(unsigned int profile)    // profile is 0...15, where 7...13 is
         sizeof (Names) / sizeof (*Names) ? na : Names[profile];
 }
 
-int
-read_file_header_fp(FILE *fp, StreamInfoMpc * Info)
-{
-
-return 0;
-}
-
 /*
     return 0; Info has all info
     return 1; File not found
diff --git a/src/libmpg123/layer1.c b/src/libmpg123/layer1.c
index 057f08b..5cb3f10 100644
--- a/src/libmpg123/layer1.c
+++ b/src/libmpg123/layer1.c
@@ -15,7 +15,8 @@
 /* Used by the getbits macros */
 static unsigned long rval;
 
-void I_step_one(unsigned int balloc[], unsigned int scale_index[2][SBLIMIT], struct frame *fr)
+static void
+I_step_one (unsigned int balloc[], unsigned int scale_index[2][SBLIMIT], struct frame *fr)
 {
 	unsigned int *ba = balloc;
 	unsigned int *sca = (unsigned int *) scale_index;
@@ -62,7 +63,8 @@ void I_step_one(unsigned int balloc[], unsigned int scale_index[2][SBLIMIT], str
 	}
 }
 
-void I_step_two(real fraction[2][SBLIMIT], unsigned int balloc[2 * SBLIMIT],
+static void
+I_step_two (real fraction[2][SBLIMIT], unsigned int balloc[2 * SBLIMIT],
 		unsigned int scale_index[2][SBLIMIT], struct frame *fr)
 {
 	int i, n;
diff --git a/src/libmpg123/layer2.c b/src/libmpg123/layer2.c
index 07ce258..7630187 100644
--- a/src/libmpg123/layer2.c
+++ b/src/libmpg123/layer2.c
@@ -66,7 +66,8 @@ void mpg123_init_layer2(void)
 	}
 }
 
-void II_step_one(unsigned int *bit_alloc, int *scale, struct frame *fr)
+static void
+II_step_one(unsigned int *bit_alloc, int *scale, struct frame *fr)
 {
 	int stereo = fr->stereo - 1;
 	int sblimit = fr->II_sblimit;
@@ -140,7 +141,8 @@ void II_step_one(unsigned int *bit_alloc, int *scale, struct frame *fr)
 
 }
 
-void II_step_two(unsigned int *bit_alloc, real fraction[2][4][SBLIMIT], int *scale, struct frame *fr, int x1)
+static void
+II_step_two(unsigned int *bit_alloc, real fraction[2][4][SBLIMIT], int *scale, struct frame *fr, int x1)
 {
 	int i, j, k, ba;
 	int stereo = fr->stereo;
diff --git a/src/misc.c b/src/misc.c
index cd6aca5..3e67bd4 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -494,11 +494,6 @@ gboolean Parse_Date (void)
 /*
  * Load the genres list to the combo, and sorts it
  */
-int Compare_Two_Genres (gchar *genre1,gchar *genre2)
-{
-    return strcmp(genre1,genre2);
-}
-
 void Load_Genres_List_To_UI (void)
 {
     guint i;
@@ -3373,7 +3368,8 @@ void Load_Filename_Set_Filenames (void)
 /*
  * Create and attach a popup menu on the two clist of the LoadFileWindow
  */
-gboolean Load_Filename_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
+static gboolean
+Load_Filename_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
 {
     if (event && (event->type==GDK_BUTTON_PRESS) && (event->button==3))
     {
diff --git a/src/prefs.c b/src/prefs.c
index 4552f26..0fe1ab7 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -1771,7 +1771,8 @@ void OptionsWindow_Apply_Changes (void)
  *  - converted to UTF-8 (path_utf8)                : CÃline DION - D'eux (1995)
  *  - try to convert to system encoding (path_real) : ?????
  */
-gint Check_DefaultPathToMp3 (void)
+static gint
+Check_DefaultPathToMp3 (void)
 {
     gchar *path_utf8;
     gchar *path_real;
@@ -1880,7 +1881,8 @@ gint Check_CharacterSetTranslation (void)
 }
 *************/
 
-gint Check_DefaultComment (void)
+static gint
+Check_DefaultComment (void)
 {
     const gchar *file;
 
@@ -1894,7 +1896,8 @@ gint Check_DefaultComment (void)
 /*
  * Check if player binary is found
  */
-gint Check_FilePlayerCombo (void)
+static gint
+Check_FilePlayerCombo (void)
 {
     gchar *program_path = NULL;
     gchar *program_path_validated = NULL;
diff --git a/src/setting.c b/src/setting.c
index 409ac78..20c67c0 100644
--- a/src/setting.c
+++ b/src/setting.c
@@ -983,7 +983,8 @@ void Save_Config_To_File (void)
  * Parse lines read (line as <var_description>=<value>) and load the values
  * into the corresponding config variables.
  */
-void Set_Config (gchar *line)
+static void
+Set_Config (gchar *line)
 {
     gchar *var_descriptor;
     gchar *var_value;
@@ -1203,7 +1204,8 @@ gboolean Setting_Create_Files (void)
 /*
  * Save the contents of a list store to a file
  */
-void Save_List_Store_To_File (const gchar *filename, GtkListStore *liststore, gint colnum)
+static void
+Save_List_Store_To_File (const gchar *filename, GtkListStore *liststore, gint colnum)
 {
     gchar *file_path = NULL;
     FILE *file;
@@ -1244,7 +1246,8 @@ void Save_List_Store_To_File (const gchar *filename, GtkListStore *liststore, gi
 /*
  * Populate a list store with data from a file passed in as first parameter
  */
-gboolean Populate_List_Store_From_File (const gchar *filename, GtkListStore *liststore, gint text_column)
+static gboolean
+Populate_List_Store_From_File (const gchar *filename, GtkListStore *liststore, gint text_column)
 {
 
     gchar *file_path = NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]