From af39a3b110b53f9ab84de1a91483b5fc952ce6c0 Mon Sep 17 00:00:00 2001 From: "hk57.kim" Date: Wed, 16 Mar 2016 16:42:19 +0900 Subject: fix build warning Change-Id: Iff4a3ad9811ba4454be3e29d8876a5f3974f4c7f Signed-off-by: hk57.kim --- src/cairo-array.c | 2 +- src/cairo-botor-scan-converter.c | 6 ++++++ src/cairo-gl-device.c | 9 +++++---- src/cairo-gl-gradient.c | 3 +++ src/cairo-gl-info.c | 4 ++-- src/cairo-gl-msaa-compositor.c | 3 +++ src/cairo-gl-private.h | 6 +++--- src/cairo-gl-surface.c | 3 +++ src/cairo-path-stroke.c | 5 ++++- src/cairo-pattern.c | 2 +- src/cairo-polygon-intersect.c | 2 +- src/cairo-polygon-reduce.c | 2 +- src/cairo-ps-surface.c | 2 +- src/cairo-script-surface.c | 6 ++++-- src/cairo-type3-glyph-surface.c | 6 ++++-- 15 files changed, 42 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/cairo-array.c b/src/cairo-array.c index e37bb9980..7cc2bf019 100644 --- a/src/cairo-array.c +++ b/src/cairo-array.c @@ -240,7 +240,7 @@ _cairo_array_copy_element (const cairo_array_t *array, unsigned int index, void *dst) { - void *src = _cairo_array_index_const (array, index); + void *src = (void *)_cairo_array_index_const (array, index); if(src != NULL) memcpy (dst, src, array->element_size); } diff --git a/src/cairo-botor-scan-converter.c b/src/cairo-botor-scan-converter.c index 515305bf2..880fe8cd9 100644 --- a/src/cairo-botor-scan-converter.c +++ b/src/cairo-botor-scan-converter.c @@ -194,6 +194,8 @@ floored_divrem (int a, int b) return qr; } +/* + # to avoid warning : defined but not used [-Wunused-function] static struct quorem floored_muldivrem(int x, int a, int b) { @@ -207,6 +209,7 @@ floored_muldivrem(int x, int a, int b) } return qr; } +*/ static cairo_fixed_t line_compute_intersection_x_for_y (const cairo_line_t *line, @@ -2045,6 +2048,8 @@ _cairo_botor_scan_converter_generate (void *converter, return status; } +/* +# to avoid warning : defined but not used [-Wunused-function] static edge_t * botor_allocate_edge (cairo_botor_scan_converter_t *self) { @@ -2127,6 +2132,7 @@ botor_add_edge (cairo_botor_scan_converter_t *self, return CAIRO_STATUS_SUCCESS; } +*/ static void _cairo_botor_scan_converter_destroy (void *converter) diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c index 5dce9fb91..3258388df 100644 --- a/src/cairo-gl-device.c +++ b/src/cairo-gl-device.c @@ -507,7 +507,7 @@ _cairo_gl_context_activate (cairo_gl_context_t *ctx, _cairo_gl_composite_flush (ctx); _cairo_gl_context_destroy_operand (ctx, ctx->max_textures - 1); } - if (ctx->states_cache.active_texture != ctx->max_textures - 1) { + if (ctx->states_cache.active_texture != (GLenum)(ctx->max_textures - 1)) { ctx->dispatch.ActiveTexture (ctx->max_textures - 1); ctx->states_cache.active_texture = ctx->max_textures - 1; } @@ -850,8 +850,8 @@ bind_multisample_framebuffer (cairo_gl_context_t *ctx, cairo_gl_surface_t *surface) { #if CAIRO_HAS_GL_SURFACE || CAIRO_HAS_EVASGL_SURFACE - cairo_bool_t stencil_test_enabled, scissor_test_enabled; - cairo_bool_t has_stencil_cache; + cairo_bool_t stencil_test_enabled = FALSE, scissor_test_enabled = FALSE; + cairo_bool_t has_stencil_cache = FALSE; GLbitfield mask; if (ctx->gl_flavor == CAIRO_GL_FLAVOR_DESKTOP) { @@ -1115,7 +1115,8 @@ cairo_gl_device_set_thread_aware (cairo_device_t *device, } else { - _cairo_device_set_error (device, CAIRO_STATUS_INVALID_STATUS); + cairo_status_t ret; + ret = _cairo_device_set_error (device, CAIRO_STATUS_INVALID_STATUS); return; } } diff --git a/src/cairo-gl-gradient.c b/src/cairo-gl-gradient.c index 325612b0f..53801fffc 100644 --- a/src/cairo-gl-gradient.c +++ b/src/cairo-gl-gradient.c @@ -83,6 +83,8 @@ _cairo_gl_gradient_sample_width (unsigned int n_stops, return (width + 7) & -8; } +/* + # to avoid warning : defined but not used [-Wunused-function] static uint8_t premultiply(double c, double a) { int v = c * a * 256; @@ -103,6 +105,7 @@ static uint32_t color_stop_to_pixel(const cairo_gradient_stop_t *stop) else return a << 0 | r << 8 | g << 16 | b << 24; } +*/ static cairo_status_t _cairo_gl_gradient_render (const cairo_gl_context_t *ctx, diff --git a/src/cairo-gl-info.c b/src/cairo-gl-info.c index fffea58b1..5da1eac44 100644 --- a/src/cairo-gl-info.c +++ b/src/cairo-gl-info.c @@ -124,11 +124,11 @@ _cairo_gl_has_extension (cairo_gl_dispatch_t *dispatch, const char *ext) { int version = _cairo_gl_get_version (dispatch); if (version >= CAIRO_GL_VERSION_ENCODE (3, 0)) { - GLuint max_num_extensions; + GLint max_num_extensions; int i; dispatch->GetIntegerv (GL_NUM_EXTENSIONS, &max_num_extensions); - for (i = 0; i < max_num_extensions; i++) { + for (i = 0; i < (int)max_num_extensions; i++) { const char *extension = (const char *) dispatch->GetStringi (GL_EXTENSIONS, i); if (strstr (extension, ext) == 0) return TRUE; diff --git a/src/cairo-gl-msaa-compositor.c b/src/cairo-gl-msaa-compositor.c index 99d8cc01a..49717f0fe 100644 --- a/src/cairo-gl-msaa-compositor.c +++ b/src/cairo-gl-msaa-compositor.c @@ -833,6 +833,8 @@ _stroke_shaper_add_quad (void *closure, quad); } +/* + # to avoid warning : defined but not used [-Wunused-function] static cairo_bool_t _is_continuous_arc (const cairo_path_fixed_t *path, const cairo_stroke_style_t *style) @@ -840,6 +842,7 @@ _is_continuous_arc (const cairo_path_fixed_t *path, return (_cairo_path_fixed_is_single_arc (path) && style->dash == NULL); } +*/ static cairo_int_status_t _prevent_overlapping_strokes (cairo_gl_context_t *ctx, diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h index 2c534fc39..c013b8d70 100644 --- a/src/cairo-gl-private.h +++ b/src/cairo-gl-private.h @@ -857,7 +857,7 @@ _cairo_gl_ensure_drawbuffers (cairo_gl_context_t *ctx) if ((ctx->vao != 0 && (ctx->vao != ctx->states_cache.bound_vao))) { ctx->dispatch.GetIntegerv (GL_VERTEX_ARRAY_BINDING, &vao); - if (vao != ctx->states_cache.bound_vao) { + if (vao != (GLint)ctx->states_cache.bound_vao) { ctx->dispatch.BindVertexArray (ctx->vao); ctx->states_cache.bound_vao = ctx->vao; @@ -872,7 +872,7 @@ _cairo_gl_ensure_drawbuffers (cairo_gl_context_t *ctx) if ((ctx->vbo != 0 && (ctx->vbo != ctx->states_cache.bound_vbo))) { ctx->dispatch.GetIntegerv (GL_ARRAY_BUFFER_BINDING, &vbo); - if (vbo != (GLint) ctx->states_cache.bound_vbo) { + if (vbo != (GLint)ctx->states_cache.bound_vbo) { ctx->dispatch.BindBuffer (GL_ARRAY_BUFFER, ctx->vbo); } ctx->states_cache.bound_vbo = ctx->vbo; @@ -881,7 +881,7 @@ _cairo_gl_ensure_drawbuffers (cairo_gl_context_t *ctx) if ((ctx->ibo != 0 && (ctx->ibo != ctx->states_cache.bound_ibo))) { ctx->dispatch.GetIntegerv (GL_ELEMENT_ARRAY_BUFFER_BINDING, &ibo); - if (ibo != (GLint) ctx->states_cache.bound_ibo) { + if (ibo != (GLint)ctx->states_cache.bound_ibo) { ctx->dispatch.BindBuffer (GL_ELEMENT_ARRAY_BUFFER, ctx->ibo); } ctx->states_cache.bound_ibo = ctx->ibo; diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c index e156a0a52..7938f3076 100644 --- a/src/cairo-gl-surface.c +++ b/src/cairo-gl-surface.c @@ -1441,11 +1441,14 @@ FAIL: return status; } +/* + # to avoid warning : defined but not used [-Wunused-function] static int _cairo_gl_surface_flavor (cairo_gl_surface_t *surface) { cairo_gl_context_t *ctx = (cairo_gl_context_t *)surface->base.device; return ctx->gl_flavor; } +*/ static cairo_status_t _cairo_gl_surface_finish (void *abstract_surface) diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c index 5c260c915..c3f022bd2 100644 --- a/src/cairo-path-stroke.c +++ b/src/cairo-path-stroke.c @@ -90,6 +90,8 @@ typedef struct cairo_stroker { cairo_box_t bounds; } cairo_stroker_t; +/* + # to avoid warning : defined but not used [-Wunused-function] static cairo_bool_t _cairo_stroke_segment_intersect (cairo_point_t *p1, cairo_point_t *p2, cairo_point_t *p3, cairo_point_t *p4, @@ -117,7 +119,7 @@ _cairo_stroke_segment_intersect (cairo_point_t *p1, cairo_point_t *p2, x = (pre * (x3 - x4) - (x1 - x2) * post) / d; y = (pre * (y3 - y4) - (y1 - y2) * post) / d; - /* check if x, y are within both segments */ + // check if x, y are within both segments if (x < MIN (x1, x2) || x > MAX (x1, x2) || x < MIN (x3, x4) || x > MAX (x3, x4)) return FALSE; @@ -129,6 +131,7 @@ _cairo_stroke_segment_intersect (cairo_point_t *p1, cairo_point_t *p2, p->y = _cairo_fixed_from_double (y); return TRUE; } +*/ static void _cairo_stroker_limit (cairo_stroker_t *stroker, diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index c7d269caa..a07c22ff6 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -297,7 +297,7 @@ _cairo_mesh_pattern_init_copy (cairo_mesh_pattern_t *pattern, *pattern = *other; _cairo_array_init (&pattern->patches, sizeof (cairo_mesh_patch_t)); - data = _cairo_array_index_const (&other->patches, 0); + data = (void *)_cairo_array_index_const (&other->patches, 0); if (data == NULL) return CAIRO_STATUS_NULL_POINTER; return _cairo_array_append_multiple (&pattern->patches, diff --git a/src/cairo-polygon-intersect.c b/src/cairo-polygon-intersect.c index 2cd73d2e5..fc8b249bc 100644 --- a/src/cairo-polygon-intersect.c +++ b/src/cairo-polygon-intersect.c @@ -444,7 +444,7 @@ edges_compare_x_for_y (const cairo_bo_edge_t *a, HAVE_BX = 0x2, HAVE_BOTH = HAVE_AX | HAVE_BX } have_ax_bx = HAVE_BOTH; - int32_t ax, bx; + int32_t ax = 0, bx = 0; if (y == a->edge.line.p1.y) ax = a->edge.line.p1.x; diff --git a/src/cairo-polygon-reduce.c b/src/cairo-polygon-reduce.c index ea457fe4e..da6c9ab7c 100644 --- a/src/cairo-polygon-reduce.c +++ b/src/cairo-polygon-reduce.c @@ -445,7 +445,7 @@ edges_compare_x_for_y (const cairo_bo_edge_t *a, HAVE_BX = 0x2, HAVE_BOTH = HAVE_AX | HAVE_BX } have_ax_bx = HAVE_BOTH; - int32_t ax, bx; + int32_t ax = 0, bx = 0; if (y == a->edge.line.p1.y) ax = a->edge.line.p1.x; diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index 4fc15f632..b59ccaa08 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -1907,7 +1907,7 @@ _cairo_ps_surface_create_padded_image_from_image (cairo_ps_surface_t * if (pad_image->status) { status = pad_image->status; cairo_surface_destroy (pad_image); - status; + //status; } _cairo_pattern_init_for_surface (&pad_pattern, &source->base); diff --git a/src/cairo-script-surface.c b/src/cairo-script-surface.c index 68c1528f6..fdea7bb0a 100644 --- a/src/cairo-script-surface.c +++ b/src/cairo-script-surface.c @@ -3778,7 +3778,8 @@ cairo_script_create (const char *filename) stream = _cairo_output_stream_create_for_filename (filename); if ((status = _cairo_output_stream_get_status (stream))) { - _cairo_output_stream_destroy (stream); + cairo_status_t ret; + ret = _cairo_output_stream_destroy (stream); return _cairo_device_create_in_error (status); } @@ -3812,7 +3813,8 @@ cairo_script_create_for_stream (cairo_write_func_t write_func, stream = _cairo_output_stream_create (write_func, NULL, closure); if ((status = _cairo_output_stream_get_status (stream))) { - _cairo_output_stream_destroy (stream); + cairo_status_t ret; + ret = _cairo_output_stream_destroy (stream); return _cairo_device_create_in_error (status); } diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c index 63d2bd74c..e7f31de1a 100644 --- a/src/cairo-type3-glyph-surface.c +++ b/src/cairo-type3-glyph-surface.c @@ -431,7 +431,8 @@ _cairo_type3_glyph_surface_analyze_glyph (void *abstract_surface, null_stream = _cairo_null_stream_create (); if (unlikely (null_stream->status)) { status = null_stream->status; - _cairo_output_stream_destroy (null_stream); + cairo_status_t ret; + ret = _cairo_output_stream_destroy (null_stream); return status; } @@ -538,7 +539,8 @@ _cairo_type3_glyph_surface_emit_glyph (void *abstract_surface, mem_stream = _cairo_memory_stream_create (); status = mem_stream->status; if (unlikely (status)) { - _cairo_output_stream_destroy (mem_stream); + cairo_status_t ret; + ret = _cairo_output_stream_destroy (mem_stream); goto FAIL; } -- cgit v1.2.3