Fix compile errors

This commit is contained in:
rdb 2009-07-01 08:15:41 +00:00
parent f7bc30d8a8
commit b7aa2ead11
3 changed files with 9 additions and 7 deletions

View File

@ -21,6 +21,7 @@
#include "pvector.h" #include "pvector.h"
#include <Python.h> #include <Python.h>
#define TIXML_USE_STL
#include <tinyxml.h> #include <tinyxml.h>
class P3DSession; class P3DSession;

View File

@ -118,7 +118,7 @@ run_python() {
} }
// Construct an instance of AppRunner. // Construct an instance of AppRunner.
_runner = PyObject_CallFunction(AppRunner, ""); _runner = PyObject_CallFunction(AppRunner, (char*) "");
if (_runner == NULL) { if (_runner == NULL) {
PyErr_Print(); PyErr_Print();
return false; return false;
@ -154,7 +154,7 @@ run_python() {
// Now pass that func pointer back to our AppRunner instance, so it // Now pass that func pointer back to our AppRunner instance, so it
// can call up to us. // can call up to us.
PyObject *result = PyObject_CallMethod(_runner, "setRequestFunc", "O", request_func); PyObject *result = PyObject_CallMethod(_runner, (char*) "setRequestFunc", (char*) "O", request_func);
if (result == NULL) { if (result == NULL) {
PyErr_Print(); PyErr_Print();
return false; return false;
@ -170,7 +170,7 @@ run_python() {
// Finally, get lost in taskMgr.run(). // Finally, get lost in taskMgr.run().
nout << "calling run()\n"; nout << "calling run()\n";
PyObject *done = PyObject_CallMethod(_taskMgr, "run", ""); PyObject *done = PyObject_CallMethod(_taskMgr, (char*) "run", (char*) "");
if (done == NULL) { if (done == NULL) {
PyErr_Print(); PyErr_Print();
return false; return false;
@ -456,8 +456,8 @@ set_p3d_filename(P3DCInstance *inst, TiXmlElement *xfparams) {
} }
PyObject *result = PyObject_CallMethod PyObject *result = PyObject_CallMethod
(_runner, "setP3DFilename", "sOi", p3d_filename.c_str(), token_list, (_runner, (char*) "setP3DFilename", (char*) "sOi", p3d_filename.c_str(),
inst->get_instance_id()); token_list, inst->get_instance_id());
Py_DECREF(token_list); Py_DECREF(token_list);
if (result == NULL) { if (result == NULL) {
@ -515,7 +515,7 @@ setup_window(P3DCInstance *inst, TiXmlElement *xwparams) {
// TODO: direct this into the particular instance. This will // TODO: direct this into the particular instance. This will
// require a specialized ShowBase replacement. // require a specialized ShowBase replacement.
PyObject *result = PyObject_CallMethod PyObject *result = PyObject_CallMethod
(_runner, "setupWindow", "siiiii", window_type.c_str(), (_runner, (char*)"setupWindow", (char*)"siiiii", window_type.c_str(),
win_x, win_y, win_width, win_height, win_x, win_y, win_width, win_height,
parent_window_handle); parent_window_handle);
if (result == NULL) { if (result == NULL) {
@ -540,7 +540,7 @@ terminate_session() {
_instances.clear(); _instances.clear();
nout << "calling stop()\n"; nout << "calling stop()\n";
PyObject *result = PyObject_CallMethod(_taskMgr, "stop", ""); PyObject *result = PyObject_CallMethod(_taskMgr, (char*) "stop", (char*) "");
if (result == NULL) { if (result == NULL) {
PyErr_Print(); PyErr_Print();
return; return;

View File

@ -21,6 +21,7 @@
#define P3D_FUNCTION_PROTOTYPES #define P3D_FUNCTION_PROTOTYPES
#define BUILDING_P3D_PLUGIN #define BUILDING_P3D_PLUGIN
#define TIXML_USE_STL
#include "p3d_plugin.h" #include "p3d_plugin.h"
#include "p3d_lock.h" #include "p3d_lock.h"