- round 2 of cppcheck code cleanup

This commit is contained in:
SoftCoder
2017-10-09 20:21:14 -07:00
parent 26581a77d2
commit 865a665bf0
40 changed files with 750 additions and 750 deletions

View File

@@ -48,7 +48,7 @@ int getGlMaxTextureSize();
int getGlMaxTextureUnits();
int getGlModelviewMatrixStackDepth();
int getGlProjectionMatrixStackDepth();
void checkGlExtension(const char *extensionName);
//void checkGlExtension(const char *extensionName);
void inline _assertGl(const char *file, int line, GLenum *forceErrorNumber = NULL) {
GLenum error = (forceErrorNumber != NULL ? *forceErrorNumber : glGetError());

View File

@@ -231,7 +231,7 @@ string replaceBy(const string &s, char c1, char c2);
vector<string> split(string s,string d);
string toLower(const string &s);
bool compareNonCaseSensitive(const string a, const string b);
void copyStringToBuffer(char *buffer, int bufferSize, const string& s);
//void copyStringToBuffer(char *buffer, int bufferSize, const string& s);
//numeric fcs
int clamp(int value, int min, int max);

View File

@@ -167,10 +167,10 @@ int getGlProjectionMatrixStackDepth() {
return i;
}
void checkGlExtension(const char *extensionName) {
if(!isGlExtensionSupported(extensionName)){
throw megaglest_runtime_error("OpenGL extension not supported: " + string(extensionName));
}
}
//void checkGlExtension(const char *extensionName) {
// if(!isGlExtensionSupported(extensionName)){
// throw megaglest_runtime_error("OpenGL extension not supported: " + string(extensionName));
// }
//}
}}}// end namespace

View File

@@ -201,8 +201,8 @@ bool IsNumeric(const char *p, bool allowNegative) {
class Comma: public numpunct<char>// own facet class
{
protected:
char do_thousands_sep() const { return ','; }// use the comma
string do_grouping() const { return "\3"; }//group 3 digits
//char do_thousands_sep() const { return ','; }// use the comma
//string do_grouping() const { return "\3"; }//group 3 digits
};
string formatNumber(uint64 f) {

View File

@@ -745,10 +745,10 @@ bool compareNonCaseSensitive(const string a, const string b) {
return (toLower(a) < toLower(b));
}
void copyStringToBuffer(char *buffer, int bufferSize, const string& s){
strncpy(buffer, s.c_str(), bufferSize-1);
buffer[bufferSize-1]= '\0';
}
//void copyStringToBuffer(char *buffer, int bufferSize, const string& s){
// strncpy(buffer, s.c_str(), bufferSize-1);
// buffer[bufferSize-1]= '\0';
//}
// ==================== numeric fcs ====================