[cairo-commit] cairo/src cairo-atsui-font.c, 1.5, 1.6 cairo-font.c, 1.39, 1.40 cairo-ft-font.c, 1.51, 1.52 cairo-gstate.c, 1.101, 1.102 cairo-output-stream.c, 1.1, 1.2 cairo.c, 1.70, 1.71 cairo.h, 1.90, 1.91 cairoint.h, 1.116, 1.117

Carl Worth commit at pdx.freedesktop.org
Wed Apr 6 13:01:15 PDT 2005


Committed by: cworth

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

Modified Files:
	cairo-atsui-font.c cairo-font.c cairo-ft-font.c cairo-gstate.c 
	cairo-output-stream.c cairo.c cairo.h cairoint.h 
Log Message:

        * src/cairo.h: Make handling of unsigned char* vs. char*
        consistent. Change all parameters that are actual string data from
        unsigned char* to char* (cairo_text_extents, cairo_show_text,
        cairo_text_path). Change all data buffers from char* to unsigned
        char* (cairo_write_func_t).

        * src/cairo-gstate.c: (_cairo_gstate_text_to_glyphs):
        * src/cairo-ft-font.c: (_cairo_ft_font_text_to_glyphs):
        * src/cairo-font.c: (_cairo_font_text_to_glyphs):
        * src/cairo-atsui-font.c: (_cairo_atsui_font_text_to_glyphs):
        * src/cairoint.h:
        * src/cairo.c: (cairo_text_extents), (cairo_show_text),
        (cairo_text_path): Track changes from unsigned char* to
        char*. Convert to unsigned only at the internal interface to
        unicode processing.

        * test/move-to-show-surface.c: (draw):
        * src/cairo-output-stream.c: (_cairo_output_stream_printf),
        (stdio_write): Track change from char* to unsigned char*.


Index: cairo-atsui-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-atsui-font.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cairo-atsui-font.c	29 Mar 2005 19:24:10 -0000	1.5
+++ cairo-atsui-font.c	6 Apr 2005 20:01:13 -0000	1.6
@@ -233,9 +233,10 @@
 
 
 static cairo_status_t
-_cairo_atsui_font_text_to_glyphs(void *abstract_font,
-                                 const unsigned char *utf8,
-                                 cairo_glyph_t ** glyphs, int *nglyphs)
+_cairo_atsui_font_text_to_glyphs(void		*abstract_font,
+                                 const char     *utf8,
+                                 cairo_glyph_t **glyphs,
+				 int		*num_glyphs)
 {
     cairo_atsui_font_t *font = abstract_font;
     size_t i;
@@ -285,16 +286,16 @@
                                                         &layoutRecords,
                                                         &glyphCount);
 
-    *nglyphs = glyphCount - 1;
+    *num_glyphs = glyphCount - 1;
 
 
     *glyphs =
-        (cairo_glyph_t *) malloc(*nglyphs * (sizeof(cairo_glyph_t)));
+        (cairo_glyph_t *) malloc(*num_glyphs * (sizeof(cairo_glyph_t)));
     if (*glyphs == NULL) {
         return CAIRO_STATUS_NO_MEMORY;
     }
 
-    for (i = 0; i < *nglyphs; i++) {
+    for (i = 0; i < *num_glyphs; i++) {
         (*glyphs)[i].index = layoutRecords[i].glyphID;
         (*glyphs)[i].x = FixedToFloat(layoutRecords[i].realPos);
         (*glyphs)[i].y = 0;

Index: cairo-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-font.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- cairo-font.c	2 Apr 2005 13:18:11 -0000	1.39
+++ cairo-font.c	6 Apr 2005 20:01:13 -0000	1.40
@@ -72,10 +72,10 @@
 }
 
 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 char     *utf8, 
+			    cairo_glyph_t **glyphs, 
+			    int 	   *num_glyphs)
 {
     return font->backend->text_to_glyphs (font, utf8, glyphs, num_glyphs);
 }

