mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 03:32:35 +01:00
- cppcheck code cleanup
This commit is contained in:
parent
87f855b419
commit
b8ab732b85
@ -1280,7 +1280,6 @@ void MainWindow::loadModel(string path) {
|
||||
|
||||
if(timer) timer->Stop();
|
||||
delete model;
|
||||
model = NULL;
|
||||
model = renderer? renderer->newModel(rsGlobal, modelPath): NULL;
|
||||
|
||||
statusbarText = getModelInfo();
|
||||
|
@ -376,7 +376,7 @@ void ChatManager::deleteText(int deleteCount,bool addToAutoCompleteBuffer) {
|
||||
void ChatManager::appendText(const wchar_t *addText, bool validateChars, bool addToAutoCompleteBuffer) {
|
||||
for(unsigned int i = 0; i < wcslen(addText); ++i) {
|
||||
wchar_t key = addText[i];
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("appendText key [%d]\n\n",key);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("appendText key [%d]\n\n",(int)key);
|
||||
|
||||
if(validateChars == false ||
|
||||
(isAllowedInputTextKey(key) == true && key != 10)) {
|
||||
|
@ -498,6 +498,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(f) fclose(f);
|
||||
}
|
||||
else {
|
||||
if(f) fclose(f);
|
||||
@ -505,7 +506,6 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) {
|
||||
|
||||
throw megaglest_runtime_error("Can't open file");
|
||||
}
|
||||
if(f) fclose(f);
|
||||
}
|
||||
catch(const exception &e){
|
||||
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s]\n",__FILE__,__FUNCTION__,__LINE__,e.what());
|
||||
|
@ -4594,7 +4594,7 @@ mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *
|
||||
return MZ_FALSE;
|
||||
}
|
||||
|
||||
cur_src_file_ofs += n;
|
||||
//cur_src_file_ofs += n;
|
||||
cur_dst_file_ofs += n;
|
||||
}
|
||||
pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
|
||||
|
@ -215,7 +215,7 @@ inline void init_genrand(SizedUnsignedInteger<64>::Type seed, RandomState& state
|
||||
/* generates a random number on [0, 2^64-1]-interval */
|
||||
inline SizedUnsignedInteger<64>::Type genrand_int(RandomState& state)
|
||||
{
|
||||
int i;
|
||||
|
||||
SizedUnsignedInteger<64>::Type x;
|
||||
static SizedUnsignedInteger<64>::Type mag01[2]={0ULL, MATRIX_A};
|
||||
|
||||
@ -225,7 +225,7 @@ inline SizedUnsignedInteger<64>::Type genrand_int(RandomState& state)
|
||||
/* a default initial seed is used */
|
||||
//if (state.mti == NN+1)
|
||||
//init_genrand64(5489ULL, state);
|
||||
|
||||
int i = 0;
|
||||
for (i=0;i<NN-MM;i++) {
|
||||
x = (state.mt[i]&UM)|(state.mt[i+1]&LM);
|
||||
state.mt[i] = state.mt[i+MM] ^ (x>>1) ^ mag01[(int)(x&1ULL)];
|
||||
|
Loading…
x
Reference in New Issue
Block a user