[cairo-commit] cairo/src cairo-font.c, 1.38, 1.39 cairo-ft-font.c, 1.49, 1.50 cairo-gstate.c, 1.98, 1.99 cairo-image-surface.c, 1.30, 1.31 cairo-pdf-surface.c, 1.22, 1.23 cairo-png.c, 1.1, 1.2 cairo-ps-surface.c, 1.28, 1.29 cairo-unicode.c, 1.1, 1.2 cairo-xlib-surface.c, 1.52, 1.53 cairo.c, 1.67, 1.68 cairo.h, 1.87, 1.88 cairoint.h, 1.114, 1.115

Carl Worth commit at pdx.freedesktop.org
Sat Apr 2 05:18:15 PST 2005


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv692/src

Modified Files:
	cairo-font.c cairo-ft-font.c cairo-gstate.c 
	cairo-image-surface.c cairo-pdf-surface.c cairo-png.c 
	cairo-ps-surface.c cairo-unicode.c cairo-xlib-surface.c 
	cairo.c cairo.h cairoint.h 
Log Message:

        * src/cairo.h:
        * src/cairo.c: (cairo_set_target_image), (cairo_text_extents),
        (cairo_show_text), (cairo_text_path):
        * src/cairo-image-surface.c: (cairo_image_surface_create_for_data):
        * src/cairo-gstate.c: (_cairo_gstate_text_to_glyphs):
        * src/cairo-font.c: (_cairo_font_create): Style and indentation
        fixes.

        * src/cairo-ft-font.c: (_cairo_ft_font_create): Add (unsigned
        char*) cast to quiet new gcc-4 warnings.

        * src/cairo-ft-font.c: (_cairo_ft_font_glyph_extents): Initialize
        variables to quiet new gcc-4 warnings.

        * src/cairo-pdf-surface.c: (cairo_pdf_ft_font_write_generic_table),
        (cairo_pdf_ft_font_write_glyf_table):
        * src/cairo-png.c: (cairo_surface_write_png),
        (cairo_image_surface_create_for_png):
        * src/cairo-xlib-surface.c: (_get_image_surface):
        * src/cairo-ps-surface.c: (_cairo_ps_surface_copy_page):
        Use unsigned char* as expected by freetype, libpng, Xlib, and zlib.

        * src/cairoint.h:
        * src/cairo-unicode.c: (_utf8_get_char), (_utf8_get_char_extended),
        (_cairo_utf8_to_ucs4), (_cairo_utf8_to_utf16): Propagate unsigned
        char* down from cairo_text_extents.


Index: cairo-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-font.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- cairo-font.c	23 Mar 2005 21:52:54 -0000	1.38
+++ cairo-font.c	2 Apr 2005 13:18:11 -0000	1.39
@@ -42,11 +42,11 @@
 /* Now the internal "unscaled + scale" font API */
 
 cairo_private cairo_status_t
-_cairo_font_create (const char           *family, 
+_cairo_font_create (const char	        *family, 
 		    cairo_font_slant_t   slant, 
 		    cairo_font_weight_t  weight,
-		    cairo_font_scale_t   *sc,
-		    cairo_font_t         **font)
+		    cairo_font_scale_t  *sc,
+		    cairo_font_t       **font)
 {
     const cairo_font_backend_t *backend = CAIRO_FONT_BACKEND_DEFAULT;
 

Index: cairo-ft-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ft-font.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- cairo-ft-font.c	23 Mar 2005 22:17:40 -0000	1.49
+++ cairo-ft-font.c	2 Apr 2005 13:18:11 -0000	1.50
@@ -581,7 +581,7 @@
 }
 
 static cairo_status_t
