cleanup from cppcheck 1.62
This commit is contained in:
parent
7efb37b723
commit
9350b16c4a
|
@ -111,8 +111,6 @@ Config::Config() {
|
||||||
fileName.second = "";
|
fileName.second = "";
|
||||||
fileNameParameter.first = "";
|
fileNameParameter.first = "";
|
||||||
fileNameParameter.second = "";
|
fileNameParameter.second = "";
|
||||||
fileLoaded.first = false;
|
|
||||||
fileLoaded.second = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Config::tryCustomPath(std::pair<ConfigType,ConfigType> &type, std::pair<string,string> &file, string custom_path) {
|
bool Config::tryCustomPath(std::pair<ConfigType,ConfigType> &type, std::pair<string,string> &file, string custom_path) {
|
||||||
|
|
|
@ -39,8 +39,6 @@ private:
|
||||||
Stats stats;
|
Stats stats;
|
||||||
|
|
||||||
GraphicButton buttonExit;
|
GraphicButton buttonExit;
|
||||||
int mouseX;
|
|
||||||
int mouseY;
|
|
||||||
int mouse2d;
|
int mouse2d;
|
||||||
GraphicMessageBox mainMessageBox;
|
GraphicMessageBox mainMessageBox;
|
||||||
Texture2D *renderToTexture;
|
Texture2D *renderToTexture;
|
||||||
|
|
|
@ -87,8 +87,6 @@ private:
|
||||||
private:
|
private:
|
||||||
vector<Text *> texts;
|
vector<Text *> texts;
|
||||||
int timer;
|
int timer;
|
||||||
int mouseX;
|
|
||||||
int mouseY;
|
|
||||||
int mouse2d;
|
int mouse2d;
|
||||||
|
|
||||||
//Model *mainModel;
|
//Model *mainModel;
|
||||||
|
|
|
@ -269,7 +269,7 @@ static void cleanupProcessObjects() {
|
||||||
|
|
||||||
for(int i = 0; i < Thread::getThreadList().size(); ++i) {
|
for(int i = 0; i < Thread::getThreadList().size(); ++i) {
|
||||||
BaseThread *baseThread = dynamic_cast<BaseThread *>(Thread::getThreadList()[i]);
|
BaseThread *baseThread = dynamic_cast<BaseThread *>(Thread::getThreadList()[i]);
|
||||||
printf("Thread index: %d ptr [%p] isBaseThread: %d, Name: [%s]\n",i,baseThread,(baseThread != NULL),(baseThread != NULL ? baseThread->getUniqueID().c_str() : "<na>"));
|
printf("Thread index: %d ptr [%p] isBaseThread: %d, Name: [%s]\n",i,baseThread,(baseThread != NULL ? 1 : 0),(baseThread != NULL ? baseThread->getUniqueID().c_str() : "<na>"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -421,7 +421,7 @@ bool next_word_is_ASCII(const string &str_,int start_index) {
|
||||||
int length = end_index-start_index+1;
|
int length = end_index-start_index+1;
|
||||||
string word = str_.substr(start_index,length);
|
string word = str_.substr(start_index,length);
|
||||||
//printf("Line: %d word [%s] length: %d\n",__LINE__,word.c_str(),length);
|
//printf("Line: %d word [%s] length: %d\n",__LINE__,word.c_str(),length);
|
||||||
int alphaCount = 0;
|
//int alphaCount = 0;
|
||||||
for(int index = 0; index < word.size(); ++index) {
|
for(int index = 0; index < word.size(); ++index) {
|
||||||
//printf("%c = %d,",word[index],isalnum(word[index]));
|
//printf("%c = %d,",word[index],isalnum(word[index]));
|
||||||
if(isalnum(word[index]) != 0) {
|
if(isalnum(word[index]) != 0) {
|
||||||
|
@ -644,7 +644,7 @@ void Font::bidi_cvt(string &str_) {
|
||||||
vtol = new FriBidiStrIndex[size * 3];
|
vtol = new FriBidiStrIndex[size * 3];
|
||||||
|
|
||||||
FriBidiCharType base;
|
FriBidiCharType base;
|
||||||
size_t len, orig_len;
|
size_t len;
|
||||||
|
|
||||||
//A bool type to see if conversion succeded
|
//A bool type to see if conversion succeded
|
||||||
fribidi_boolean log2vis;
|
fribidi_boolean log2vis;
|
||||||
|
@ -657,7 +657,7 @@ void Font::bidi_cvt(string &str_) {
|
||||||
strcpy(ip, str_.c_str());
|
strcpy(ip, str_.c_str());
|
||||||
|
|
||||||
//Find length of originall text
|
//Find length of originall text
|
||||||
orig_len = len = strlen( ip );
|
len = strlen( ip );
|
||||||
|
|
||||||
//Insert ip to logical as unicode (and find it's size now)
|
//Insert ip to logical as unicode (and find it's size now)
|
||||||
len = fribidi_charset_to_unicode (char_set_num, ip, (FriBidiStrIndex)len, logical);
|
len = fribidi_charset_to_unicode (char_set_num, ip, (FriBidiStrIndex)len, logical);
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
CPPUNIT_ASSERT_EQUAL( 45,(int)IntroText1.size() );
|
CPPUNIT_ASSERT_EQUAL( 45,(int)IntroText1.size() );
|
||||||
|
|
||||||
std::vector<std::pair<char, int> > result = Font::extract_mixed_LTR_RTL_map(IntroText1);
|
std::vector<std::pair<char, int> > result = Font::extract_mixed_LTR_RTL_map(IntroText1);
|
||||||
//CPPUNIT_ASSERT_EQUAL( 30, (int)result.size() );
|
CPPUNIT_ASSERT_EQUAL( 30, (int)result.size() );
|
||||||
|
|
||||||
#ifdef HAVE_FRIBIDI
|
#ifdef HAVE_FRIBIDI
|
||||||
IntroText1 = expected;
|
IntroText1 = expected;
|
||||||
|
@ -76,7 +76,7 @@ public:
|
||||||
CPPUNIT_ASSERT_EQUAL( 44,(int)LuaDisableSecuritySandbox.size() );
|
CPPUNIT_ASSERT_EQUAL( 44,(int)LuaDisableSecuritySandbox.size() );
|
||||||
|
|
||||||
result = Font::extract_mixed_LTR_RTL_map(LuaDisableSecuritySandbox);
|
result = Font::extract_mixed_LTR_RTL_map(LuaDisableSecuritySandbox);
|
||||||
//CPPUNIT_ASSERT_EQUAL( 7, (int)result.size() );
|
CPPUNIT_ASSERT_EQUAL( 4, (int)result.size() );
|
||||||
|
|
||||||
//printf("Result: [%s]\n",LuaDisableSecuritySandbox.c_str());
|
//printf("Result: [%s]\n",LuaDisableSecuritySandbox.c_str());
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ public:
|
||||||
CPPUNIT_ASSERT_EQUAL( false, newInstance.isInitialized() );
|
CPPUNIT_ASSERT_EQUAL( false, newInstance.isInitialized() );
|
||||||
}
|
}
|
||||||
void test_load_file_missing() {
|
void test_load_file_missing() {
|
||||||
XmlNode *rootNode = XmlIo::getInstance().load("/some/path/that/does/not exist", std::map<string,string>());
|
XmlIo::getInstance().load("/some/path/that/does/not exist", std::map<string,string>());
|
||||||
}
|
}
|
||||||
void test_load_file_valid() {
|
void test_load_file_valid() {
|
||||||
const string test_filename = "xml_test_valid.xml";
|
const string test_filename = "xml_test_valid.xml";
|
||||||
|
@ -121,7 +121,7 @@ public:
|
||||||
createMalformedXMLTestFile(test_filename);
|
createMalformedXMLTestFile(test_filename);
|
||||||
SafeRemoveTestFile deleteFile(test_filename);
|
SafeRemoveTestFile deleteFile(test_filename);
|
||||||
|
|
||||||
XmlNode *rootNode = XmlIo::getInstance().load(test_filename, std::map<string,string>());
|
XmlIo::getInstance().load(test_filename, std::map<string,string>());
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_save_file_null_node() {
|
void test_save_file_null_node() {
|
||||||
|
@ -174,7 +174,7 @@ public:
|
||||||
CPPUNIT_ASSERT_EQUAL( false, newInstance.isInitialized() );
|
CPPUNIT_ASSERT_EQUAL( false, newInstance.isInitialized() );
|
||||||
}
|
}
|
||||||
void test_load_file_missing() {
|
void test_load_file_missing() {
|
||||||
XmlNode *rootNode = XmlIoRapid::getInstance().load("/some/path/that/does/not exist", std::map<string,string>());
|
XmlIoRapid::getInstance().load("/some/path/that/does/not exist", std::map<string,string>());
|
||||||
}
|
}
|
||||||
void test_load_file_valid() {
|
void test_load_file_valid() {
|
||||||
const string test_filename = "xml_test_valid.xml";
|
const string test_filename = "xml_test_valid.xml";
|
||||||
|
@ -190,7 +190,7 @@ public:
|
||||||
const string test_filename = "xml_test_malformed.xml";
|
const string test_filename = "xml_test_malformed.xml";
|
||||||
createMalformedXMLTestFile(test_filename);
|
createMalformedXMLTestFile(test_filename);
|
||||||
SafeRemoveTestFile deleteFile(test_filename);
|
SafeRemoveTestFile deleteFile(test_filename);
|
||||||
XmlNode *rootNode = XmlIoRapid::getInstance().load(test_filename, std::map<string,string>());
|
XmlIoRapid::getInstance().load(test_filename, std::map<string,string>());
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_save_file_null_node() {
|
void test_save_file_null_node() {
|
||||||
|
@ -548,7 +548,7 @@ public:
|
||||||
CPPUNIT_ASSERT_EQUAL( string(""),attr.getValue() );
|
CPPUNIT_ASSERT_EQUAL( string(""),attr.getValue() );
|
||||||
|
|
||||||
attr.setValue("-123456");
|
attr.setValue("-123456");
|
||||||
int value = attr.getIntValue(1, 10);
|
attr.getIntValue(1, 10);
|
||||||
}
|
}
|
||||||
void test_node_attributes_float_outofrange() {
|
void test_node_attributes_float_outofrange() {
|
||||||
const string test_filename = "xml_test_valid.xml";
|
const string test_filename = "xml_test_valid.xml";
|
||||||
|
@ -562,7 +562,7 @@ public:
|
||||||
XmlAttribute attr(node, mapTagReplacementValues);
|
XmlAttribute attr(node, mapTagReplacementValues);
|
||||||
|
|
||||||
attr.setValue("-123456.01");
|
attr.setValue("-123456.01");
|
||||||
float value = attr.getFloatValue(-123456.999f, -123456.123456f);
|
attr.getFloatValue(-123456.999f, -123456.123456f);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -188,10 +188,10 @@ int g3d2xml(FILE *infile, FILE *outfile)
|
||||||
|
|
||||||
/* write out XML mesh header */
|
/* write out XML mesh header */
|
||||||
fprintf(outfile, "\t<Mesh name=\"%s\" ", meshHeader.name);
|
fprintf(outfile, "\t<Mesh name=\"%s\" ", meshHeader.name);
|
||||||
fprintf(outfile, "frameCount=\"%d\" ", meshHeader.frameCount);
|
fprintf(outfile, "frameCount=\"%u\" ", meshHeader.frameCount);
|
||||||
fprintf(outfile, "vertexCount=\"%d\" ",
|
fprintf(outfile, "vertexCount=\"%u\" ",
|
||||||
meshHeader.vertexCount);
|
meshHeader.vertexCount);
|
||||||
fprintf(outfile, "indexCount=\"%d\" ", meshHeader.indexCount);
|
fprintf(outfile, "indexCount=\"%u\" ", meshHeader.indexCount);
|
||||||
fprintf(outfile, "specularPower=\"%f\" ",
|
fprintf(outfile, "specularPower=\"%f\" ",
|
||||||
meshHeader.specularPower);
|
meshHeader.specularPower);
|
||||||
fprintf(outfile, "opacity=\"%f\" ", meshHeader.opacity);
|
fprintf(outfile, "opacity=\"%f\" ", meshHeader.opacity);
|
||||||
|
@ -352,7 +352,7 @@ int g3d2xml(FILE *infile, FILE *outfile)
|
||||||
fprintf(outfile, "\t\t<Indices>\n");
|
fprintf(outfile, "\t\t<Indices>\n");
|
||||||
for (kk=0; kk < meshHeader.indexCount; kk++)
|
for (kk=0; kk < meshHeader.indexCount; kk++)
|
||||||
{
|
{
|
||||||
fprintf(outfile, "\t\t\t<Ix i=\"%d\"/>\n",
|
fprintf(outfile, "\t\t\t<Ix i=\"%u\"/>\n",
|
||||||
idata[kk]);
|
idata[kk]);
|
||||||
}
|
}
|
||||||
fprintf(outfile, "\t\t</Indices>\n");
|
fprintf(outfile, "\t\t</Indices>\n");
|
||||||
|
|
Loading…
Reference in New Issue