[dia] [warningectomy] differ in signedness and unused



commit 45e570d8759e14d5a8f8d9af5d7c094a22e5fc67
Author: Hans Breuer <hans breuer org>
Date:   Sat Aug 14 20:31:12 2010 +0200

    [warningectomy] differ in signedness and unused
    
    dia_image.c: In function 'dia_image_new_from_pixbuf':
    dia_image.c:189: warning: unused variable 'image'
    prop_pixbuf.c: In function 'data_pixbuf':
    prop_pixbuf.c:84: warning: pointer targets in passing argument 2 of
    'xmlStrcmp' differ in signedness
    prop_pixbuf.c:86: warning: pointer targets in passing argument 1 of
    'strlen' differ in signedness
    prop_pixbuf.c:92: warning: pointer targets in passing argument 1 of
    'g_base64_decode_step' differ in signedness
    prop_pixbuf.c: In function '_pixbuf_encode':
    prop_pixbuf.c:142: warning: pointer targets in passing argument 1 of
    'g_base64_encode_step' differ in signedness
    prop_pixbuf.c:142: warning: pointer targets in passing argument 4 of
    'g_base64_encode_step' differ in signedness
    prop_pixbuf.c:134: warning: unused variable 'size'
    prop_pixbuf.c: In function 'data_add_pixbuf':
    prop_pixbuf.c:162: warning: pointer targets in passing argument 2 of
    'g_base64_encode_close' differ in signedness
    prop_pixbuf.c:165: warning: pointer targets in passing argument 2 of
    'g_byte_array_append' differ in signedness
    prop_pixbuf.c:168: warning: pointer targets in passing argument 3 of
    'xmlNewChild' differ in signedness
    git commit

 lib/dia_image.c   |    1 -
 lib/prop_pixbuf.c |   27 ++++++++++++++-------------
 2 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/lib/dia_image.c b/lib/dia_image.c
index 1fb19b3..101b5f4 100644
--- a/lib/dia_image.c
+++ b/lib/dia_image.c
@@ -186,7 +186,6 @@ DiaImage *
 dia_image_new_from_pixbuf (GdkPixbuf *pixbuf)
 {
   DiaImage *dia_img;
-  GdkPixbuf *image;
 
   dia_img = DIA_IMAGE(g_object_new(DIA_TYPE_IMAGE, NULL));
   dia_img->image = g_object_ref (pixbuf);
diff --git a/lib/prop_pixbuf.c b/lib/prop_pixbuf.c
index 9d174b6..20127a2 100644
--- a/lib/prop_pixbuf.c
+++ b/lib/prop_pixbuf.c
@@ -78,12 +78,12 @@ data_pixbuf (DataNode data)
     guint save = 0;
 #  define BUF_SIZE 4096
     guchar buf[BUF_SIZE];
-    guchar *in = NULL; /* direct access, not involving another xmlStrDup/xmlFree */
+    gchar *in = NULL; /* direct access, not involving another xmlStrDup/xmlFree */
     gssize len = 0;
 
-    if (node->children && xmlStrcmp (node->children->name, "text") == 0) {
-      in = node->children->content;
-      len = strlen (in);
+    if (node->children && xmlStrcmp (node->children->name, (const xmlChar*)"text") == 0) {
+      in = (gchar *)node->children->content;
+      len = strlen ((char *)in);
     }
 
     do {
@@ -100,7 +100,7 @@ data_pixbuf (DataNode data)
     if (gdk_pixbuf_loader_close (loader, error ? NULL : &error)) {
       pixbuf = g_object_ref (gdk_pixbuf_loader_get_pixbuf (loader));
     } else {
-      message_warning ("%s", error->message);
+      message_warning (_("Failed to load image form diagram:\n%s"), error->message);
       g_error_free (error);
     }
 
@@ -131,15 +131,15 @@ _pixbuf_encode (const gchar *buf,
 		gpointer data)
 {
   EncodeData *ed = data;
-  gsize size;
   guint old_len;
   gsize growth = (count / 3 + 1) * 4 + 4 + ((count / 3 + 1) * 4 + 4) / 72 + 1;
-  guchar *out;
+  gchar *out;
 
   old_len = ed->array->len;
   g_byte_array_set_size (ed->array, ed->size + growth);
-  out = &ed->array->data[ed->size];
-  ed->size += g_base64_encode_step (buf, count, TRUE, out, &ed->state, &ed->save);
+  out = (gchar *)&ed->array->data[ed->size];
+  ed->size += g_base64_encode_step ((guchar *)buf, count, TRUE, 
+                                    out, &ed->state, &ed->save);
 
   return TRUE;
 }
@@ -159,13 +159,14 @@ data_add_pixbuf (AttributeNode attr, GdkPixbuf *pixbuf)
     return;
   }
   /* FIXME: is there enough space for the rest? */
-  ed.size += g_base64_encode_close (TRUE, &ed.array->data[ed.size], &ed.state, &ed.save);
+  ed.size += g_base64_encode_close (TRUE, (gchar *)&ed.array->data[ed.size], 
+				    &ed.state, &ed.save);
   /* is the array 0-terminated? */
   if (ed.array->data[ed.size] != 0) {
-    g_byte_array_append (ed.array, "\0", 1);
-    ed.array->data[ed.size] = '\0';
+    g_byte_array_append (ed.array, '\0', 1);
+    ed.array->data[ed.size] = (guint8)'\0';
   }
-  (void)xmlNewChild (comp_attr, NULL, "data", ed.array->data);
+  (void)xmlNewChild (comp_attr, NULL, (const xmlChar *)"data", ed.array->data);
 
   g_byte_array_free (ed.array, TRUE);
 }



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