[glabels] Fixed a few -Wall warnings



commit 424d8c45333504425cebb58d97b1f9e58e45a473
Author: Jim Evins <evins snaught com>
Date:   Wed Jun 2 23:27:18 2010 -0400

    Fixed a few -Wall warnings

 libglabels/db.c |    2 +-
 src/file-util.c |    4 ++--
 src/merge.c     |    4 ++--
 src/str-util.c  |   10 +++++-----
 4 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/libglabels/db.c b/libglabels/db.c
index 0e7cf27..bbc3209 100644
--- a/libglabels/db.c
+++ b/libglabels/db.c
@@ -2183,7 +2183,7 @@ copy_old_custom_files (void)
 
                 if (dir)
                 {
-                        while (name = g_dir_read_name (dir))
+                        while ((name = g_dir_read_name (dir)) != NULL)
                         {
                                 old_full_name = g_build_filename (old_dir_name, name, NULL);
                                 new_full_name = g_build_filename (new_dir_name, name, NULL);
diff --git a/src/file-util.c b/src/file-util.c
index 684c7fa..ace188b 100644
--- a/src/file-util.c
+++ b/src/file-util.c
@@ -37,7 +37,7 @@ gl_file_util_add_extension (const gchar *orig_filename)
 	if (extension == NULL) {
 		new_filename = g_strconcat (orig_filename, ".glabels", NULL);
 	} else {
-		if (g_strcasecmp (extension, ".glabels") != 0) {
+		if (g_ascii_strcasecmp (extension, ".glabels") != 0) {
 			new_filename =
 			    g_strconcat (orig_filename, ".glabels", NULL);
 		} else {
@@ -61,7 +61,7 @@ gl_file_util_remove_extension (const gchar *orig_filename)
 
 	extension = strrchr (new_filename, '.');
 	if (extension != NULL) {
-		if (g_strcasecmp (extension, ".glabels") == 0) {
+		if (g_ascii_strcasecmp (extension, ".glabels") == 0) {
 			*extension = 0; /* truncate string, rm extension */
 		}
 	}
diff --git a/src/merge.c b/src/merge.c
index 6829246..210aac9 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -287,7 +287,7 @@ gl_merge_new (gchar *name)
 	for (p=backends; p!=NULL; p=p->next) {
 		backend = (Backend *)p->data;
 
-		if (g_strcasecmp(name, backend->name) == 0) {
+		if (g_ascii_strcasecmp(name, backend->name) == 0) {
 
 			merge = GL_MERGE (g_object_newv (backend->type,
 							 backend->n_params,
@@ -301,7 +301,7 @@ gl_merge_new (gchar *name)
 		}
 	}
 
-	if ( (merge == NULL) && (g_strcasecmp (name, "None") != 0)) {
+	if ( (merge == NULL) && (g_ascii_strcasecmp (name, "None") != 0)) {
 		g_message ("Unknown merge backend \"%s\"", name);
 	}
 
diff --git a/src/str-util.c b/src/str-util.c
index 6aa2dd1..f8c6d70 100644
--- a/src/str-util.c
+++ b/src/str-util.c
@@ -49,11 +49,11 @@ PangoAlignment
 gl_str_util_string_to_align (const gchar *string)
 {
 
-	if (g_strcasecmp (string, "Left") == 0) {
+	if (g_ascii_strcasecmp (string, "Left") == 0) {
 		return PANGO_ALIGN_LEFT;
-	} else if (g_strcasecmp (string, "Center") == 0) {
+	} else if (g_ascii_strcasecmp (string, "Center") == 0) {
 		return PANGO_ALIGN_CENTER;
-	} else if (g_strcasecmp (string, "Right") == 0) {
+	} else if (g_ascii_strcasecmp (string, "Right") == 0) {
 		return PANGO_ALIGN_RIGHT;
 	} else {
 		return PANGO_ALIGN_LEFT;
@@ -83,9 +83,9 @@ PangoWeight
 gl_str_util_string_to_weight (const gchar *string)
 {
 
-	if (g_strcasecmp (string, "Regular") == 0) {
+	if (g_ascii_strcasecmp (string, "Regular") == 0) {
 		return PANGO_WEIGHT_NORMAL;
-	} else if (g_strcasecmp (string, "Bold") == 0) {
+	} else if (g_ascii_strcasecmp (string, "Bold") == 0) {
 		return PANGO_WEIGHT_BOLD;
 	} else {
 		return PANGO_WEIGHT_NORMAL;



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