minor build errors

This commit is contained in:
David Rose 2009-07-03 22:13:32 +00:00
parent 6f2591c642
commit 4edcad8821
2 changed files with 24 additions and 22 deletions

View File

@ -324,7 +324,7 @@ handle_pyobj_command(TiXmlElement *xcommand, int want_response_id) {
result = PyObject_Str(obj);
} else if (strcmp(method_name, "__setattr__") == 0) {
const char *property_name;
char *property_name;
PyObject *value;
if (PyArg_ParseTuple(params, "sO", &property_name, &value)) {
PyObject_SetAttrString(obj, property_name, value);
@ -333,7 +333,7 @@ handle_pyobj_command(TiXmlElement *xcommand, int want_response_id) {
}
} else if (strcmp(method_name, "__delattr__") == 0) {
const char *property_name;
char *property_name;
if (PyArg_ParseTuple(params, "s", &property_name)) {
if (PyObject_HasAttrString(obj, property_name)) {
PyObject_DelAttrString(obj, property_name);
@ -345,7 +345,7 @@ handle_pyobj_command(TiXmlElement *xcommand, int want_response_id) {
}
} else if (strcmp(method_name, "__getattr__") == 0) {
const char *property_name;
char *property_name;
if (PyArg_ParseTuple(params, "s", &property_name)) {
if (PyObject_HasAttrString(obj, property_name)) {
result = PyObject_GetAttrString(obj, property_name);
@ -356,7 +356,7 @@ handle_pyobj_command(TiXmlElement *xcommand, int want_response_id) {
} else {
// Not a special-case name. Call the named method.
PyObject *method = PyObject_GetAttrString(obj, method_name);
PyObject *method = PyObject_GetAttrString(obj, (char *)method_name);
if (method != NULL) {
result = PyObject_CallObject(method, params);
Py_DECREF(method);

View File

@ -405,6 +405,7 @@ handle_request(P3D_request *request) {
<< "\n";
// Ignore notifications.
{
// Temporary.
P3D_object *obj = P3D_instance_get_script_object(request->_instance);
cerr << "script_object is " << obj << "\n";
@ -414,7 +415,7 @@ handle_request(P3D_request *request) {
P3D_object *prop = P3D_OBJECT_GET_PROPERTY(obj, "foo");
cerr << "get_property returned " << prop << "\n";
if (prop != NULL) {
int size = P3D_OBJECT_GET_STRING(prop, NULL, 0);
int size = P3D_OBJECT_GET_STRING(prop, NULL, 0) + 1;
char *buffer = new char[size];
P3D_OBJECT_GET_STRING(prop, buffer, size);
cerr << " property is " << buffer << "\n";
@ -426,6 +427,7 @@ handle_request(P3D_request *request) {
}
P3D_OBJECT_FINISH(obj);
}
}
break;
default: