mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 05:00:06 -05:00
--Code Change
-Fix compiler warnings in XmlToEmber
This commit is contained in:
parent
ee7ca7065e
commit
344c8c6457
@ -198,7 +198,10 @@ win32 {
|
||||
QMAKE_CXXFLAGS += -Wmain
|
||||
QMAKE_CXXFLAGS += -Wfatal-errors
|
||||
QMAKE_CXXFLAGS += -Wall -fpermissive
|
||||
QMAKE_CXXFLAGS += -Wold-style-cast
|
||||
|
||||
# CL has lots of old-style-cast which clogs up warning logs
|
||||
#QMAKE_CXXFLAGS += -Wold-style-cast
|
||||
|
||||
QMAKE_CXXFLAGS += -Wno-unused-parameter
|
||||
QMAKE_CXXFLAGS += -Wno-unused-function
|
||||
QMAKE_CXXFLAGS += -Wold-style-cast
|
||||
|
@ -53,8 +53,6 @@ bool EmberToXml<T>::Save(const string& filename, C<Ember<T>, Alloc>& embers, siz
|
||||
|
||||
if (f.is_open())
|
||||
{
|
||||
const auto prev = embers.begin();
|
||||
|
||||
//Always ensure times make sense.
|
||||
for (auto& ember : embers)
|
||||
ember.m_Time = t++;
|
||||
@ -922,4 +920,4 @@ EXPORT_EMBER_TO_XML(float)
|
||||
#ifdef DO_DOUBLE
|
||||
EXPORT_EMBER_TO_XML(double)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ bool PaletteList<T>::AddPaletteFile(const string& filename, const vector<Palette
|
||||
{
|
||||
if (!GetPaletteListByFullPath(filename))
|
||||
{
|
||||
const auto item = s_Palettes.insert(make_pair(filename, palettes));
|
||||
s_Palettes.insert(make_pair(filename, palettes));
|
||||
Save(filename);
|
||||
return true;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ std::vector<T> Spline<T>::Interpolate(const std::vector<T>& newX)
|
||||
{
|
||||
std::vector<T> output; output.resize(newX.size());
|
||||
|
||||
for (int i = 0; i < newX.size(); i++)
|
||||
for (size_t i = 0; i < newX.size(); i++)
|
||||
output[i] = Interpolate(newX[i]);
|
||||
|
||||
return output;
|
||||
|
@ -3608,7 +3608,6 @@ public:
|
||||
}
|
||||
|
||||
T tempx, tempy;
|
||||
T boost = 1;//Boost is the separation distance between the two planes.
|
||||
T sumX, sumY;
|
||||
|
||||
if (m_VarType == eVariationType::VARTYPE_REG)
|
||||
@ -3629,6 +3628,7 @@ public:
|
||||
//Creating Z factors relative to the planes. These will be added, whereas x and y will be assigned.
|
||||
//Original does += z *, so using z on the right side of = is intentional.
|
||||
if (m_MajPlane == 2)
|
||||
//Boost is the separation distance between the two planes.
|
||||
helper.Out.z = helper.In.z * T(0.5) * m_ZLift + (posNeg * m_Boost);
|
||||
else
|
||||
helper.Out.z = helper.In.z * T(0.5) * m_ZLift;
|
||||
|
@ -490,7 +490,6 @@ public:
|
||||
/// <returns>The variation if found, else nullptr.</returns>
|
||||
Variation<T>* RemoveVariationById(eVariationId id)
|
||||
{
|
||||
bool found = false;
|
||||
Variation<T>* var = nullptr;
|
||||
AllVarsFunc([&](vector<Variation<T>*>& variations, bool & keepGoing)
|
||||
{
|
||||
@ -736,9 +735,8 @@ public:
|
||||
else
|
||||
{
|
||||
//There are no variations, so the affine transformed points can be assigned directly to the output points.
|
||||
T inX = inPoint->m_X;
|
||||
outPoint->m_X = 0;//(m_Affine.A() * inX) + (m_Affine.B() * inPoint->m_Y) + m_Affine.C();
|
||||
outPoint->m_Y = 0;//(m_Affine.D() * inX) + (m_Affine.E() * inPoint->m_Y) + m_Affine.F();
|
||||
outPoint->m_X = 0;//(m_Affine.A() * inPoint->m_X) + (m_Affine.B() * inPoint->m_Y) + m_Affine.C();
|
||||
outPoint->m_Y = 0;//(m_Affine.D() * inPoint->m_X) + (m_Affine.E() * inPoint->m_Y) + m_Affine.F();
|
||||
outPoint->m_Z = 0;//inPoint->m_Z;
|
||||
}
|
||||
|
||||
|
@ -682,7 +682,7 @@ static const char* CheckNameVal(xmlNode* node, const char* name)
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to verify that the name of a node
|
||||
@ -697,7 +697,7 @@ static xmlNode* CheckNodeName(xmlNode* node, const char* name)
|
||||
return node;
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to get the value of the name field of a node.
|
||||
@ -713,7 +713,7 @@ static const char* GetNameVal(xmlNode* node, const char* name = "name")
|
||||
return CCX(attStr);
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to get the child of a node based on the value of its name field.
|
||||
@ -729,7 +729,7 @@ static xmlNode* GetChildNode(xmlNode* node, const char* name)
|
||||
return childNode;
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to get the child of a node based on the name of the child node.
|
||||
@ -745,7 +745,7 @@ static xmlNode* GetChildNodeByNodeName(xmlNode* node, const char* name)
|
||||
return node;
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to parse the content of a field of a node and convert the string into a value of type T and store in the passed in val parameter.
|
||||
@ -849,7 +849,6 @@ void XmlToEmber<T>::ScanForChaosNodes(xmlNode* curNode, const char* parentFile,
|
||||
currentEmber.m_Name = embername;
|
||||
|
||||
const auto childNode = thisNode;
|
||||
bool ret = true;
|
||||
parseEmberSuccess = ParseEmberElementFromChaos(childNode, currentEmber);
|
||||
|
||||
if (!parseEmberSuccess)
|
||||
@ -888,10 +887,7 @@ void XmlToEmber<T>::ScanForChaosNodes(xmlNode* curNode, const char* parentFile,
|
||||
template <typename T>
|
||||
bool XmlToEmber<T>::ParseEmberElementFromChaos(xmlNode* emberNode, Ember<T>& currentEmber)
|
||||
{
|
||||
bool fromEmber = false, ret = true;
|
||||
const char* loc = __FUNCTION__;
|
||||
int soloXform = -1;
|
||||
size_t count = 0, index = 0;
|
||||
T sensorWidth = 2;
|
||||
xmlAttrPtr att;
|
||||
currentEmber.m_Palette.Clear();//Wipe out the current palette.
|
||||
@ -918,7 +914,6 @@ bool XmlToEmber<T>::ParseEmberElementFromChaos(xmlNode* emberNode, Ember<T>& cur
|
||||
|
||||
if (!varname.empty())
|
||||
{
|
||||
const T weight = 1;
|
||||
const auto corrvarname = GetCorrectedVariationName(m_BadVariationNames, varname);
|
||||
const auto corrwprefix = !StartsWith(corrvarname, prefix) ? prefix + corrvarname : corrvarname;
|
||||
|
||||
@ -1264,7 +1259,6 @@ bool XmlToEmber<T>::ParseEmberElementFromChaos(xmlNode* emberNode, Ember<T>& cur
|
||||
|
||||
if (const auto curvesnode = GetChildNodeByNodeName(childNode, "curves"))
|
||||
{
|
||||
T val = 0;
|
||||
auto curvenodesfunc = [&](xmlNode * node, int index)
|
||||
{
|
||||
float x, y;
|
||||
@ -1289,15 +1283,15 @@ bool XmlToEmber<T>::ParseEmberElementFromChaos(xmlNode* emberNode, Ember<T>& cur
|
||||
{
|
||||
bool haveknots = false, havevals = false;
|
||||
|
||||
for (auto childNode = node->children; childNode; childNode = childNode->next)
|
||||
for (auto innerChildNode = node->children; innerChildNode; innerChildNode = innerChildNode->next)
|
||||
{
|
||||
if (childNode->type == XML_ELEMENT_NODE)
|
||||
if (innerChildNode->type == XML_ELEMENT_NODE)
|
||||
{
|
||||
if (const auto node = CheckNodeName(childNode, "table"))
|
||||
if (const auto innernode = CheckNodeName(innerChildNode, "table"))
|
||||
{
|
||||
if (!haveknots)
|
||||
{
|
||||
if (const auto knotvalsnode = GetChildNodeByNodeName(node, "values"))
|
||||
if (const auto knotvalsnode = GetChildNodeByNodeName(innernode, "values"))
|
||||
{
|
||||
if (knotvalsnode->children)
|
||||
{
|
||||
@ -1310,7 +1304,7 @@ bool XmlToEmber<T>::ParseEmberElementFromChaos(xmlNode* emberNode, Ember<T>& cur
|
||||
}
|
||||
else if (!havevals)
|
||||
{
|
||||
if (const auto valvalsnode = GetChildNodeByNodeName(node, "values"))
|
||||
if (const auto valvalsnode = GetChildNodeByNodeName(innernode, "values"))
|
||||
{
|
||||
if (valvalsnode->children)
|
||||
{
|
||||
|
@ -137,7 +137,7 @@ static string GetExePath(const char* argv0)
|
||||
cerr << "Could not discern full path from executable.\n";
|
||||
|
||||
#else
|
||||
auto fullsize = readlink("/proc/self/exe", v.data(), v.size());
|
||||
readlink("/proc/self/exe", v.data(), v.size());
|
||||
fullpath = string(v.data());
|
||||
#endif
|
||||
#endif
|
||||
|
@ -250,7 +250,6 @@ struct NoDelimiters : std::ctype<char>
|
||||
static std::ctype_base::mask const* GetTable()
|
||||
{
|
||||
typedef std::ctype<char> cctype;
|
||||
static const cctype::mask* const_rc = cctype::classic_table();
|
||||
static cctype::mask rc[cctype::table_size];
|
||||
std::memset(rc, 0, cctype::table_size * sizeof(cctype::mask));
|
||||
return &rc[0];
|
||||
|
@ -185,7 +185,6 @@ template <typename T>
|
||||
void FractoriumEmberController<T>::CreateReferenceFile()
|
||||
{
|
||||
bool nv = false;
|
||||
size_t i;
|
||||
StopAllPreviewRenderers();
|
||||
auto temppal = m_Ember.m_Palette;
|
||||
m_EmberFile.Clear();
|
||||
@ -258,6 +257,7 @@ void FractoriumEmberController<T>::CreateReferenceFile()
|
||||
m_EmberFile.m_Embers.push_back(ember);
|
||||
};
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
addsquaresfunc(i, regVars[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user