[cairo-commit] cairo/src cairo-ps-surface.c, 1.46, 1.47 cairoint.h, 1.195, 1.196

Kristian Hogsberg commit at pdx.freedesktop.org
Sat Aug 13 17:38:25 PDT 2005


Committed by: krh

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

Modified Files:
	cairo-ps-surface.c cairoint.h 
Log Message:
2005-08-13  Kristian Høgsberg  <krh at redhat.com>

        * src/cairo-ps-surface.c: (_ps_output_fill_rectangles): Fix a
        mismatch between printf arguments and format string (thanks to
        Adrian Johnson).

        * src/cairoint.h (cairo_printf_format): Add macro to mark printf
        like functions.



Index: cairo-ps-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps-surface.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- cairo-ps-surface.c	9 Aug 2005 01:35:22 -0000	1.46
+++ cairo-ps-surface.c	14 Aug 2005 00:38:23 -0000	1.47
@@ -909,9 +909,9 @@
     _cairo_output_stream_printf (stream, "[");
     for (i = 0; i < num_rects; i++) {
       _cairo_output_stream_printf (stream,
-				   " %d %d %d %d",
+				   " %d %f %d %d",
 				   rects[i].x,
-				   surface->parent->height - rects[i].y - rects[i].height,
+				   (double)(surface->parent->height - rects[i].y - rects[i].height),
 				   rects[i].width, rects[i].height);
     }
 

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -d -r1.195 -r1.196
--- cairoint.h	13 Aug 2005 10:26:18 -0000	1.195
+++ cairoint.h	14 Aug 2005 00:38:23 -0000	1.196
@@ -86,6 +86,13 @@
 # define slim_hidden_def(name)
 #endif
 
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#define cairo_printf_format(fmt_index, va_index) \
+	__attribute__((__format__(__printf__, fmt_index, va_index)))
+#else
+#define cairo_printf_format (fmt_index, va_index)
+#endif
+
 /* slim_internal.h */
 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
 #define cairo_private		__attribute__((__visibility__("hidden")))
@@ -1992,7 +1999,8 @@
 
 cairo_private cairo_status_t
 _cairo_output_stream_printf (cairo_output_stream_t *stream,
-			     const char *fmt, ...);
+			     const char *fmt, ...)
+    cairo_printf_format(2, 3);
 
 cairo_private long
 _cairo_output_stream_get_position (cairo_output_stream_t *status);




More information about the cairo-commit mailing list