[dia] Fix harmless build warnings, bug #581542



commit 22cd57dc2e94876305628dcf28066ddaf08713b4
Author: Hans Breuer <hans breuer org>
Date:   Sun May 10 16:08:09 2009 +0200

    Fix harmless build warnings, bug #581542
    
    If the code in plug-ins/drs/dia-render-script-import.c
    would actually be used this would indeed be a crash.
    Patch from Vincent Untz, bug #581542
---
 bindings/dia-properties.cpp             |    2 +-
 plug-ins/drs/dia-render-script-import.c |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/bindings/dia-properties.cpp b/bindings/dia-properties.cpp
index af56d56..605c8d0 100644
--- a/bindings/dia-properties.cpp
+++ b/bindings/dia-properties.cpp
@@ -140,7 +140,7 @@ dia::Property< ::Property* >::get (const std::vector<IProperty*>** v) const
 	::ArrayProperty *prop = (::ArrayProperty *)self;
 
 	// now build with new values
-	int num_props = num_props = prop->ex_props->len;
+	int num_props = prop->ex_props->len;
 	for (int i = 0; i < prop->records->len; ++i) {
 	  ::Property* p = 0;
 	  vec.push_back (new dia::Property <Property*> (0));
diff --git a/plug-ins/drs/dia-render-script-import.c b/plug-ins/drs/dia-render-script-import.c
index c74f210..b59fedf 100644
--- a/plug-ins/drs/dia-render-script-import.c
+++ b/plug-ins/drs/dia-render-script-import.c
@@ -164,10 +164,9 @@ gboolean
 import_drs (const gchar *filename, DiagramData *dia, void* user_data) 
 {
   GList *item, *items;
-  xmlNodePtr root;
   xmlDocPtr doc = xmlParseFile(filename);
 
-  items = read_items (root->xmlChildrenNode);
+  items = read_items (doc->xmlChildrenNode);
   for (item = items; item != NULL; item = g_list_next (item)) {
     DiaObject *obj = (DiaObject *)item->data;
     layer_add_object(dia->active_layer, obj);



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