[easytag/wip/easytag-next: 7/13] Use gboolean for returning TRUE and FALSE



commit 86c27cb15027241874a753b17a0a5ec1d932f519
Author: David King <amigadave amigadave com>
Date:   Tue Dec 4 22:46:32 2012 +0000

    Use gboolean for returning TRUE and FALSE

 src/prefs.c  |   36 ++++++++++++++++++------------------
 src/vcedit.c |   11 ++++++-----
 2 files changed, 24 insertions(+), 23 deletions(-)
---
diff --git a/src/prefs.c b/src/prefs.c
index 0fe1ab7..bf158a9 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -56,7 +56,7 @@ void OptionsWindow_Apply_Button  (void);
 void OptionsWindow_Save_Button   (void);
 void OptionsWindow_Cancel_Button (void);
 gboolean OptionsWindow_Key_Press (GtkWidget *window, GdkEvent *event);
-gint Check_Config                (void);
+static gboolean Check_Config     (void);
 
 void Set_Default_Comment_Check_Button_Toggled  (void);
 void Number_Track_Formated_Toggled             (void);
@@ -1771,7 +1771,7 @@ 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) : ?????
  */
-static gint
+static gboolean
 Check_DefaultPathToMp3 (void)
 {
     gchar *path_utf8;
@@ -1782,7 +1782,7 @@ Check_DefaultPathToMp3 (void)
     if (!path_utf8 || g_utf8_strlen(path_utf8, -1) < 1)
     {
         g_free(path_utf8);
-        return 1;
+        return TRUE;
     }
 
     path_real = filename_from_display(path_utf8);
@@ -1796,7 +1796,7 @@ Check_DefaultPathToMp3 (void)
     {
         g_free(path_real);
         g_free(path_utf8);
-        return 1;    /* Path is good */
+        return TRUE; /* Path is good */
     }else
     {
         GtkWidget *msgdialog = gtk_message_dialog_new(GTK_WINDOW(OptionsWindow),
@@ -1812,7 +1812,7 @@ Check_DefaultPathToMp3 (void)
         gtk_widget_destroy(msgdialog);
         g_free(path_real);
         g_free(path_utf8);
-        return 0;
+        return FALSE;
     }
 }
 
@@ -1881,7 +1881,7 @@ gint Check_CharacterSetTranslation (void)
 }
 *************/
 
-static gint
+static gboolean
 Check_DefaultComment (void)
 {
     const gchar *file;
@@ -1890,20 +1890,20 @@ Check_DefaultComment (void)
     if (!file || g_utf8_strlen(file, -1) < 1)
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(SetDefaultComment),FALSE);
 
-    return 1;    /* A blank entry is ignored */
+    return TRUE;    /* A blank entry is ignored */
 }
 
 /*
  * Check if player binary is found
  */
-static gint
+static gboolean
 Check_FilePlayerCombo (void)
 {
     gchar *program_path = NULL;
     gchar *program_path_validated = NULL;
 
 #ifdef WIN32
-    return 1; /* FIXME see Check_If_Executable_Exists */
+    return TRUE; /* FIXME see Check_If_Executable_Exists */
     /* Note : Check_If_Executable_Exists crashes when player is 'winamp.exe' with g_find_program_in_path */
 #endif
 
@@ -1928,24 +1928,24 @@ Check_FilePlayerCombo (void)
         gtk_widget_destroy(msgdialog);
 
         g_free(program_path);
-        return 0;
+        return FALSE;
     } else
     {
         g_free(program_path);
         g_free(program_path_validated);
-        return 1;
+        return TRUE;
     }
 }
 
-gint Check_Config (void)
+static gboolean
+Check_Config (void)
 {
-    if ( Check_DefaultPathToMp3()
-    //&& Check_CharacterSetTranslation()
-    && Check_DefaultComment()
-    && Check_FilePlayerCombo() )
-        return 1;    /* No problem detected */
+    if (Check_DefaultPathToMp3 ()
+        && Check_DefaultComment ()
+        && Check_FilePlayerCombo ())
+        return TRUE; /* No problem detected */
     else
-        return 0;    /* Oups! */
+        return FALSE; /* Oops! */
 }
 
 
diff --git a/src/vcedit.c b/src/vcedit.c
index 050fecb..f92b268 100644
--- a/src/vcedit.c
+++ b/src/vcedit.c
@@ -165,7 +165,8 @@ static int _blocksize(vcedit_state *s, ogg_packet *p)
     return ret;
 }
 
-static int _fetch_next_packet(vcedit_state *s, ogg_packet *p, ogg_page *page)
+static gboolean
+_fetch_next_packet (vcedit_state *s, ogg_packet *p, ogg_page *page)
 {
     int result;
     char *buffer;
@@ -174,18 +175,18 @@ static int _fetch_next_packet(vcedit_state *s, ogg_packet *p, ogg_page *page)
     result = ogg_stream_packetout(s->os, p);
 
     if(result > 0)
-        return 1;
+        return TRUE;
     else
     {
         if(s->eosin)
-            return 0;
+            return FALSE;
         while(ogg_sync_pageout(s->oy, page) <= 0)
         {
             buffer = ogg_sync_buffer(s->oy, CHUNKSIZE);
             bytes = s->read(buffer,1, CHUNKSIZE, s->in);
             ogg_sync_wrote(s->oy, bytes);
             if(bytes == 0)
-                return 0;
+                return FALSE;
         }
         if(ogg_page_eos(page))
             s->eosin = 1;
@@ -193,7 +194,7 @@ static int _fetch_next_packet(vcedit_state *s, ogg_packet *p, ogg_page *page)
         {
             s->eosin = 1;
             s->extrapage = 1;
-            return 0;
+            return FALSE;
         }
 
         ogg_stream_pagein(s->os, page);



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