mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 19:52:25 +01:00
code cleanup from cppcheck
This commit is contained in:
parent
511ba5134f
commit
4848e957e7
@ -412,7 +412,7 @@ void GraphicListBox::setItems(const vector<string> &items, const vector<string>
|
|||||||
void GraphicListBox::setSelectedItemIndex(int index, bool errorOnMissing){
|
void GraphicListBox::setSelectedItemIndex(int index, bool errorOnMissing){
|
||||||
if(errorOnMissing == true && (index < 0 || index >= items.size())) {
|
if(errorOnMissing == true && (index < 0 || index >= items.size())) {
|
||||||
char szBuf[8096]="";
|
char szBuf[8096]="";
|
||||||
snprintf(szBuf,8096,"Index not found in listbox name: [%s] value index: %d",this->instanceName.c_str(),index,items.size());
|
snprintf(szBuf,8096,"Index not found in listbox name: [%s] value index: %d size: %lu",this->instanceName.c_str(),index,(unsigned long)items.size());
|
||||||
throw megaglest_runtime_error(szBuf);
|
throw megaglest_runtime_error(szBuf);
|
||||||
}
|
}
|
||||||
selectedItemIndex= index;
|
selectedItemIndex= index;
|
||||||
|
@ -38,7 +38,6 @@ const int Logger::logLineCount= 15;
|
|||||||
// ===================== PUBLIC ========================
|
// ===================== PUBLIC ========================
|
||||||
|
|
||||||
Logger::Logger() {
|
Logger::Logger() {
|
||||||
string containerName = "Logger";
|
|
||||||
progress = 0;
|
progress = 0;
|
||||||
string logs_path = getGameReadWritePath(GameConstants::path_logs_CacheLookupKey);
|
string logs_path = getGameReadWritePath(GameConstants::path_logs_CacheLookupKey);
|
||||||
if(logs_path != "") {
|
if(logs_path != "") {
|
||||||
|
@ -100,7 +100,7 @@ static int getFileAndLine(char *function, void *address, char *file, size_t flen
|
|||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
// after file name follows line number
|
// after file name follows line number
|
||||||
strcpy (file , buf);
|
strcpy (file , buf);
|
||||||
sscanf (p,"%d", &line);
|
sscanf (p,"%10d", &line);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
strcpy (file,"unknown");
|
strcpy (file,"unknown");
|
||||||
@ -128,7 +128,7 @@ static int getFileAndLine(char *function, void *address, char *file, size_t flen
|
|||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
// after file name follows line number
|
// after file name follows line number
|
||||||
strcpy (file , buf);
|
strcpy (file , buf);
|
||||||
sscanf (p,"%d", &line);
|
sscanf (p,"%10d", &line);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
strcpy (file,"unknown");
|
strcpy (file,"unknown");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user