[easytag/wip/core-refactoring: 12/24] Fix sign comparison warnings



commit e0a9c2f75c9a65d1bd4508dbde46abc0d1742106
Author: David King <amigadave amigadave com>
Date:   Fri Jan 30 13:53:50 2015 +0000

    Fix sign comparison warnings

 src/cddb_dialog.c     |    8 ++++----
 src/charset.c         |    5 ++---
 src/charset.h         |    2 +-
 src/core_types.h      |    2 +-
 src/file.c            |    4 ++--
 src/file.h            |    2 +-
 src/log.c             |    6 +++---
 src/scan_dialog.c     |    6 +++---
 src/tags/id3v24_tag.c |    4 ++--
 9 files changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/src/cddb_dialog.c b/src/cddb_dialog.c
index 39da5f6..01d6313 100644
--- a/src/cddb_dialog.c
+++ b/src/cddb_dialog.c
@@ -840,7 +840,7 @@ Cddb_Get_Album_Tracks_List (EtCDDBDialog *self, GtkTreeSelection* selection)
     const gchar CDDB_END_STR[] = ".";
     gchar     *proxy_auth;
     gchar     *cddb_server_name;
-    gint       cddb_server_port;
+    guint cddb_server_port;
     gchar     *cddb_server_cgi_path;
     gboolean proxy_enabled;
     gchar *proxy_hostname;
@@ -1487,7 +1487,7 @@ Cddb_Search_Album_List_From_String_Freedb (EtCDDBDialog *self)
     gchar *msg;
     gchar *proxy_auth = NULL;
     gchar *cddb_server_name;
-    gint   cddb_server_port;
+    guint cddb_server_port;
     gchar *cddb_server_cgi_path;
     gboolean proxy_enabled;
     gchar *proxy_hostname;
@@ -1811,7 +1811,7 @@ Cddb_Search_Album_List_From_String_Gnudb (EtCDDBDialog *self)
     gchar *msg;
     gchar *proxy_auth = NULL;
     gchar *cddb_server_name;
-    gint   cddb_server_port;
+    guint cddb_server_port;
     gchar *cddb_server_cgi_path;
     gboolean proxy_enabled;
     gchar *proxy_hostname;
@@ -3249,7 +3249,7 @@ et_cddb_dialog_search_from_selection (EtCDDBDialog *self)
     gchar *msg;
     gchar *proxy_auth;
     gchar *cddb_server_name;
-    gint   cddb_server_port;
+    guint cddb_server_port;
     gchar *cddb_server_cgi_path;
     gboolean proxy_enabled;
     gchar *proxy_hostname;
diff --git a/src/charset.c b/src/charset.c
index 1c54bad..b5523f0 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -736,10 +736,9 @@ Charset_Get_Name_From_Title (const gchar *charset_title)
 }
 
 const gchar *
-et_charset_get_name_from_index (gint index)
+et_charset_get_name_from_index (guint index)
 {
-    g_return_val_if_fail (index >= 0 && index <= CHARSET_TRANS_ARRAY_LEN,
-                          NULL);
+    g_return_val_if_fail (index <= CHARSET_TRANS_ARRAY_LEN, NULL);
 
     return charset_trans_array[index].charset_name;
 }
diff --git a/src/charset.h b/src/charset.h
index 17b49d7..87a6d84 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -40,7 +40,7 @@ gchar *Try_To_Validate_Utf8_String (const gchar *string);
 
 void Charset_Populate_Combobox (GtkComboBox *combo, gint select_charset);
 const gchar *Charset_Get_Name_From_Title (const gchar *charset_title);
-const gchar * et_charset_get_name_from_index (gint index);
+const gchar * et_charset_get_name_from_index (guint index);
 
 void Charset_Insert_Locales_Init    (void);
 void Charset_Insert_Locales_Destroy (void);
