Fixed some string type conversion problems for GCC

This was SVN commit r6384.
This commit is contained in:
Ykkrosh 2008-09-17 15:55:04 +00:00
parent 61bad0b2e4
commit 2c6a2c1572
5 changed files with 12 additions and 10 deletions

View File

@ -84,7 +84,9 @@ void FColladaDocument::LoadFromText(const char *text)
bool status = FCollada::LoadDocumentFromMemory("unknown.dae", document.get(), (void*)newText, newTextSize); bool status = FCollada::LoadDocumentFromMemory("unknown.dae", document.get(), (void*)newText, newTextSize);
if (newText != text) if (newText != text)
{
xmlFreeFunc((void*)newText); xmlFreeFunc((void*)newText);
}
REQUIRE_SUCCESS(status); REQUIRE_SUCCESS(status);
} }
@ -132,7 +134,7 @@ CommonConvert::CommonConvert(const char* text, std::string& xmlErrors)
FCDAsset* asset = m_Doc.GetDocument()->GetAsset(); FCDAsset* asset = m_Doc.GetDocument()->GetAsset();
if (asset && asset->GetContributorCount() >= 1) if (asset && asset->GetContributorCount() >= 1)
{ {
std::string tool = asset->GetContributor(0)->GetAuthoringTool(); std::string tool (asset->GetContributor(0)->GetAuthoringTool());
if (tool.find("XSI") != tool.npos) if (tool.find("XSI") != tool.npos)
m_IsXSI = true; m_IsXSI = true;
} }

View File

@ -396,7 +396,7 @@ Quat snuggle(Quat q, HVect *k)
mag[0] = (double)q.z*q.z+(double)q.w*q.w-0.5; mag[0] = (double)q.z*q.z+(double)q.w*q.w-0.5;
mag[1] = (double)q.x*q.z-(double)q.y*q.w; mag[1] = (double)q.x*q.z-(double)q.y*q.w;
mag[2] = (double)q.y*q.z+(double)q.x*q.w; mag[2] = (double)q.y*q.z+(double)q.x*q.w;
for (i=0; i<3; i++) if (neg[i] = (mag[i]<0.0)) mag[i] = -mag[i]; for (i=0; i<3; i++) if ((neg[i] = (mag[i]<0.0))) mag[i] = -mag[i];
if (mag[0]>mag[1]) {if (mag[0]>mag[2]) win = 0; else win = 2;} if (mag[0]>mag[1]) {if (mag[0]>mag[2]) win = 0; else win = 2;}
else {if (mag[1]>mag[2]) win = 1; else win = 2;} else {if (mag[1]>mag[2]) win = 1; else win = 2;}
switch (win) { switch (win) {
@ -415,7 +415,7 @@ Quat snuggle(Quat q, HVect *k)
qa[0] = q.x; qa[1] = q.y; qa[2] = q.z; qa[3] = q.w; qa[0] = q.x; qa[1] = q.y; qa[2] = q.z; qa[3] = q.w;
for (i=0; i<4; i++) { for (i=0; i<4; i++) {
pa[i] = 0.0; pa[i] = 0.0;
if (neg[i] = (qa[i]<0.0)) qa[i] = -qa[i]; if ((neg[i] = (qa[i]<0.0))) qa[i] = -qa[i];
par ^= neg[i]; par ^= neg[i];
} }
/* Find two largest components, indices in hi and lo */ /* Find two largest components, indices in hi and lo */

View File

@ -268,7 +268,7 @@ public:
continue; continue;
} }
// Strip off the "prop-" from the name // Strip off the "prop-" from the name
std::string propPointName = child->GetName().substr(5); std::string propPointName (child->GetName().substr(5));
Log(LOG_INFO, "Adding prop point %s", propPointName.c_str()); Log(LOG_INFO, "Adding prop point %s", propPointName.c_str());

View File

@ -87,7 +87,7 @@ namespace
FUXmlParser::FindChildrenByType(parent, "bone", boneNodes); FUXmlParser::FindChildrenByType(parent, "bone", boneNodes);
for (xmlNodeList::iterator boneNode = boneNodes.begin(); boneNode != boneNodes.end(); ++boneNode) for (xmlNodeList::iterator boneNode = boneNodes.begin(); boneNode != boneNodes.end(); ++boneNode)
{ {
std::string name = FUXmlParser::ReadNodeProperty(*boneNode, "name"); std::string name (FUXmlParser::ReadNodeProperty(*boneNode, "name"));
Bone b; Bone b;
b.name = name; b.name = name;
@ -133,7 +133,7 @@ namespace
{ {
std::auto_ptr<Skeleton> skeleton (new Skeleton()); std::auto_ptr<Skeleton> skeleton (new Skeleton());
std::string title = FUXmlParser::ReadNodeProperty(*skeletonNode, "title"); std::string title (FUXmlParser::ReadNodeProperty(*skeletonNode, "title"));
skeleton->m->title = title; skeleton->m->title = title;
@ -143,7 +143,7 @@ namespace
LoadSkeletonBones(*skeletonNode, skeleton->m->bones, NULL, ""); LoadSkeletonBones(*skeletonNode, skeleton->m->bones, NULL, "");
std::string id = FUXmlParser::ReadNodeProperty(*skeletonNode, "id"); std::string id (FUXmlParser::ReadNodeProperty(*skeletonNode, "id"));
REQUIRE(! id.empty(), "standard_skeleton has id"); REQUIRE(! id.empty(), "standard_skeleton has id");
g_StandardSkeletons[id] = skeleton.release(); g_StandardSkeletons[id] = skeleton.release();
@ -153,7 +153,7 @@ namespace
// Non-standard skeletons need to choose a standard skeleton // Non-standard skeletons need to choose a standard skeleton
// as their target to be mapped onto // as their target to be mapped onto
std::string target = FUXmlParser::ReadNodeProperty(*skeletonNode, "target"); std::string target (FUXmlParser::ReadNodeProperty(*skeletonNode, "target"));
const Skeleton* targetSkeleton = g_StandardSkeletons[target]; const Skeleton* targetSkeleton = g_StandardSkeletons[target];
REQUIRE(targetSkeleton != NULL, "skeleton target matches some standard_skeleton id"); REQUIRE(targetSkeleton != NULL, "skeleton target matches some standard_skeleton id");
@ -167,7 +167,7 @@ namespace
REQUIRE(identifier != NULL, "skeleton has <identifier>"); REQUIRE(identifier != NULL, "skeleton has <identifier>");
xmlNode* identRoot = FUXmlParser::FindChildByType(identifier, "root"); xmlNode* identRoot = FUXmlParser::FindChildByType(identifier, "root");
REQUIRE(identRoot != NULL, "skeleton identifier has <root>"); REQUIRE(identRoot != NULL, "skeleton identifier has <root>");
std::string identRootName = FUXmlParser::ReadNodeContentFull(identRoot); std::string identRootName (FUXmlParser::ReadNodeContentFull(identRoot));
g_MappedSkeletons[identRootName] = skeleton.release(); g_MappedSkeletons[identRootName] = skeleton.release();
} }

View File

@ -169,4 +169,4 @@ void FixBrokenXML(const char* text, const char** out, size_t* outSize)
} }
xmlFreeDoc(doc); xmlFreeDoc(doc);
} }