diff src/filefilter.c @ 736:a7289f9e8d29

Fix signed vs unsigned warnings. In most cases, gint was used instead of guint.
author zas_
date Thu, 22 May 2008 13:00:45 +0000
parents fbebf5cf4a55
children 77ff94c0490a
line wrap: on
line diff
--- a/src/filefilter.c	Thu May 22 11:28:35 2008 +0000
+++ b/src/filefilter.c	Thu May 22 13:00:45 2008 +0000
@@ -42,7 +42,7 @@
 }
 
 static FilterEntry *filter_entry_new(const gchar *key, const gchar *description,
-				     const gchar *extensions, FileFormatClass file_class, gint enabled)
+				     const gchar *extensions, FileFormatClass file_class, gboolean enabled)
 {
 	FilterEntry *fe;
 
@@ -105,7 +105,7 @@
 void filter_add_unique(const gchar *description, const gchar *extensions, FileFormatClass file_class, gint enabled)
 {
 	gchar *key;
-	gint n;
+	guint n;
 
 	key = g_strdup("user0");
 	n = 1;
@@ -172,7 +172,7 @@
 		gchar *desc;
 		gchar **extensions;
 		GString *filter = NULL;
-		gint i;
+		guint i;
 
 		format = work->data;
 		work = work->next;
@@ -256,7 +256,7 @@
 	while (*p != '\0')
 		{
 		const gchar *b;
-		gint l = 0;
+		guint l = 0;
 
 		b = p;
 		while (*p != '\0' && *p != ';')
@@ -274,7 +274,7 @@
 void filter_rebuild(void)
 {
 	GList *work;
-	gint i;
+	guint i;
 
 	string_list_free(extension_list);
 	extension_list = NULL;
@@ -316,7 +316,7 @@
 gint filter_name_exists(const gchar *name)
 {
 	GList *work;
-	gint ln;
+	guint ln;
 
 	if (!extension_list || options->file_filter.disable) return TRUE;
 
@@ -325,7 +325,7 @@
 	while (work)
 		{
 		gchar *filter = work->data;
-		gint lf = strlen(filter);
+		guint lf = strlen(filter);
 
 		if (ln >= lf)
 			{
@@ -341,7 +341,7 @@
 gint filter_file_class(const gchar *name, FileFormatClass file_class)
 {
 	GList *work;
-	gint ln;
+	guint ln;
 
 	if (file_class < 0 || file_class >= FILE_FORMAT_CLASSES)
 		{
@@ -354,7 +354,7 @@
 	while (work)
 		{
 		gchar *filter = work->data;
-		gint lf = strlen(filter);
+		guint lf = strlen(filter);
 
 		if (ln >= lf)
 			{
@@ -395,7 +395,7 @@
 	gchar *ext;
 	gchar *desc;
 	gint enabled = TRUE;
-	gint file_class;
+	guint file_class;
 
 	if (!text || text[0] != '"') return;
 
@@ -405,9 +405,9 @@
 	ext = quoted_value(p, &p);
 	desc = quoted_value(p, &p);
 
-	file_class = strtol(p, NULL, 10);
+	file_class = strtoul(p, NULL, 10);
 
-	if (file_class < 0 || file_class >= FILE_FORMAT_CLASSES) file_class = FORMAT_CLASS_UNKNOWN;
+	if (file_class >= FILE_FORMAT_CLASSES) file_class = FORMAT_CLASS_UNKNOWN;
 
 	if (key && key[0] == '#')
 		{