diff --git a/src/core_types.h b/src/core_types.h
index 36e5050..856b05f 100644
--- a/src/core_types.h
+++ b/src/core_types.h
@@ -78,7 +78,7 @@ typedef struct
 {
     gint version;               /* Version of bitstream (mpeg version for mp3, encoder version for ogg) */
     gint mpeg25;                /* Version is MPEG 2.5? */
-    gint layer;                 /* "MP3 data" */
+    gsize layer; /* "MP3 data" */
     gint bitrate;               /* Bitrate (kb/s) */
     gboolean variable_bitrate;  /* Is a VBR file? */
     gint samplerate;            /* Samplerate (Hz) */
diff --git a/src/file.c b/src/file.c
index c79a3b6..3ec2220 100644
--- a/src/file.c
+++ b/src/file.c
@@ -1355,8 +1355,8 @@ ET_Display_File_Info_To_UI (const ET_File *ETFile)
     fields->description = _("File");
 
     /* MPEG, Layer versions */
-    fields->version = g_strdup_printf ("%d, Layer %d", info->version,
-                                       info->layer);
+    fields->version = g_strdup_printf ("%d, Layer %" G_GSIZE_FORMAT,
+                                       info->version, info->layer);
 
     /* Bitrate */
     fields->bitrate = g_strdup_printf (_("%d kb/s"), info->bitrate);
diff --git a/src/file.h b/src/file.h
index e94109e..ef41d0b 100644
--- a/src/file.h
+++ b/src/file.h
@@ -48,7 +48,7 @@ typedef struct
 
     guint ETFileKey;          /* Primary key to identify each item of the list (no longer used?) */
 
-    time_t FileModificationTime;            /* Save modification time of the file */
+    guint64 FileModificationTime; /* Save modification time of the file */
 
     const ET_File_Description *ETFileDescription;
     gchar               *ETFileExtension;   /* Real extension of the file (keeping the case) (should be 
placed in ETFileDescription?) */
diff --git a/src/log.c b/src/log.c
index 6f6f00a..c347120 100644
--- a/src/log.c
+++ b/src/log.c
@@ -287,7 +287,7 @@ Log_Print (EtLogAreaKind error_type, const gchar * const format, ...)
     va_list args;
     gchar *string;
     gchar *time;
-    gint n_items;
+    guint n_items;
     GtkTreeIter iter;
     static gboolean first_time = TRUE;
     static gchar *file_path = NULL;
@@ -308,8 +308,8 @@ Log_Print (EtLogAreaKind error_type, const gchar * const format, ...)
     time = Log_Format_Date ();
 
     /* Remove lines that exceed the limit. */
-    n_items = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->log_model),
-                                              NULL);
+    n_items = (guint)gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->log_model),
+                                                     NULL);
 
     if (n_items > g_settings_get_uint (MainSettings, "log-lines") - 1
         && gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->log_model),
diff --git a/src/scan_dialog.c b/src/scan_dialog.c
index 266db0c..fcf4b3f 100644
--- a/src/scan_dialog.c
+++ b/src/scan_dialog.c
@@ -432,7 +432,7 @@ Scan_Generate_New_Tag_From_Mask (ET_File *ETFile, gchar *mask)
     gchar *buf;
     gchar *separator;
     gchar *string;
-    gint  len, i, loop=0;
+    gsize len, i, loop=0;
     gchar **mask_splitted;
     gchar **file_splitted;
     guint mask_splitted_number;
@@ -449,7 +449,7 @@ Scan_Generate_New_Tag_From_Mask (ET_File *ETFile, gchar *mask)
 
     // Remove extension of file (if found)
     tmp = strrchr(filename_utf8,'.');
-    for (i=0; i<=(gint)ET_FILE_DESCRIPTION_SIZE; i++)
+    for (i = 0; i <= ET_FILE_DESCRIPTION_SIZE; i++)
     {
         if ( strcasecmp(tmp,ETFileDescription[i].Extension)==0 )
         {
@@ -1666,7 +1666,7 @@ et_scan_dialog_open (EtScanDialog *self, EtScanMode scanner_type)
     g_return_if_fail (scanner_type >= ET_SCAN_MODE_FILL_TAG
                       && scanner_type <= ET_SCAN_MODE_PROCESS_FIELDS);
 
-    if (g_settings_get_enum (MainSettings, "scan-mode") != scanner_type)
+    if (g_settings_get_enum (MainSettings, "scan-mode") != (gint)scanner_type)
     {
         g_settings_set_enum (MainSettings, "scan-mode", scanner_type);
     }
diff --git a/src/tags/id3v24_tag.c b/src/tags/id3v24_tag.c
index 835a98b..96a0197 100644
--- a/src/tags/id3v24_tag.c
+++ b/src/tags/id3v24_tag.c
@@ -153,7 +153,7 @@ id3tag_read_file_tag (GFile *gfile,
                                             &string1[ID3_TAG_QUERYSIZE],
                                             tagsize - ID3_TAG_QUERYSIZE,
                                             &bytes_read, NULL, error)
-                && bytes_read == tagsize - ID3_TAG_QUERYSIZE
+                && bytes_read == (gsize)(tagsize - ID3_TAG_QUERYSIZE)
             && (tag = id3_tag_parse((id3_byte_t const *)string1, tagsize))
                )
             {
@@ -1767,7 +1767,7 @@ etag_write_tags (const gchar *filename,
         goto err;
     }
 
-    if (filev2size == v2size)
+    if (filev2size == (long)v2size)
     {
         if (!g_seekable_seek (seekable, 0, G_SEEK_SET, NULL, error))
         {


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