[dia] [scan-build] Dead assignment
- From: Hans Breuer <hans src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [dia] [scan-build] Dead assignment
- Date: Tue, 29 Dec 2009 19:13:37 +0000 (UTC)
commit a7bd093e714a5b69d9c9616425bd9f0ab28381b2
Author: Hans Breuer <hans breuer org>
Date: Tue Dec 29 13:08:48 2009 +0100
[scan-build] Dead assignment
Actually use the return value of diagram_get_sorted_selected_remove()
rather than direct access of dia->data->selected
plug-ins/python/pydia-diagram.c | 12 ++++++------
plug-ins/python/pydia-diagramdata.c | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/plug-ins/python/pydia-diagram.c b/plug-ins/python/pydia-diagram.c
index f337b76..b79fe42 100644
--- a/plug-ins/python/pydia-diagram.c
+++ b/plug-ins/python/pydia-diagram.c
@@ -141,12 +141,12 @@ PyDiaDiagram_GetSortedSelected(PyDiaDiagram *self, PyObject *args)
if (!PyArg_ParseTuple(args, ":Diagram.get_sorted_selected"))
return NULL;
- list = tmp = diagram_get_sorted_selected(self->dia);
+ list = diagram_get_sorted_selected(self->dia);
- len = g_list_length (self->dia->data->selected);
+ len = g_list_length (list);
ret = PyTuple_New(len);
- for (i = 0, tmp = self->dia->data->selected; tmp; i++, tmp = tmp->next)
+ for (i = 0, tmp = list; tmp; i++, tmp = tmp->next)
PyTuple_SetItem(ret, i, PyDiaObject_New((DiaObject *)tmp->data));
g_list_free(list);
return ret;
@@ -161,12 +161,12 @@ PyDiaDiagram_GetSortedSelectedRemove(PyDiaDiagram *self, PyObject *args)
if (!PyArg_ParseTuple(args, ":Diagram.get_sorted_selected_remove"))
return NULL;
- list = tmp = diagram_get_sorted_selected_remove(self->dia);
+ list = diagram_get_sorted_selected_remove(self->dia);
- len = g_list_length (self->dia->data->selected);
+ len = g_list_length (list);
ret = PyTuple_New(len);
- for (i = 0, tmp = self->dia->data->selected; tmp; i++, tmp = tmp->next)
+ for (i = 0, tmp = list; tmp; i++, tmp = tmp->next)
PyTuple_SetItem(ret, i, PyDiaObject_New((DiaObject *)tmp->data));
g_list_free(list);
return ret;
diff --git a/plug-ins/python/pydia-diagramdata.c b/plug-ins/python/pydia-diagramdata.c
index 250bedd..5ee698f 100644
--- a/plug-ins/python/pydia-diagramdata.c
+++ b/plug-ins/python/pydia-diagramdata.c
@@ -98,12 +98,12 @@ PyDiaDiagramData_GetSortedSelected(PyDiaDiagramData *self, PyObject *args)
if (!PyArg_ParseTuple(args, ":DiagramData.get_sorted_selected"))
return NULL;
- list = tmp = data_get_sorted_selected(self->data);
+ list = data_get_sorted_selected(self->data);
- len = g_list_length (self->data->selected);
+ len = g_list_length (list);
ret = PyTuple_New(len);
- for (i = 0, tmp = self->data->selected; tmp; i++, tmp = tmp->next)
+ for (i = 0, tmp = list; tmp; i++, tmp = tmp->next)
PyTuple_SetItem(ret, i, PyDiaObject_New((DiaObject *)tmp->data));
g_list_free(list);
return ret;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]