FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 10-09-2011, 07:04 PM
Daniel Drake
 
Default Fix Python object converter pyblock_TorLtoT

gcc pointed out that 'result' is set but never used, and this
has highlighted an oversight in how this Python object converter
function is written.

Fix it according to the Python documentation and using the implementation
of PyUnicode_FSConverter() as a point of reference.

Compile tested only.
---
pyhelpers.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pyhelpers.c b/pyhelpers.c
index a050839..9e15ff3 100644
--- a/pyhelpers.c
+++ b/pyhelpers.c
@@ -157,7 +157,7 @@ pyblock_potoll(PyObject *obj, void *addr)
int
pyblock_TorLtoT(PyObject *obj, void *addr)
{
- PyObject *result = (PyObject *)addr;
+ PyObject **result = (PyObject **)addr;

if (!obj) {
if (!PyErr_Occurred())
@@ -166,16 +166,16 @@ pyblock_TorLtoT(PyObject *obj, void *addr)
}

if (PyTuple_Check(obj)) {
- result = obj;
+ *result = obj;
return 1;
}

if (PyList_Check(obj)) {
- result = PyList_AsTuple(obj);
+ *result = PyList_AsTuple(obj);
return 1;
}

- result = NULL;
+ *result = NULL;
PyErr_BadArgument();
return 0;
}
--
1.7.6.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 03:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org