Index: cairo-ft-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ft-font.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- cairo-ft-font.c	4 Apr 2005 16:47:12 -0000	1.51
+++ cairo-ft-font.c	6 Apr 2005 20:01:13 -0000	1.52
@@ -720,10 +720,10 @@
 }
 
 static cairo_status_t 
-_cairo_ft_font_text_to_glyphs (void			*abstract_font,
-			       const unsigned char	*utf8,
-			       cairo_glyph_t		**glyphs, 
-			       int			*nglyphs)
+_cairo_ft_font_text_to_glyphs (void	      *abstract_font,
+			       const char     *utf8,
+			       cairo_glyph_t **glyphs, 
+			       int	      *num_glyphs)
 {
     double x = 0., y = 0.;
     size_t i;
@@ -737,7 +737,7 @@
 
     _cairo_ft_font_get_glyph_cache_key (font, &key);
 
-    status = _cairo_utf8_to_ucs4 (utf8, -1, &ucs4, nglyphs);
+    status = _cairo_utf8_to_ucs4 ((unsigned char*)utf8, -1, &ucs4, num_glyphs);
     if (!CAIRO_OK (status))
 	return status;
 
@@ -754,13 +754,13 @@
 	goto FAIL2;
     }
 
-    *glyphs = (cairo_glyph_t *) malloc ((*nglyphs) * (sizeof (cairo_glyph_t)));
+    *glyphs = (cairo_glyph_t *) malloc ((*num_glyphs) * (sizeof (cairo_glyph_t)));
     if (*glyphs == NULL) {
 	status = CAIRO_STATUS_NO_MEMORY;
 	goto FAIL2;
     }
 
-    for (i = 0; i < *nglyphs; i++)
+    for (i = 0; i < *num_glyphs; i++)
     {            
         (*glyphs)[i].index = FT_Get_Char_Index (face, ucs4[i]);
 	(*glyphs)[i].x = x;

Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- cairo-gstate.c	4 Apr 2005 13:49:19 -0000	1.101
+++ cairo-gstate.c	6 Apr 2005 20:01:13 -0000	1.102
@@ -2342,10 +2342,10 @@
 }
 
 cairo_status_t
