[Spice-devel] [PATCH] common/gl: remove unused variable

Christophe Fergeau cfergeau at gmail.com
Tue Mar 22 09:17:04 PDT 2011


clang static analyzer warned that 'len' was computed but never
used in glc_vertex2d. glc_stroke_line_dash has side effects so
we have to call it, but we don't need to save its return value
since it's not used.
---
 common/glc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/glc.c b/common/glc.c
index e4263cd..8e460eb 100644
--- a/common/glc.c
+++ b/common/glc.c
@@ -1149,8 +1149,8 @@ static void glc_vertex2d(InternaCtx *ctx, double x, double y)
 {
     double len;
     if (ctx->path_stroke.state == GLC_STROKE_ACTIVE) {
-        len = glc_stroke_line_dash(ctx->path_stroke.x, ctx->path_stroke.y, x, y,
-                                   ctx->line_width, &ctx->line_dash);
+        glc_stroke_line_dash(ctx->path_stroke.x, ctx->path_stroke.y, x, y,
+                             ctx->line_width, &ctx->line_dash);
         ctx->path_stroke.x = x;
         ctx->path_stroke.y = y;
     } else if (ctx->path_stroke.state == GLC_STROKE_FIRST) {
-- 
1.7.4



More information about the Spice-devel mailing list