-_cairo_ft_font_create (const char          *family, 
+_cairo_ft_font_create (const char	   *family, 
                        cairo_font_slant_t   slant, 
                        cairo_font_weight_t  weight,
 		       cairo_font_scale_t  *scale,
@@ -623,7 +623,7 @@
         break;
     }
 
-    if (!FcPatternAddString (pattern, FC_FAMILY, family))
+    if (!FcPatternAddString (pattern, FC_FAMILY, (unsigned char *) family))
 	goto FREE_PATTERN;
     if (!FcPatternAddInteger (pattern, FC_SLANT, fcslant))
 	goto FREE_PATTERN;
@@ -833,7 +833,8 @@
     cairo_ft_font_t *font = abstract_font;
     cairo_point_double_t origin;
     cairo_point_double_t glyph_min, glyph_max;
-    cairo_point_double_t total_min, total_max;
+    /* Initialize just to squelch anti-helpful compiler warning. */
+    cairo_point_double_t total_min = { 0, 0}, total_max = {0,0};
 
     cairo_image_glyph_cache_entry_t *img = NULL;
     cairo_cache_t *cache;

Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- cairo-gstate.c	30 Mar 2005 17:31:49 -0000	1.98
+++ cairo-gstate.c	2 Apr 2005 13:18:11 -0000	1.99
@@ -2366,10 +2366,10 @@
 }
 
 cairo_status_t
-_cairo_gstate_text_to_glyphs (cairo_gstate_t *gstate, 
+_cairo_gstate_text_to_glyphs (cairo_gstate_t	  *gstate, 
 			      const unsigned char *utf8,
-			      cairo_glyph_t **glyphs,
-			      int *nglyphs)
+			      cairo_glyph_t	 **glyphs,
+			      int		  *num_glyphs)
 {
     cairo_status_t status;
 
@@ -2393,16 +2393,16 @@
     }
 
     status = _cairo_font_text_to_glyphs (gstate->font, 
-					 utf8, glyphs, nglyphs);
+					 utf8, glyphs, num_glyphs);
 
-    if (status || !glyphs || !nglyphs || !(*glyphs) || !(nglyphs))
+    if (status || !glyphs || !num_glyphs || !(*glyphs) || !(num_glyphs))
 	return status;
 
     /* The font responded in glyph space, starting from (0,0).  Convert to
        user space by applying the font transform, then add any current point
        offset. */
 
