[cairo-commit] 4 commits - src/cairo-region.c util/cairo-trace
Chris Wilson
ickle at kemper.freedesktop.org
Mon Apr 26 10:20:00 PDT 2010
src/cairo-region.c | 4 ++--
util/cairo-trace/trace.c | 31 +++++--------------------------
2 files changed, 7 insertions(+), 28 deletions(-)
New commits:
commit 36e0a3d3a01f9962d97386ea2d3c60020e937a81
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Apr 26 18:18:27 2010 +0100
trace: Remove unused functions
trace.c:1154: warning: â_has_font_face_idâ defined but not used
trace.c:1196: warning: â_get_pattern_idâ defined but not used
trace.c:1870: warning: â_emit_font_faceâ defined but not used
trace.c:1882: warning: â_emit_scaled_fontâ defined but not used
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 2dd6e25..b19d670 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -1150,12 +1150,6 @@ _get_font_face_id (cairo_font_face_t *font_face)
return _get_id (FONT_FACE, font_face);
}
-static bool
-_has_font_face_id (cairo_font_face_t *font_face)
-{
- return _has_id (FONT_FACE, font_face);
-}
-
static void
_emit_font_face_id (cairo_font_face_t *font_face)
{
@@ -1192,12 +1186,6 @@ _create_pattern_id (cairo_pattern_t *pattern)
return obj->token;
}
-static long
-_get_pattern_id (cairo_pattern_t *pattern)
-{
- return _get_id (PATTERN, pattern);
-}
-
static void
_emit_pattern_id (cairo_pattern_t *pattern)
{
@@ -1867,24 +1855,12 @@ _emit_context (cairo_t *cr)
}
static void
-_emit_font_face (cairo_font_face_t *font_face)
-{
- _emit_current (_get_object (FONT_FACE, font_face));
-}
-
-static void
_emit_pattern (cairo_pattern_t *pattern)
{
_emit_current (_get_object (PATTERN, pattern));
}
static void
-_emit_scaled_font (cairo_scaled_font_t *scaled_font)
-{
- _emit_current (_get_object (SCALED_FONT, scaled_font));
-}
-
-static void
_emit_surface (cairo_surface_t *surface)
{
_emit_current (_get_object (SURFACE, surface));
commit 3a2d9ffe0333090bb31ff01048ed506595f20cf9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Apr 26 18:17:49 2010 +0100
trace: Check return value to suppress compiler warning
trace.c: In function âget_prog_nameâ:
trace.c:741: warning: ignoring return value of âfgetsâ, declared with
attribute warn_unused_result
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index d577c55..2dd6e25 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -738,8 +738,11 @@ get_prog_name (char *buf, int length)
file = fopen ("/proc/self/cmdline", "rb");
if (file != NULL) {
- fgets (buf, length, file);
+ slash = fgets (buf, length, file);
fclose (file);
+
+ if (slash == NULL)
+ return;
} else {
char const *name = getenv ("CAIRO_TRACE_PROG_NAME");
if (name != NULL) {
commit 37be183412eb35abc11e602857602aee05839fc7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Apr 26 18:12:05 2010 +0100
trace: Trivial compiler warning fix
trace.c:1665: warning: initialization from incompatible pointer type
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index fd83ee9..d577c55 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -1662,7 +1662,7 @@ _emit_image (cairo_surface_t *image,
break;
case CAIRO_FORMAT_RGB16_565: /* XXX endianness */
for (row = height; row--; ) {
- uint16_t *src = data;
+ uint16_t *src = (uint16_t *) data;
uint16_t *dst = (uint16_t *)rowdata;
int col;
for (col = 0; col < width; col++)
commit 3c9e5d9792e101cfbd5a1116f06579539ed7b585
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Apr 26 18:13:36 2010 +0100
region: Cast to remove const to suppress compiler warnings.
airo-region.c: In function âcairo_region_intersectâ:
cairo-region.c:503: warning: passing argument 3 of
âpixman_region32_intersectâ discards qualifiers from pointer target type
/usr/local/include/pixman-1/pixman.h:518: note: expected âstruct
pixman_region32_t *â but argument is of type âconst struct pixman_region32_t *â
cairo-region.c: In function âcairo_region_unionâ:
cairo-region.c:566: warning: passing argument 3 of
âpixman_region32_unionâ discards qualifiers from pointer target type
/usr/local/include/pixman-1/pixman.h:521: note: expected âstruct
pixman_region32_t *â but argument is of type âconst struct pixman_region32_t *â
diff --git a/src/cairo-region.c b/src/cairo-region.c
index d423bd0..e4e9b7e 100644
--- a/src/cairo-region.c
+++ b/src/cairo-region.c
@@ -500,7 +500,7 @@ cairo_region_intersect (cairo_region_t *dst, const cairo_region_t *other)
if (other->status)
return _cairo_region_set_error (dst, other->status);
- if (! pixman_region32_intersect (&dst->rgn, &dst->rgn, &other->rgn))
+ if (! pixman_region32_intersect (&dst->rgn, &dst->rgn, CONST_CAST &other->rgn))
return _cairo_region_set_error (dst, CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_SUCCESS;
@@ -563,7 +563,7 @@ cairo_region_union (cairo_region_t *dst,
if (other->status)
return _cairo_region_set_error (dst, other->status);
- if (! pixman_region32_union (&dst->rgn, &dst->rgn, &other->rgn))
+ if (! pixman_region32_union (&dst->rgn, &dst->rgn, CONST_CAST &other->rgn))
return _cairo_region_set_error (dst, CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_SUCCESS;
More information about the cairo-commit
mailing list