Author: oracle
Date: Mon Jun 30 20:36:22 2008
New Revision: 27620

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27620&view=rev
Log:
This reverts to the original version which does not use
Py_RETURN_TRUE or Py_RETURN_FALSE. This means the function
does not return a boolean value. A doxygen todo comment was
added to revisist this at a later time.


Modified:
    trunk/src/ai_python.cpp

Modified: trunk/src/ai_python.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_python.cpp?rev=27620&r1=27619&r2=27620&view=diff
==============================================================================
--- trunk/src/ai_python.cpp (original)
+++ trunk/src/ai_python.cpp Mon Jun 30 20:36:22 2008
@@ -529,16 +529,18 @@
        return PyBool_FromLong( utils::string_bool( 
unit->unit_->get_state("stoned") ) ) ;
 }
 
+// @todo: Make Py_RETURN_TRUE and Py_RETURN_FALSE work properly with
+// gcc 4.3.x series compilers. Latest compilers are much more strict. This
+// will likely require a change from the python folks. Until then, use the
+// version below which does not actually return a boolean value.
 static PyObject* unit_query_valid(wesnoth_unit* unit, void* /*closure*/)
 {
-  if( running_instance->is_unit_valid(unit->unit_) )
-    {
-      Py_INCREF( Py_True ) ;
-      return Py_True ;
-    }
-
-  Py_INCREF( Py_False ) ;
-  return Py_False ;
+//   if( running_instance->is_unit_valid(unit->unit_) )
+//     Py_RETURN_TRUE ;
+
+//   Py_RETURN_FALSE ;
+
+  return Py_BuildValue(INTVALUE, running_instance->is_unit_valid(unit->unit_) 
== true ? 1 : 0);
 }
 
 static PyGetSetDef unit_getseters[] = {


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to