-_cairo_gstate_text_to_glyphs (cairo_gstate_t	  *gstate, 
-			      const unsigned char *utf8,
-			      cairo_glyph_t	 **glyphs,
-			      int		  *num_glyphs)
+_cairo_gstate_text_to_glyphs (cairo_gstate_t *gstate, 
+			      const char     *utf8,
+			      cairo_glyph_t **glyphs,
+			      int	     *num_glyphs)
 {
     cairo_status_t status;
 

Index: cairo-output-stream.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-output-stream.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo-output-stream.c	17 Mar 2005 15:30:05 -0000	1.1
+++ cairo-output-stream.c	6 Apr 2005 20:01:13 -0000	1.2
@@ -87,12 +87,12 @@
 _cairo_output_stream_printf (cairo_output_stream_t *stream,
 			     const char *fmt, ...)
 {
-    char buffer[512];
+    unsigned char buffer[512];
     int length;
     va_list ap;
 
     va_start (ap, fmt);
-    length = vsnprintf (buffer, sizeof buffer, fmt, ap);
+    length = vsnprintf ((char *)buffer, sizeof buffer, fmt, ap);
     va_end (ap);
 
     /* FIXME: This function is only for internal use and callers are
@@ -123,7 +123,7 @@
  * don't have to pull in stdio. */
 
 static cairo_status_t
-stdio_write (void *closure, const char *data, unsigned int length)
+stdio_write (void *closure, const unsigned char *data, unsigned int length)
 {
 	FILE *fp = closure;
 

Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- cairo.c	4 Apr 2005 16:47:12 -0000	1.70
+++ cairo.c	6 Apr 2005 20:01:13 -0000	1.71
@@ -1698,7 +1698,7 @@
  **/
 void
 cairo_text_extents (cairo_t              *cr,
-		    const unsigned char	 *utf8,
+		    const char	 	 *utf8,
 		    cairo_text_extents_t *extents)
 {
     cairo_glyph_t *glyphs = NULL;
@@ -1768,7 +1768,7 @@
 }
 
 void
-cairo_show_text (cairo_t *cr, const unsigned char *utf8)
+cairo_show_text (cairo_t *cr, const char *utf8)
 {
     cairo_glyph_t *glyphs = NULL;
     int num_glyphs;
@@ -1809,7 +1809,7 @@
 }
 
 void
-cairo_text_path  (cairo_t *cr, const unsigned char *utf8)
+cairo_text_path  (cairo_t *cr, const char *utf8)
 {
     cairo_glyph_t *glyphs = NULL;
     int num_glyphs;

Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- cairo.h	4 Apr 2005 16:47:12 -0000	1.90
+++ cairo.h	6 Apr 2005 20:01:13 -0000	1.91
@@ -563,7 +563,7 @@
 cairo_transform_font (cairo_t *cr, cairo_matrix_t *matrix);
 
 void
-cairo_show_text (cairo_t *cr, const unsigned char *utf8);
+cairo_show_text (cairo_t *cr, const char *utf8);
 
 void
 cairo_show_glyphs (cairo_t *cr, cairo_glyph_t *glyphs, int num_glyphs);
@@ -579,9 +579,9 @@
 cairo_set_font (cairo_t *cr, cairo_font_t *font);
 
 void
-cairo_text_extents (cairo_t                *cr,
-		    const unsigned char    *utf8,
-		    cairo_text_extents_t   *extents);
+cairo_text_extents (cairo_t              *cr,
+		    const char    	 *utf8,
+		    cairo_text_extents_t *extents);
 
 void
 cairo_glyph_extents (cairo_t               *cr,
@@ -590,7 +590,7 @@
 		     cairo_text_extents_t  *extents);
 
 void
-cairo_text_path  (cairo_t *cr, const unsigned char *utf8);
+cairo_text_path  (cairo_t *cr, const char *utf8);
 
 void
 cairo_glyph_path (cairo_t *cr, cairo_glyph_t *glyphs, int num_glyphs);
@@ -1028,9 +1028,9 @@
  * CAIRO_STATUS_SUCCESS if all the data was successfully written,
  * CAIRO_STATUS_WRITE_ERROR otherwise.
  */
-typedef cairo_status_t (*cairo_write_func_t) (void *closure,
-					      const char *data,
-					      unsigned int length);
+typedef cairo_status_t (*cairo_write_func_t) (void		  *closure,
+					      const unsigned char *data,
+					      unsigned int	   length);
 
 #define CAIRO_API_SHAKEUP_FLAG_DAY 0
 

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- cairoint.h	4 Apr 2005 13:49:19 -0000	1.116
+++ cairoint.h	6 Apr 2005 20:01:13 -0000	1.117
@@ -468,7 +468,7 @@
 				      cairo_font_extents_t     *extents);
 
     cairo_status_t (*text_to_glyphs) (void                     *font,
-				      const unsigned char      *utf8,
+				      const char	       *utf8,
 				      cairo_glyph_t	      **glyphs, 
 				      int		       *num_glyphs);
 
@@ -1137,10 +1137,10 @@
 			cairo_font_t *font);
 
 cairo_private cairo_status_t
-_cairo_gstate_text_to_glyphs (cairo_gstate_t	  *font,
-			      const unsigned char *utf8, 
-			      cairo_glyph_t	 **glyphs, 
-			      int		  *num_glyphs);
+_cairo_gstate_text_to_glyphs (cairo_gstate_t *font,
+			      const char     *utf8, 
+			      cairo_glyph_t **glyphs, 
+			      int	     *num_glyphs);
 
 cairo_private cairo_status_t
 _cairo_gstate_glyph_extents (cairo_gstate_t *gstate,
@@ -1205,10 +1205,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 char     *utf8, 
+			    cairo_glyph_t **glyphs, 
+			    int 	   *num_glyphs);
 
 cairo_private cairo_status_t
 _cairo_font_glyph_extents (cairo_font_t	        *font,




More information about the cairo-commit mailing list