[dia] [scan-build] Function call argument is an uninitialized value



commit f599360c235e90176a39e36d8fa7fceebb51ec2b
Author: Hans Breuer <hans breuer org>
Date:   Wed Jun 29 22:04:05 2011 +0200

    [scan-build] Function call argument is an uninitialized value
    
    Default initialize the RGB_t rather than Color. The latter is
    always initialized by _color_init_from_rgb() either from layer
    or from code 62. Only with both not available the color was
    initialized from garbage.

 plug-ins/dxf/dxf-import.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/plug-ins/dxf/dxf-import.c b/plug-ins/dxf/dxf-import.c
index 29dd94e..fd9c498 100644
--- a/plug-ins/dxf/dxf-import.c
+++ b/plug-ins/dxf/dxf-import.c
@@ -177,8 +177,8 @@ read_entity_line_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
     Handle *h1, *h2;
     
     DiaObject *line_obj;
-    Color line_colour = { 0.0, 0.0, 0.0, 1.0 };
-    RGB_t color;
+    Color line_colour;
+    RGB_t color = { 0, };
     GPtrArray *props;
 
     real line_width = DEFAULT_LINE_WIDTH;
@@ -258,14 +258,14 @@ read_entity_solid_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
    DiaObject *polygon_obj;
    MultipointCreateData *pcd;
 
-   Color fill_colour = { 0.5, 0.5, 0.5, 1.0 };
+   Color fill_colour;
 
    GPtrArray *props;
    
    real line_width = 0.001;
    LineStyle style = LINESTYLE_SOLID;
    Layer *layer = dia->active_layer;
-   RGB_t color;
+   RGB_t color  = { 127, 127, 127 };
    
 /*   printf( "Solid " ); */
 
@@ -390,7 +390,7 @@ read_entity_polyline_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
     DiaObject *polyline_obj;
     MultipointCreateData *pcd;
 
-    Color line_colour = { 0.0, 0.0, 0.0, 1.0 };
+    Color line_colour;
 
     GPtrArray *props;
 
@@ -398,7 +398,7 @@ read_entity_polyline_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
     real radius, start_angle = 0;
     LineStyle style = LINESTYLE_SOLID;
     Layer *layer = dia->active_layer;
-    RGB_t color;
+    RGB_t color = { 0, };
     unsigned char closed = 0;
     int points = 0;
     real bulge = 0.0;
@@ -594,8 +594,8 @@ read_entity_circle_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
     Handle *h1, *h2;
     
     DiaObject *ellipse_obj;
-    RGB_t color;
-    Color line_colour = { 0.0, 0.0, 0.0, 1.0 };
+    RGB_t color  = { 0, };
+    Color line_colour;
 
     GPtrArray *props;
 
@@ -671,8 +671,8 @@ read_entity_arc_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
     Handle *h1, *h2;
   
     DiaObject *arc_obj;
-    RGB_t color;
-    Color line_colour = { 0.0, 0.0, 0.0, 1.0 };
+    RGB_t color  = { 0, };
+    Color line_colour;
     GPtrArray *props;
 
     real line_width = DEFAULT_LINE_WIDTH;
@@ -761,8 +761,8 @@ read_entity_ellipse_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
     Handle *h1, *h2;
     
     DiaObject *ellipse_obj; 
-    RGB_t color;
-    Color line_colour = { 0.0, 0.0, 0.0, 1.0 };
+    RGB_t color = { 0, };
+    Color line_colour;
     GPtrArray *props;
 
     real line_width = DEFAULT_LINE_WIDTH;
@@ -832,7 +832,7 @@ static PropDescription dxf_text_prop_descs[] = {
 static DiaObject *
 read_entity_text_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
 {
-    RGB_t color;
+    RGB_t color = { 0, };
 
     /* text data */
     Point location = {0, 0};
@@ -845,7 +845,7 @@ read_entity_text_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
     Handle *h1, *h2;
     
     DiaObject *text_obj;
-    Color text_colour = { 0.0, 0.0, 0.0, 1.0 };
+    Color text_colour;
 
     TextProperty *tprop;
     GPtrArray *props;



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