[cairo-commit] 4 commits - src/cairo-compiler-private.h src/cairoint.h src/cairo-path-fixed.c src/cairo-scaled-font.c src/cairo-unicode.c src/cairo-win32-surface.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed May 28 13:55:51 PDT 2008


 src/cairo-compiler-private.h |    2 +-
 src/cairo-path-fixed.c       |    2 +-
 src/cairo-scaled-font.c      |    2 +-
 src/cairo-unicode.c          |   34 ++++++++++++++++++----------------
 src/cairo-win32-surface.c    |    1 -
 src/cairoint.h               |   16 ++++++++--------
 6 files changed, 29 insertions(+), 28 deletions(-)

New commits:
commit 9b16b528dcfffc896cecbda87249ff09a7987eb7
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 28 16:48:13 2008 -0400

    [cairo-unicode] Make unicode conversion funcs take const char *utf8
    
    Instead of the previous const unsigned char *utf8.  This is in line
    with our public API now.

diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 0378f9b..e401f8f 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -1284,7 +1284,7 @@ _cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font,
             goto DONE;
     }
 
-    status = _cairo_utf8_to_ucs4 ((unsigned char*)utf8, -1, &ucs4, num_glyphs);
+    status = _cairo_utf8_to_ucs4 (utf8, -1, &ucs4, num_glyphs);
     if (status)
 	goto DONE;
 
diff --git a/src/cairo-unicode.c b/src/cairo-unicode.c
index 5f91de3..4ae5556 100644
--- a/src/cairo-unicode.c
+++ b/src/cairo-unicode.c
@@ -215,20 +215,21 @@ _utf8_get_char_extended (const unsigned char *p,
  *   an invalid sequence was found.
  **/
 cairo_status_t
-_cairo_utf8_to_ucs4 (const unsigned char *str,
-		     int		  len,
-		     uint32_t		**result,
-		     int		 *items_written)
+_cairo_utf8_to_ucs4 (const char *str,
+		     int	 len,
+		     uint32_t  **result,
+		     int	*items_written)
 {
     uint32_t *str32 = NULL;
     int n_chars, i;
     const unsigned char *in;
+    const unsigned char * const ustr = (const unsigned char *) str;
 
-    in = str;
+    in = ustr;
     n_chars = 0;
-    while ((len < 0 || str + len - in > 0) && *in)
+    while ((len < 0 || ustr + len - in > 0) && *in)
     {
-	uint32_t wc = _utf8_get_char_extended (in, str + len - in);
+	uint32_t wc = _utf8_get_char_extended (in, ustr + len - in);
 	if (wc & 0x80000000 || !UNICODE_VALID (wc))
 	    return _cairo_error (CAIRO_STATUS_INVALID_STRING);
 
@@ -243,7 +244,7 @@ _cairo_utf8_to_ucs4 (const unsigned char *str,
     if (!str32)
 	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
-    in = str;
+    in = ustr;
     for (i=0; i < n_chars; i++) {
 	str32[i] = _utf8_get_char (in);
 	in = UTF8_NEXT_CHAR (in);
@@ -280,19 +281,20 @@ _cairo_utf8_to_ucs4 (const unsigned char *str,
  *   an invalid sequence was found.
  **/
 cairo_status_t
-_cairo_utf8_to_utf16 (const unsigned char *str,
-		      int		   len,
-		      uint16_t		 **result,
-		      int		  *items_written)
+_cairo_utf8_to_utf16 (const char *str,
+		      int	  len,
+		      uint16_t **result,
+		      int	*items_written)
 {
     uint16_t *str16 = NULL;
     int n16, i;
     const unsigned char *in;
+    const unsigned char * const ustr = (const unsigned char *) str;
 
-    in = str;
+    in = ustr;
     n16 = 0;
-    while ((len < 0 || str + len - in > 0) && *in) {
-	uint32_t wc = _utf8_get_char_extended (in, str + len - in);
+    while ((len < 0 || ustr + len - in > 0) && *in) {
+	uint32_t wc = _utf8_get_char_extended (in, ustr + len - in);
 	if (wc & 0x80000000 || !UNICODE_VALID (wc))
 	    return _cairo_error (CAIRO_STATUS_INVALID_STRING);
 
@@ -311,7 +313,7 @@ _cairo_utf8_to_utf16 (const unsigned char *str,
     if (!str16)
 	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
-    in = str;
+    in = ustr;
     for (i = 0; i < n16;) {
 	uint32_t wc = _utf8_get_char (in);
 
diff --git a/src/cairoint.h b/src/cairoint.h
index f1bee25..24e818b 100755
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2276,20 +2276,20 @@ _cairo_gstate_get_antialias (cairo_gstate_t *gstate);
 /* cairo_unicode.c */
 
 cairo_private cairo_status_t
-_cairo_utf8_to_ucs4 (const unsigned char *str,
-		     int		  len,
-		     uint32_t	        **result,
-		     int		 *items_written);
+_cairo_utf8_to_ucs4 (const char *str,
+		     int	 len,
+		     uint32_t  **result,
+		     int	*items_written);
 
 #if CAIRO_HAS_WIN32_FONT+0 || CAIRO_HAS_QUARTZ_FONT+0
 # define CAIRO_HAS_UTF8_TO_UTF16 1
 #endif
 #if CAIRO_HAS_UTF8_TO_UTF16
 cairo_private cairo_status_t
-_cairo_utf8_to_utf16 (const unsigned char *str,
-		      int		   len,
-		      uint16_t		 **result,
-		      int		  *items_written);
+_cairo_utf8_to_utf16 (const char *str,
+		      int	  len,
+		      uint16_t  **result,
+		      int	 *items_written);
 #endif
 
 cairo_private cairo_status_t
commit df5ad168aa40ae0dfff8bf1b0830c9f4931d3b97
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 28 16:47:55 2008 -0400

    [cairo-path-fixed] Fixe compiler warning

diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 50aee76..58b3636 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -485,7 +485,7 @@ _cairo_path_fixed_interpret (const cairo_path_fixed_t		*path,
 			     void				*closure)
 {
     cairo_status_t status;
-    cairo_path_buf_t *buf;
+    const cairo_path_buf_t *buf;
     cairo_path_op_t op;
     cairo_bool_t forward = (dir == CAIRO_DIRECTION_FORWARD);
     int step = forward ? 1 : -1;
commit 6938f158983a62cd8041e19fa544f997cf49eecf
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 28 16:47:37 2008 -0400

    [cairo-win32-surface] Remove unused variable

diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index 539f795..7574a06 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -1707,7 +1707,6 @@ cairo_win32_surface_create (HDC hdc)
 {
     cairo_win32_surface_t *surface;
 
-    int depth;
     cairo_format_t format;
     RECT rect;
 
commit 12646f81cafa01c04e864a98c4344e16d958e980
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 28 16:46:55 2008 -0400

    [cairo-compiler-private] Make it build with wine
    
    One can build cairo with wine easily now:
    
    ./configure CC=winegcc LD=winegcc

diff --git a/src/cairo-compiler-private.h b/src/cairo-compiler-private.h
index 06d3bfd..3ce906c 100644
--- a/src/cairo-compiler-private.h
+++ b/src/cairo-compiler-private.h
@@ -111,7 +111,7 @@ CAIRO_BEGIN_DECLS
 #define __attribute__(x)
 #endif
 
-#if defined(__WIN32__) || defined(_MSC_VER)
+#if (defined(__WIN32__) && !defined(__WINE__)) || defined(_MSC_VER)
 #define snprintf _snprintf
 #endif
 


More information about the cairo-commit mailing list