2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 10:37:41 -04:00

Fix several errors and warnings from GCC compilation

This commit is contained in:
2012-02-09 00:56:03 -08:00
parent e6ebf7ffaf
commit ad66286a17
78 changed files with 318 additions and 331 deletions

View File

@ -1274,7 +1274,7 @@ PyObject* cyAvatar::GetTintClothingItemL(const char* clothing_name, uint8_t laye
}
char errmsg[256];
sprintf(errmsg,"Cannot find clothing item %d to find out what tint it is",clothing_name);
sprintf(errmsg,"Cannot find clothing item %s to find out what tint it is",clothing_name);
PyErr_SetString(PyExc_KeyError, errmsg);
// returning nil means an error occurred
return nil;

View File

@ -2362,7 +2362,7 @@ public:
if ( guid )
{
PyObject* retVal = PyObject_CallMethod(fPyObject, "publicAgeRemoved", "s", guid->AsString());
PyObject* retVal = PyObject_CallMethod(fPyObject, "publicAgeRemoved", "s", guid->AsString().c_str());
Py_XDECREF(retVal);
}
}
@ -2454,7 +2454,6 @@ const char* cyMisc::GetCameraNumber(int number)
if (pCam->GetTarget())
{
const char* ret = pCam->GetTarget()->GetKeyName().c_str();
(ret==nil) ? "empty" : ret;
plString str = plString::Format("saving camera named %s to chronicle\n",ret);
plVirtualCam1::Instance()->AddMsgToLog(str.c_str());
return ret;

View File

@ -334,9 +334,9 @@ void cyPhysics::Move(pyVector3& direction, float distance)
}
else
{
char errmsg[256];
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg);
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
}
}
}
@ -404,9 +404,9 @@ void cyPhysics::Rotate(float rad, pyVector3& axis)
}
else
{
char errmsg[256];
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg);
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
}
}
}

View File

@ -410,12 +410,12 @@ plPythonFileMod::~plPythonFileMod()
PyObject *modules = PyImport_GetModuleDict();
if( modules && (m = PyDict_GetItemString(modules, fModuleName.c_str())) && PyModule_Check(m))
{
hsStatusMessageF("Module %s removed from python dictionary",fModuleName);
hsStatusMessageF("Module %s removed from python dictionary",fModuleName.c_str());
PyDict_DelItemString(modules, fModuleName.c_str());
}
else
{
hsStatusMessageF("Module %s not found in python dictionary. Already removed?",fModuleName);
hsStatusMessageF("Module %s not found in python dictionary. Already removed?",fModuleName.c_str());
}
// the above code should have unloaded the module from python, so it will delete itself, therefore
// we need to set our pointer to nil to make sure we don't try to use it

View File

@ -105,7 +105,7 @@ bool pyCritterBrain::RunningBehavior(const std::string& behaviorName) const
std::string pyCritterBrain::BehaviorName(int behavior) const
{
if (!fBrain)
return false;
return nil;
return fBrain->BehaviorName(behavior);
}
@ -133,14 +133,14 @@ int pyCritterBrain::NextBehavior() const
std::string pyCritterBrain::IdleBehaviorName() const
{
if (!fBrain)
return false;
return nil;
return fBrain->IdleBehaviorName();
}
std::string pyCritterBrain::RunBehaviorName() const
{
if (!fBrain)
return false;
return nil;
return fBrain->RunBehaviorName();
}

View File

@ -284,9 +284,9 @@ PyObject* pySceneObject::GetLocalToWorld()
return pyMatrix44::New((hsMatrix44)ci->GetLocalToWorld());
else
{
char errmsg[256];
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg);
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
}
@ -313,9 +313,9 @@ PyObject* pySceneObject::GetWorldToLocal()
return pyMatrix44::New((hsMatrix44)ci->GetWorldToLocal());
else
{
char errmsg[256];
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg);
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
}
@ -342,9 +342,9 @@ PyObject* pySceneObject::GetLocalToParent()
return pyMatrix44::New((hsMatrix44)ci->GetLocalToParent());
else
{
char errmsg[256];
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg);
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
}
@ -371,9 +371,9 @@ PyObject* pySceneObject::GetParentToLocal()
return pyMatrix44::New((hsMatrix44)ci->GetParentToLocal());
else
{
char errmsg[256];
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg);
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
}
@ -416,9 +416,9 @@ PyObject* pySceneObject::GetWorldPosition()
return pyPoint3::New((hsPoint3)ci->GetWorldPos());
else
{
char errmsg[256];
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg);
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
}
@ -445,9 +445,9 @@ PyObject* pySceneObject::GetViewVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kView));
else
{
char errmsg[256];
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg);
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
}
@ -474,9 +474,9 @@ PyObject* pySceneObject::GetUpVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kUp));
else
{
char errmsg[256];
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg);
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
}
@ -503,9 +503,9 @@ PyObject* pySceneObject::GetRightVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kRight));
else
{
char errmsg[256];
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg);
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
}