[goffice] pixbuf: fix warnings



commit 3bf3453e5a50067c58947c85c0be5cd319394f8d
Author: Morten Welinder <terra gnome org>
Date:   Tue Jul 30 14:11:14 2013 -0400

    pixbuf: fix warnings
    
    size_t != long.  No good C solution for this without C99.

 goffice/utils/go-pixbuf.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/goffice/utils/go-pixbuf.c b/goffice/utils/go-pixbuf.c
index 831ea0c..cb83d7a 100644
--- a/goffice/utils/go-pixbuf.c
+++ b/goffice/utils/go-pixbuf.c
@@ -116,9 +116,10 @@ go_pixbuf_load_data (GOImage *image, GsfXMLIn *xin)
        g_return_if_fail (stride > 0);
 
        length = gsf_base64_decode_simple (xin->content->str, strlen(xin->content->str));
-       expected = image->height * stride;
+       expected = image->height * (size_t)stride;
        if (expected != length)
-               g_critical ("Invalid image size, expected %lu bytes, got %lu", expected, length);
+               g_critical ("Invalid image size, expected %" G_GSIZE_FORMAT " bytes, got %" G_GSIZE_FORMAT,
+                           expected, length);
        image->data = g_try_malloc (expected);
        if (image->data == NULL) {
                g_critical ("go_pixbuf_load_data: assertion `image->data != NULL' failed");


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