Fix compile warnings
authorBenjamin Otte <otte@gnome.org>
Thu, 17 Sep 2009 11:18:22 +0000 (13:18 +0200)
committerBenjamin Otte <otte@gnome.org>
Mon, 19 Oct 2009 22:40:40 +0000 (00:40 +0200)
pixman/pixman-fast-path.c
pixman/pixman-mmx.c
test/alpha-test.c
test/blitters-test.c
test/clip-test.c
test/composite-test.c
test/gradient-test.c
test/utils.h

index 25f6016..c053229 100644 (file)
@@ -723,6 +723,7 @@ fast_composite_over_8888_8888 (pixman_implementation_t *imp,
     }
 }
 
+#if 0
 static void
 fast_composite_over_8888_0888 (pixman_implementation_t *imp,
                               pixman_op_t              op,
@@ -773,6 +774,7 @@ fast_composite_over_8888_0888 (pixman_implementation_t *imp,
        }
     }
 }
+#endif
 
 static void
 fast_composite_over_8888_0565 (pixman_implementation_t *imp,
index 3595742..aaddff5 100644 (file)
@@ -3153,6 +3153,7 @@ mmx_composite_copy_area (pixman_implementation_t *imp,
                     src_x, src_y, dest_x, dest_y, width, height);
 }
 
+#if 0
 static void
 mmx_composite_over_x888_8_8888 (pixman_implementation_t *imp,
                                 pixman_op_t              op,
@@ -3219,6 +3220,7 @@ mmx_composite_over_x888_8_8888 (pixman_implementation_t *imp,
 
     _mm_empty ();
 }
+#endif
 
 static const pixman_fast_path_t mmx_fast_paths[] =
 {
index e2b97c7..fd6b2ec 100644 (file)
@@ -14,7 +14,6 @@ main (int argc, char **argv)
     uint32_t *src = malloc (WIDTH * HEIGHT * 4);
     pixman_image_t *grad_img;
     pixman_image_t *alpha_img;
-    pixman_image_t *solid_img;
     pixman_image_t *dest_img;
     pixman_image_t *src_img;
     int i;
@@ -26,24 +25,25 @@ main (int argc, char **argv)
     pixman_point_fixed_t p1 = { pixman_double_to_fixed (0), 0 };
     pixman_point_fixed_t p2 = { pixman_double_to_fixed (WIDTH),
                                pixman_int_to_fixed (0) };
+#if 0
     pixman_transform_t trans = {
        { { pixman_double_to_fixed (2), pixman_double_to_fixed (0.5), pixman_double_to_fixed (-100), },
          { pixman_double_to_fixed (0), pixman_double_to_fixed (3), pixman_double_to_fixed (0), },
          { pixman_double_to_fixed (0), pixman_double_to_fixed (0.000), pixman_double_to_fixed (1.0) } 
        }
     };
-
-    pixman_transform_t id = {
+#else
+    pixman_transform_t trans = {
        { { pixman_fixed_1, 0, 0 },
          { 0, pixman_fixed_1, 0 },
          { 0, 0, pixman_fixed_1 } }
     };
+#endif
 
     pixman_point_fixed_t c_inner;
     pixman_point_fixed_t c_outer;
     pixman_fixed_t r_inner;
     pixman_fixed_t r_outer;
-    pixman_color_t red = { 0xffff, 0x0000, 0x0000, 0xffff };
     
     for (i = 0; i < WIDTH * HEIGHT; ++i)
        alpha[i] = 0x4f00004f; /* pale blue */
@@ -91,7 +91,7 @@ main (int argc, char **argv)
     grad_img = pixman_image_create_linear_gradient  (&p1, &p2,
                                                    stops, 2);
 
-    pixman_image_set_transform (grad_img, &id);
+    pixman_image_set_transform (grad_img, &trans);
     pixman_image_set_repeat (grad_img, PIXMAN_REPEAT_PAD);
     
     pixman_image_composite (PIXMAN_OP_OVER, grad_img, NULL, alpha_img,
index 569e946..b8b6eba 100644 (file)
@@ -56,7 +56,8 @@ aligned_malloc (size_t align, size_t size)
     void *result;
 
 #ifdef HAVE_POSIX_MEMALIGN
-    posix_memalign (&result, align, size);
+    if (posix_memalign (&result, align, size) != 0)
+      result = NULL;
 #else
     result = malloc (size);
 #endif
index 9000137..cbab447 100644 (file)
@@ -31,9 +31,11 @@ main (int argc, char **argv)
            { pixman_int_to_fixed (0), { 0xffff, 0x0000, 0x0000, 0xffff } },
            { pixman_int_to_fixed (1), { 0xffff, 0xffff, 0x0000, 0xffff } }
        };
+#if 0
     pixman_point_fixed_t p1 = { 0, 0 };
     pixman_point_fixed_t p2 = { pixman_int_to_fixed (WIDTH),
                                pixman_int_to_fixed (HEIGHT) };
+#endif
     pixman_point_fixed_t c_inner;
     pixman_point_fixed_t c_outer;
     pixman_fixed_t r_inner;
index 49e0220..2f14502 100644 (file)
@@ -77,6 +77,9 @@ writer (void *src, uint32_t value, int size)
     case 4:
        *(uint32_t *)src = value;
        break;
+
+    default:
+        break;
     }
 }
 
@@ -113,7 +116,7 @@ main (int argc, char **argv)
 
     window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
-    gtk_window_set_default_size (window, 800, 600);
+    gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
     
     g_signal_connect (window, "delete-event",
                      G_CALLBACK (gtk_main_quit),
index 2593ee3..c95c714 100644 (file)
@@ -21,18 +21,20 @@ main (int argc, char **argv)
     pixman_point_fixed_t p1 = { pixman_double_to_fixed (0), 0 };
     pixman_point_fixed_t p2 = { pixman_double_to_fixed (WIDTH / 8.),
                                pixman_int_to_fixed (0) };
+#if 0
     pixman_transform_t trans = {
        { { pixman_double_to_fixed (2), pixman_double_to_fixed (0.5), pixman_double_to_fixed (-100), },
          { pixman_double_to_fixed (0), pixman_double_to_fixed (3), pixman_double_to_fixed (0), },
          { pixman_double_to_fixed (0), pixman_double_to_fixed (0.000), pixman_double_to_fixed (1.0) } 
        }
     };
-
-    pixman_transform_t id = {
+#else
+    pixman_transform_t trans = {
        { { pixman_fixed_1, 0, 0 },
          { 0, pixman_fixed_1, 0 },
          { 0, 0, pixman_fixed_1 } }
     };
+#endif
 
     pixman_point_fixed_t c_inner;
     pixman_point_fixed_t c_outer;
@@ -67,7 +69,7 @@ main (int argc, char **argv)
     src_img = pixman_image_create_linear_gradient  (&p1, &p2,
                                                    stops, 2);
     
-    pixman_image_set_transform (src_img, &id);
+    pixman_image_set_transform (src_img, &trans);
     pixman_image_set_repeat (src_img, PIXMAN_REPEAT_PAD);
     
     pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img,
index bc110d8..2cb13bc 100644 (file)
@@ -1,6 +1,13 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <glib.h>
+#include <gtk/gtk.h>
 #include "pixman.h"
 
 void show_image (pixman_image_t *image);
+
+GdkPixbuf *pixbuf_from_argb32 (uint32_t *bits,
+                              gboolean has_alpha,
+                               int width,
+                               int height,
+                               int stride);