[evolution-patches] Compilation warning fixes



I'm trying to get work upstream with this patch.

Fixed some compilation warnings in libedataserver

Go ahead and commit it for me if you like the patch. I added a diff for
the ChangeLog too.


-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
work: vanhoof at x-tend dot be
blog: http://pvanhoof.be/blog
--- /home/pvanhoof/repos/gnome/cvs/evolution-data-server/libedataserver/e-data-server-util.c	2006-06-02 14:34:06.000000000 +0200
+++ e-data-server-util.c	2006-10-17 09:45:41.000000000 +0200
@@ -168,19 +168,22 @@
         nuni = g_alloca (sizeof (gunichar) * strlen (needle));
 
         nlen = 0;
-        for (p = e_util_unicode_get_utf8 (needle, &unival); p && unival; p = e_util_unicode_get_utf8 (p, &unival)) {
+        for (p = (const guchar*) e_util_unicode_get_utf8 (needle, &unival); 
+	     p && unival; p = (const guchar*) e_util_unicode_get_utf8 ((const gchar*)p, 
+	     &unival)) {
                 nuni[nlen++] = g_unichar_tolower (unival);
         }
         /* NULL means there was illegal utf-8 sequence */
         if (!p) return NULL;
 
-	o = haystack;
-        for (p = e_util_unicode_get_utf8 (o, &unival); p && unival; p = e_util_unicode_get_utf8 (p, &unival)) {
+	o = (const guchar*) haystack;
+        for (p = (const guchar*) e_util_unicode_get_utf8 ((const gchar*)o, &unival); 
+	     p && unival; p = (const guchar*) e_util_unicode_get_utf8 ((const gchar*)p, &unival)) {
                 gint sc;
                 sc = g_unichar_tolower (unival);
                 /* We have valid stripped char */
                 if (sc == nuni[0]) {
-                        const gchar *q = p;
+                        const gchar *q = (const gchar *)p;
                         gint npos = 1;
                         while (npos < nlen) {
                                 q = e_util_unicode_get_utf8 (q, &unival);
@@ -190,7 +193,7 @@
                                 npos++;
                         }
                         if (npos == nlen) {
-                                return o;
+                                return (const gchar *)o;
                         }
                 }
                 o = p;
@@ -205,7 +208,7 @@
 {
         gunichar *decomp, retval;
         GUnicodeType utype;
-        gint dlen;
+        guint dlen;
 
         utype = g_unichar_type (ch);
 
@@ -260,7 +263,8 @@
         nuni = g_alloca (sizeof (gunichar) * strlen (needle));
 
         nlen = 0;
-        for (p = e_util_unicode_get_utf8 (needle, &unival); p && unival; p = e_util_unicode_get_utf8 (p, &unival)) {
+        for (p = (const guchar *)e_util_unicode_get_utf8 ((const gchar*)needle, &unival); 
+	     p && unival; p = (const guchar *)e_util_unicode_get_utf8 ((const gchar*)p, &unival)) {
                 gint sc;
                 sc = stripped_char (unival);
                 if (sc) {
@@ -272,14 +276,15 @@
         /* If everything is correct, we have decomposed, lowercase, stripped needle */
         if (nlen < 1) return haystack;
 
-        o = haystack;
-        for (p = e_util_unicode_get_utf8 (o, &unival); p && unival; p = e_util_unicode_get_utf8 (p, &unival)) {
+        o = (const guchar *)haystack;
+        for (p = (const guchar *)e_util_unicode_get_utf8 ((const gchar*)o, &unival); 
+	     p && unival; p = (const guchar *)e_util_unicode_get_utf8 ((const gchar*)p, &unival)) {
                 gint sc;
                 sc = stripped_char (unival);
                 if (sc) {
                         /* We have valid stripped char */
                         if (sc == nuni[0]) {
-                                const gchar *q = p;
+                                const gchar *q = (const gchar *)p;
                                 gint npos = 1;
                                 while (npos < nlen) {
                                         q = e_util_unicode_get_utf8 (q, &unival);
@@ -289,7 +294,7 @@
                                         npos++;
                                 }
                                 if (npos == nlen) {
-                                        return o;
+                                        return (const gchar *)o;
                                 }
                         }
                 }
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/ChangeLog,v
retrieving revision 1.427
diff -u -r1.427 ChangeLog
--- ChangeLog	16 Oct 2006 18:08:16 -0000	1.427
+++ ChangeLog	17 Oct 2006 07:49:34 -0000
@@ -1,3 +1,7 @@
+2006-10-17  Philip Van Hoof  <pvanhoof gnome org
+
+	* libedataserver/e-data-server-utils.c: Fixed compilation warnings
+
 2006-10-16  Harish Krishnaswamy  <kharish novell com>
 
 	* NEWS, configure.in: Evolution-Data-Server 1.9.1


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