forked from 0ad/0ad
Fixed some string type conversion problems for GCC
This was SVN commit r6384.
This commit is contained in:
parent
61bad0b2e4
commit
2c6a2c1572
@ -84,7 +84,9 @@ void FColladaDocument::LoadFromText(const char *text)
|
||||
bool status = FCollada::LoadDocumentFromMemory("unknown.dae", document.get(), (void*)newText, newTextSize);
|
||||
|
||||
if (newText != text)
|
||||
{
|
||||
xmlFreeFunc((void*)newText);
|
||||
}
|
||||
|
||||
REQUIRE_SUCCESS(status);
|
||||
}
|
||||
@ -132,7 +134,7 @@ CommonConvert::CommonConvert(const char* text, std::string& xmlErrors)
|
||||
FCDAsset* asset = m_Doc.GetDocument()->GetAsset();
|
||||
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)
|
||||
m_IsXSI = true;
|
||||
}
|
||||
|
@ -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[1] = (double)q.x*q.z-(double)q.y*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;}
|
||||
else {if (mag[1]>mag[2]) win = 1; else win = 2;}
|
||||
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;
|
||||
for (i=0; i<4; i++) {
|
||||
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];
|
||||
}
|
||||
/* Find two largest components, indices in hi and lo */
|
||||
|
@ -268,7 +268,7 @@ public:
|
||||
continue;
|
||||
}
|
||||
// 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());
|
||||
|
||||
|
@ -87,7 +87,7 @@ namespace
|
||||
FUXmlParser::FindChildrenByType(parent, "bone", boneNodes);
|
||||
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;
|
||||
b.name = name;
|
||||
@ -133,7 +133,7 @@ namespace
|
||||
{
|
||||
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;
|
||||
|
||||
@ -143,7 +143,7 @@ namespace
|
||||
|
||||
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");
|
||||
|
||||
g_StandardSkeletons[id] = skeleton.release();
|
||||
@ -153,7 +153,7 @@ namespace
|
||||
// Non-standard skeletons need to choose a standard skeleton
|
||||
// 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];
|
||||
REQUIRE(targetSkeleton != NULL, "skeleton target matches some standard_skeleton id");
|
||||
|
||||
@ -167,7 +167,7 @@ namespace
|
||||
REQUIRE(identifier != NULL, "skeleton has <identifier>");
|
||||
xmlNode* identRoot = FUXmlParser::FindChildByType(identifier, "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();
|
||||
}
|
||||
|
@ -169,4 +169,4 @@ void FixBrokenXML(const char* text, const char** out, size_t* outSize)
|
||||
}
|
||||
|
||||
xmlFreeDoc(doc);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user