[cairo-commit] pixman/src src/cairo-lzw.c src/cairo-type1-subset.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Aug 7 23:59:06 PDT 2006


 pixman/src/ictri.c       |    6 +++---
 src/cairo-lzw.c          |   11 +++++------
 src/cairo-type1-subset.c |    8 ++++----
 3 files changed, 12 insertions(+), 13 deletions(-)

New commits:
diff-tree 77fd0efa9a055c13e685f4c6b01597ae67a36fb7 (from 56791ab31d484452cd1ddefd653590095d9f6191)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 8 02:58:50 2006 -0400

    Fix few remaining compiler warnings, revealed by -O3

diff --git a/pixman/src/ictri.c b/pixman/src/ictri.c
index 09902ab..4080239 100644
--- a/pixman/src/ictri.c
+++ b/pixman/src/ictri.c
@@ -143,7 +143,7 @@ pixman_composite_triangles (pixman_opera
 		      const pixman_triangle_t	*tris,
 		      int		ntris)
 {
-    pixman_box16_t	bounds;
+    pixman_box16_t	bounds = {0, 0, 0, 0}; /* shut gcc up */
     pixman_image_t		*image = NULL;
     int		xDst, yDst;
     int		xRel, yRel;
@@ -215,7 +215,7 @@ pixman_composite_tri_strip (pixman_opera
 		     int		npoints)
 {
     pixman_triangle_t		tri;
-    pixman_box16_t	bounds;
+    pixman_box16_t	bounds = {0, 0, 0, 0}; /* shut gcc up */
     pixman_image_t		*image = NULL;
     int		xDst, yDst;
     int		xRel, yRel;
@@ -292,7 +292,7 @@ pixman_composite_tri_fan (pixman_operato
 		   int			npoints)
 {
     pixman_triangle_t		tri;
-    pixman_box16_t	bounds;
+    pixman_box16_t	bounds = {0, 0, 0, 0}; /* shut gcc up */
     pixman_image_t		*image = NULL;
     const pixman_point_fixed_t	*first;
     int		xDst, yDst;
diff --git a/src/cairo-lzw.c b/src/cairo-lzw.c
index d8776db..ac9ef41 100644
--- a/src/cairo-lzw.c
+++ b/src/cairo-lzw.c
@@ -43,7 +43,7 @@ typedef struct _lzw_buf {
     int data_size;
     int num_data;
     uint32_t pending;
-    int pending_bits;
+    unsigned int pending_bits;
 } lzw_buf_t;
 
 /* An lzw_buf_t is a simple, growable chunk of memory for holding
@@ -67,6 +67,10 @@ _lzw_buf_init (lzw_buf_t *buf, int size)
 	size = 16;
 
     buf->status = CAIRO_STATUS_SUCCESS;
+    buf->data_size = size;
+    buf->num_data = 0;
+    buf->pending = 0;
+    buf->pending_bits = 0;
 
     buf->data = malloc (size);
     if (buf->data == NULL) {
@@ -74,11 +78,6 @@ _lzw_buf_init (lzw_buf_t *buf, int size)
 	buf->status = CAIRO_STATUS_NO_MEMORY;
 	return;
     }
-
-    buf->data_size = size;
-    buf->num_data = 0;
-    buf->pending = 0;
-    buf->pending_bits = 0;
 }
 
 /* Increase the buffer size by doubling.
diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index 26ac97a..52f05f8 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -252,7 +252,7 @@ cairo_type1_font_subset_write_header (ca
 					 const char *name)
 {
     const char *start, *end, *segment_end;
-    int i;
+    unsigned int i;
 
     segment_end = font->header_segment + font->header_segment_size;
 
@@ -399,7 +399,7 @@ static int
 cairo_type1_font_subset_lookup_glyph (cairo_type1_font_subset_t *font,
 				      const char *glyph_name, int length)
 {
-    int i;
+    unsigned int i;
 
     for (i = 0; i < font->base.num_glyphs; i++) {
 	if (font->glyphs[i].name &&
@@ -414,7 +414,7 @@ cairo_type1_font_subset_lookup_glyph (ca
 static cairo_status_t
 cairo_type1_font_subset_get_glyph_names_and_widths (cairo_type1_font_subset_t *font)
 {
-    int i;
+    unsigned int i;
     char buffer[256];
     FT_Error error;
 
@@ -929,7 +929,7 @@ static void
 cairo_type1_font_subset_destroy (void *abstract_font)
 {
     cairo_type1_font_subset_t *font = abstract_font;
-    int i;
+    unsigned int i;
 
     /* If the subset generation failed, some of the pointers below may
      * be NULL depending on at which point the error occurred. */


More information about the cairo-commit mailing list