-    for (i = 0; i < *nglyphs; ++i) {
+    for (i = 0; i < *num_glyphs; ++i) {
 	cairo_matrix_transform_point (&gstate->font_matrix, 
 				      &((*glyphs)[i].x),
 				      &((*glyphs)[i].y));

Index: cairo-image-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-image-surface.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- cairo-image-surface.c	2 Apr 2005 02:00:00 -0000	1.30
+++ cairo-image-surface.c	2 Apr 2005 13:18:11 -0000	1.31
@@ -195,7 +195,7 @@
  *   be created because of lack of memory
  **/
 cairo_surface_t *
-cairo_image_surface_create_for_data (char		*data,
+cairo_image_surface_create_for_data (char	       *data,
 				     cairo_format_t	format,
 				     int		width,
 				     int		height,

Index: cairo-pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf-surface.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- cairo-pdf-surface.c	28 Mar 2005 21:58:26 -0000	1.22
+++ cairo-pdf-surface.c	2 Apr 2005 13:18:11 -0000	1.23
@@ -462,7 +462,7 @@
 cairo_pdf_ft_font_write_generic_table (cairo_pdf_ft_font_t *font,
 				       unsigned long tag)
 {
-    char *buffer;
+    unsigned char *buffer;
     unsigned long size;
 
     size = 0;
@@ -480,7 +480,7 @@
     unsigned long start_offset, index, size;
     TT_Header *header;
     unsigned long begin, end;
-    char *buffer;
+    unsigned char *buffer;
     int i;
     union {
 	unsigned char *bytes;

Index: cairo-png.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-png.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo-png.c	28 Mar 2005 21:58:26 -0000	1.1
+++ cairo-png.c	2 Apr 2005 13:18:11 -0000	1.2
@@ -106,7 +106,7 @@
     }
 
     for (i = 0; i < image->height; i++)
-	rows[i] = image->data + i * image->stride;
+	rows[i] = (png_byte *) image->data + i * image->stride;
 
     png = png_create_write_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
     if (png == NULL) {
@@ -322,7 +322,7 @@
     if (height != NULL)
 	*height = png_height;
 
-    return cairo_image_surface_create_for_data (data, CAIRO_FORMAT_ARGB32,
+    return cairo_image_surface_create_for_data ((char *)data, CAIRO_FORMAT_ARGB32,
 						png_width, png_height, stride);
 
  BAIL3:

Index: cairo-ps-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps-surface.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- cairo-ps-surface.c	23 Mar 2005 21:49:33 -0000	1.28
+++ cairo-ps-surface.c	2 Apr 2005 13:18:11 -0000	1.29
@@ -278,8 +278,8 @@
     int i, x, y;
 
     cairo_solid_pattern_t white_pattern;
-    char *rgb, *compressed;
-    long rgb_size, compressed_size;
+    unsigned char *rgb, *compressed;
+    unsigned long rgb_size, compressed_size;
 
     rgb_size = 3 * width * height;
     rgb = malloc (rgb_size);

Index: cairo-unicode.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-unicode.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo-unicode.c	2 Feb 2005 00:29:17 -0000	1.1
+++ cairo-unicode.c	2 Apr 2005 13:18:11 -0000	1.2
@@ -117,14 +117,14 @@
     3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1
 };
 
-#define UTF8_NEXT_CHAR(p) (char *)((p) + utf8_skip_data[*(unsigned char *)(p)])
+#define UTF8_NEXT_CHAR(p) ((p) + utf8_skip_data[*(unsigned char *)(p)])
 
 /* Converts a sequence of bytes encoded as UTF-8 to a Unicode character.
  * If @p does not point to a valid UTF-8 encoded character, results are
  * undefined.
  **/
 static uint32_t
-_utf8_get_char (const char *p)
+_utf8_get_char (const unsigned char *p)
 {
     int i, mask = 0, len;
     uint32_t result;
@@ -142,8 +142,8 @@
  * and return (uint32_t)-2 on incomplete trailing character
  */
 static uint32_t
-_utf8_get_char_extended (const char *p,
-			 long        max_len)  
+_utf8_get_char_extended (const unsigned char *p,
+			 long		      max_len)  
 {
     int i, len;
     uint32_t wc = (unsigned char) *p;
@@ -220,14 +220,14 @@
  *   an invalid sequence was found.
  **/
 cairo_status_t
-_cairo_utf8_to_ucs4 (const char  *str,
-		     int          len,
-		     uint32_t   **result,
-		     int         *items_written)
+_cairo_utf8_to_ucs4 (const unsigned char *str,
+		     int		  len,
+		     uint32_t		**result,
+		     int		 *items_written)
 {
     uint32_t *str32 = NULL;
     int n_chars, i;
-    const char *in;
+    const unsigned char *in;
   
     in = str;
     n_chars = 0;
@@ -284,14 +284,14 @@
  *   an invalid sequence was found.
  **/
 cairo_status_t
-_cairo_utf8_to_utf16 (const char  *str,
-		      int         len,
-		      uint16_t   **result,
-		      int         *items_written)
+_cairo_utf8_to_utf16 (const unsigned char *str,
+		      int		   len,
+		      uint16_t		 **result,
+		      int		  *items_written)
 {
     uint16_t *str16 = NULL;
     int n16, i;
-    const char *in;
+    const unsigned char *in;
 
     in = str;
     n16 = 0;

Index: cairo-xlib-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- cairo-xlib-surface.c	23 Mar 2005 21:49:33 -0000	1.52
+++ cairo-xlib-surface.c	2 Apr 2005 13:18:11 -0000	1.53
@@ -183,9 +183,10 @@
 	x2 = surface->width;
 	y2 = surface->height;
     } else {
-	int width, height;
+	unsigned int width, height;
 	Window root_ignore;
-	int x_ignore, y_ignore, bwidth_ignore, depth_ignore;
+	int x_ignore, y_ignore;
+	unsigned int bwidth_ignore, depth_ignore;
 	
 	XGetGeometry (surface->dpy, 
 		      surface->drawable, 

Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- cairo.c	2 Apr 2005 02:00:00 -0000	1.67
+++ cairo.c	2 Apr 2005 13:18:11 -0000	1.68
@@ -331,10 +331,10 @@
 void
 cairo_set_target_image (cairo_t		*cr,
 			char		*data,
-			cairo_format_t	format,
-			int		width,
-			int		height,
-			int		stride)
+			cairo_format_t	 format,
+			int		 width,
+			int		 height,
+			int		 stride)
 {
     cairo_surface_t *surface;
 
@@ -1691,12 +1691,12 @@
  * affect the x_advance and y_advance values.
  **/
 void
-cairo_text_extents (cairo_t                *cr,
-		    const unsigned char    *utf8,
-		    cairo_text_extents_t   *extents)
+cairo_text_extents (cairo_t              *cr,
+		    const unsigned char	 *utf8,
+		    cairo_text_extents_t *extents)
 {
     cairo_glyph_t *glyphs = NULL;
-    int nglyphs;
+    int num_glyphs;
 
     CAIRO_CHECK_SANITY (cr);
     if (cr->status)
@@ -1712,7 +1712,7 @@
 	return;
     }
 
-    cr->status = _cairo_gstate_text_to_glyphs (cr->gstate, utf8, &glyphs, &nglyphs);
+    cr->status = _cairo_gstate_text_to_glyphs (cr->gstate, utf8, &glyphs, &num_glyphs);
     CAIRO_CHECK_SANITY (cr);
 
     if (cr->status) {
@@ -1721,7 +1721,7 @@
 	return;
     }
 	
-    cr->status = _cairo_gstate_glyph_extents (cr->gstate, glyphs, nglyphs, extents);
+    cr->status = _cairo_gstate_glyph_extents (cr->gstate, glyphs, num_glyphs, extents);
     CAIRO_CHECK_SANITY (cr);
     
     if (glyphs)
@@ -1765,7 +1765,7 @@
 cairo_show_text (cairo_t *cr, const unsigned char *utf8)
 {
     cairo_glyph_t *glyphs = NULL;
-    int nglyphs;
+    int num_glyphs;
 
     CAIRO_CHECK_SANITY (cr);
     if (cr->status)
@@ -1774,7 +1774,8 @@
     if (utf8 == NULL)
 	return;
 
-    cr->status = _cairo_gstate_text_to_glyphs (cr->gstate, utf8, &glyphs, &nglyphs);
+    cr->status = _cairo_gstate_text_to_glyphs (cr->gstate, utf8,
+					       &glyphs, &num_glyphs);
     CAIRO_CHECK_SANITY (cr);
 
     if (cr->status) {
@@ -1783,7 +1784,7 @@
 	return;
     }
 
-    cr->status = _cairo_gstate_show_glyphs (cr->gstate, glyphs, nglyphs);
+    cr->status = _cairo_gstate_show_glyphs (cr->gstate, glyphs, num_glyphs);
     CAIRO_CHECK_SANITY (cr);
 
     if (glyphs)
@@ -1805,13 +1806,14 @@
 cairo_text_path  (cairo_t *cr, const unsigned char *utf8)
 {
     cairo_glyph_t *glyphs = NULL;
-    int nglyphs;
+    int num_glyphs;
 
     CAIRO_CHECK_SANITY (cr);
     if (cr->status)
 	return;
 
-    cr->status = _cairo_gstate_text_to_glyphs (cr->gstate, utf8, &glyphs, &nglyphs);
+    cr->status = _cairo_gstate_text_to_glyphs (cr->gstate, utf8,
+					       &glyphs, &num_glyphs);
     CAIRO_CHECK_SANITY (cr);
 
     if (cr->status) {
@@ -1820,7 +1822,7 @@
 	return;
     }
 
-    cr->status = _cairo_gstate_glyph_path (cr->gstate, glyphs, nglyphs);
+    cr->status = _cairo_gstate_glyph_path (cr->gstate, glyphs, num_glyphs);
     CAIRO_CHECK_SANITY (cr);
 
     if (glyphs)

Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- cairo.h	2 Apr 2005 02:00:00 -0000	1.87
+++ cairo.h	2 Apr 2005 13:18:11 -0000	1.88
@@ -178,8 +178,8 @@
  *      we eliminate all the cairo_set_target functions.
  */
 void
-cairo_set_target_image (cairo_t	*cr,
-			char		*data,
+cairo_set_target_image (cairo_t	       *cr,
+			char  	       *data,
 			cairo_format_t	format,
 			int		width,
 			int		height,
@@ -919,7 +919,7 @@
 			    int			height);
 
 cairo_surface_t *
-cairo_image_surface_create_for_data (char			*data,
+cairo_image_surface_create_for_data (char		       *data,
 				     cairo_format_t		format,
 				     int			width,
 				     int			height,
@@ -991,14 +991,14 @@
 
 cairo_status_t
 cairo_matrix_set_affine (cairo_matrix_t *matrix,
-			 double a, double b,
-			 double c, double d,
+			 double  a, double  b,
+			 double  c, double  d,
 			 double tx, double ty);
 
 cairo_status_t
 cairo_matrix_get_affine (cairo_matrix_t *matrix,
-			 double *a, double *b,
-			 double *c, double *d,
+			 double  *a, double  *b,
+			 double  *c, double  *d,
 			 double *tx, double *ty);
 
 cairo_status_t

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- cairoint.h	2 Apr 2005 02:00:00 -0000	1.114
+++ cairoint.h	2 Apr 2005 13:18:11 -0000	1.115
@@ -1144,10 +1144,10 @@
 			cairo_font_t *font);
 
 cairo_private cairo_status_t
-_cairo_gstate_text_to_glyphs (cairo_gstate_t *font,
+_cairo_gstate_text_to_glyphs (cairo_gstate_t	  *font,
 			      const unsigned char *utf8, 
-			      cairo_glyph_t **glyphs, 
-			      int *num_glyphs);
+			      cairo_glyph_t	 **glyphs, 
+			      int		  *num_glyphs);
 
 cairo_private cairo_status_t
 _cairo_gstate_glyph_extents (cairo_gstate_t *gstate,
@@ -1186,11 +1186,11 @@
 /* cairo_font.c */
 
 cairo_private cairo_status_t
-_cairo_font_create (const char           *family, 
+_cairo_font_create (const char		*family, 
 		    cairo_font_slant_t   slant, 
 		    cairo_font_weight_t  weight,
-		    cairo_font_scale_t   *sc,
-		    cairo_font_t         **font);
+		    cairo_font_scale_t  *sc,
+		    cairo_font_t       **font);
 
 cairo_private void
 _cairo_font_init (cairo_font_t 		     *font, 
@@ -1212,10 +1212,10 @@
 			  cairo_font_extents_t *extents);
 
 cairo_private cairo_status_t
-_cairo_font_text_to_glyphs (cairo_font_t	 *font,
-			    const unsigned char  *utf8, 
-			    cairo_glyph_t 	**glyphs, 
-			    int 		 *num_glyphs);
+_cairo_font_text_to_glyphs (cairo_font_t	*font,
+			    const unsigned char *utf8, 
+			    cairo_glyph_t      **glyphs, 
+			    int 		*num_glyphs);
 
 cairo_private cairo_status_t
 _cairo_font_glyph_extents (cairo_font_t	        *font,
@@ -1721,16 +1721,16 @@
 /* cairo_unicode.c */
 
 cairo_private cairo_status_t
-_cairo_utf8_to_ucs4 (const char  *str,
-		     int          len,
-		     uint32_t   **result,
-		     int         *items_written);
+_cairo_utf8_to_ucs4 (const unsigned char *str,
+		     int		  len,
+		     uint32_t	        **result,
+		     int		 *items_written);
 
 cairo_private cairo_status_t
-_cairo_utf8_to_utf16 (const char  *str,
-		      int          len,
-		      uint16_t   **result,
-		      int         *items_written);
+_cairo_utf8_to_utf16 (const unsigned char *str,
+		      int		   len,
+		      uint16_t		 **result,
+		      int		  *items_written);
 
 /* cairo_output_stream.c */
 




More information about the cairo-commit mailing list