[dia] [scan-build] Dead assignment



commit 8e6411e5fce921baec455c8c2ed7088cdd76b3e5
Author: Hans Breuer <hans breuer org>
Date:   Tue Dec 29 11:51:45 2009 +0100

    [scan-build] Dead assignment
    
    Actually use the local objk pointer to implement
    a cast-less version.

 lib/polyshape.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/lib/polyshape.c b/lib/polyshape.c
index 22209c0..e04e0df 100644
--- a/lib/polyshape.c
+++ b/lib/polyshape.c
@@ -157,8 +157,8 @@ add_handle(PolyShape *poly, int pos, Point *point, Handle *handle,
 	   ConnectionPoint *cp1, ConnectionPoint *cp2)
 {
   int i;
-  DiaObject *obj;
-  
+  DiaObject *obj = &poly->object;
+
   poly->numpoints++;
   poly->points = g_realloc(poly->points, poly->numpoints*sizeof(Point));
 
@@ -166,11 +166,9 @@ add_handle(PolyShape *poly, int pos, Point *point, Handle *handle,
     poly->points[i] = poly->points[i-1];
   }
   poly->points[pos] = *point;
-  object_add_handle_at((DiaObject*)poly, handle, pos);
-  object_add_connectionpoint_at((DiaObject*)poly, cp1, 2*pos);
-  object_add_connectionpoint_at((DiaObject*)poly, cp2, 2*pos+1);
-
-  obj = (DiaObject *)poly;
+  object_add_handle_at(obj, handle, pos);
+  object_add_connectionpoint_at(obj, cp1, 2*pos);
+  object_add_connectionpoint_at(obj, cp2, 2*pos+1);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]