mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-20 19:21:46 +00:00
Fix some cppcheck warnings reported by salty-horse
svn-id: r44538
This commit is contained in:
parent
41f6365f9b
commit
01176782ea
@ -297,8 +297,6 @@ uint AGOSEngine::loadTextFile_gme(const char *filename, byte *dst) {
|
||||
|
||||
void AGOSEngine::loadTextIntoMem(uint16 stringId) {
|
||||
byte *p;
|
||||
char filename[30];
|
||||
int i;
|
||||
uint16 baseMin = 0x8000, baseMax, size;
|
||||
|
||||
_tablesHeapPtr = _tablesheapPtrNew;
|
||||
@ -308,13 +306,13 @@ void AGOSEngine::loadTextIntoMem(uint16 stringId) {
|
||||
|
||||
// get filename
|
||||
while (*p) {
|
||||
for (i = 0; *p; p++, i++)
|
||||
filename[i] = *p;
|
||||
filename[i] = 0;
|
||||
Common::String filename;
|
||||
while (*p)
|
||||
filename += *p++;
|
||||
p++;
|
||||
|
||||
if (getPlatform() == Common::kPlatformAcorn) {
|
||||
sprintf(filename, "%s.DAT", filename);
|
||||
filename += ".DAT";
|
||||
}
|
||||
|
||||
baseMax = (p[0] * 256) | p[1];
|
||||
@ -330,7 +328,7 @@ void AGOSEngine::loadTextIntoMem(uint16 stringId) {
|
||||
_tablesHeapPtr += size;
|
||||
_tablesHeapCurPos += size;
|
||||
|
||||
size = loadTextFile(filename, _tablesHeapPtr);
|
||||
size = loadTextFile(filename.c_str(), _tablesHeapPtr);
|
||||
|
||||
setupLocalStringTable(_tablesHeapPtr, baseMax - baseMin + 1);
|
||||
|
||||
|
@ -339,9 +339,7 @@ bool AGOSEngine::loadTablesIntoMem(uint16 subrId) {
|
||||
|
||||
bool AGOSEngine_Waxworks::loadTablesIntoMem(uint16 subrId) {
|
||||
byte *p;
|
||||
int i;
|
||||
uint min_num, max_num;
|
||||
char filename[30];
|
||||
File *in;
|
||||
|
||||
p = _tblList;
|
||||
@ -349,13 +347,13 @@ bool AGOSEngine_Waxworks::loadTablesIntoMem(uint16 subrId) {
|
||||
return 0;
|
||||
|
||||
while (*p) {
|
||||
for (i = 0; *p; p++, i++)
|
||||
filename[i] = *p;
|
||||
filename[i] = 0;
|
||||
Common::String filename;
|
||||
while (*p)
|
||||
filename += *p++;
|
||||
p++;
|
||||
|
||||
if (getPlatform() == Common::kPlatformAcorn) {
|
||||
sprintf(filename, "%s.DAT", filename);
|
||||
filename += ".DAT";
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
@ -372,15 +370,20 @@ bool AGOSEngine_Waxworks::loadTablesIntoMem(uint16 subrId) {
|
||||
_stringIdLocalMin = 1;
|
||||
_stringIdLocalMax = 0;
|
||||
|
||||
in = openTablesFile(filename);
|
||||
in = openTablesFile(filename.c_str());
|
||||
readSubroutineBlock(in);
|
||||
closeTablesFile(in);
|
||||
if (getGameType() == GType_SIMON2) {
|
||||
_sound->loadSfxTable(_gameFile, _gameOffsetsPtr[atoi(filename + 6) - 1 + _soundIndexBase]);
|
||||
_sound->loadSfxTable(_gameFile, _gameOffsetsPtr[atoi(filename.c_str() + 6) - 1 + _soundIndexBase]);
|
||||
} else if (getGameType() == GType_SIMON1 && getPlatform() == Common::kPlatformWindows) {
|
||||
memcpy(filename, "SFXXXX", 6);
|
||||
if (atoi(filename + 6) != 1 && atoi(filename + 6) != 30)
|
||||
_sound->readSfxFile(filename);
|
||||
filename.setChar(0, 'S');
|
||||
filename.setChar(1, 'F');
|
||||
filename.setChar(2, 'X');
|
||||
filename.setChar(3, 'X');
|
||||
filename.setChar(4, 'X');
|
||||
filename.setChar(5, 'X');
|
||||
if (atoi(filename.c_str() + 6) != 1 && atoi(filename.c_str() + 6) != 30)
|
||||
_sound->readSfxFile(filename.c_str());
|
||||
}
|
||||
|
||||
alignTableMem();
|
||||
|
@ -433,8 +433,6 @@ reg_t kSort(EngineState *s, int argc, reg_t *argv) {
|
||||
int input_size = (int16)GET_SEL32V(source, size);
|
||||
int i;
|
||||
|
||||
sort_temp_t *temp_array = (sort_temp_t *)malloc(sizeof(sort_temp_t) * input_size);
|
||||
|
||||
reg_t input_data = GET_SEL32(source, elements);
|
||||
reg_t output_data = GET_SEL32(dest, elements);
|
||||
|
||||
@ -455,6 +453,8 @@ reg_t kSort(EngineState *s, int argc, reg_t *argv) {
|
||||
list = lookup_list(s, input_data);
|
||||
node = lookup_node(s, list->first);
|
||||
|
||||
sort_temp_t *temp_array = (sort_temp_t *)malloc(sizeof(sort_temp_t) * input_size);
|
||||
|
||||
i = 0;
|
||||
while (node) {
|
||||
invoke_selector(INV_SEL(order_func, doit, kStopOnInvalidSelector), 1, node->value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user