Fix a mismatch between printf arguments and format string (thanks to Adrian Johnson).

Add macro to mark printf like functions.
This commit is contained in:
Kristian Høgsberg 2005-08-13 17:38:23 +00:00
parent 28958e368c
commit 52c5d89ae5
3 changed files with 20 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2005-08-13 Kristian Høgsberg <krh@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.
2005-08-13 Owen Taylor <otaylor@redhat.com>
* Makefile.am (DIST_SUBDIRS): Change docREEL back to doc.

View file

@ -909,9 +909,9 @@ _ps_output_fill_rectangles (void *abstract_surface,
_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);
}

View file

@ -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_output_stream_vprintf (cairo_output_stream_t *stream,
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);