Fix more cppcheck warnings/errors; some code formatting; and fixes to our tools
svn-id: r44539
This commit is contained in:
parent
01176782ea
commit
f54e82e488
8 changed files with 20 additions and 30 deletions
|
@ -451,7 +451,7 @@ bool selectGame(char *&ret, char *&dir_ret, Common::Language &lang_ret, Common::
|
|||
if (selected >= 0)
|
||||
the_game = games[selected];
|
||||
|
||||
delete games;
|
||||
delete[] games;
|
||||
|
||||
if (selected>=0) {
|
||||
#if 0
|
||||
|
|
|
@ -1063,8 +1063,6 @@ bool process(PAKFile &out, const Game *g, const byte *data, const uint32 size) {
|
|||
|
||||
bool setupSearch(const int *needList, Search &search, DataIdList &dataIdList) {
|
||||
for (const int *entry = needList; *entry != -1; ++entry) {
|
||||
bool found = false;
|
||||
|
||||
ExtractEntryList providers = getProvidersForId(*entry);
|
||||
|
||||
if (providers.empty()) {
|
||||
|
|
|
@ -880,7 +880,7 @@ const GameNeed gameNeedTable[] = {
|
|||
{ kLol, kPlatformPC, kTalkieFile1, lolCDFile1Need },
|
||||
{ kLol, kPlatformPC, kTalkieFile2, lolCDFile2Need },
|
||||
|
||||
{ -1, -1, 0 }
|
||||
{ -1, -1, -1, 0 }
|
||||
};
|
||||
|
||||
} // end of anonymous namespace
|
||||
|
|
|
@ -65,8 +65,6 @@ private:
|
|||
|
||||
typedef std::map<uint32, uint32> SumMap;
|
||||
SumMap _sums;
|
||||
typedef std::map<uint32, uint> SumCount;
|
||||
SumCount _sumCount;
|
||||
};
|
||||
|
||||
class Search {
|
||||
|
|
|
@ -53,9 +53,10 @@ typedef signed short int16;
|
|||
typedef signed int int32;
|
||||
|
||||
#if !defined(__cplusplus)
|
||||
typedef uint8 bool;
|
||||
#define false 0
|
||||
#define true 1
|
||||
enum bool {
|
||||
false = 0,
|
||||
true = 1
|
||||
};
|
||||
|
||||
/* If your C compiler doesn't support 'inline', please add a check for it. */
|
||||
#if defined(_MSC_VER)
|
||||
|
|
|
@ -778,7 +778,7 @@ void read_anim_data(byte *&data, uint16 &totalSize) {
|
|||
uint16 startOffset;
|
||||
int ctr, dirCtr;
|
||||
int movementSize = 0;
|
||||
bool *includeAnim = (bool *) malloc(animIndex);
|
||||
bool *includeAnim = (bool *)malloc(animIndex);
|
||||
|
||||
// Loop to figure out the total number of movement records there are
|
||||
for (ctr = 0; ctr < animIndex; ++ctr) {
|
||||
|
@ -886,7 +886,7 @@ void read_anim_data(byte *&data, uint16 &totalSize) {
|
|||
}
|
||||
|
||||
rec->animRecordId = TO_LE_16(0xffff);
|
||||
delete includeAnim;
|
||||
free(includeAnim);
|
||||
}
|
||||
|
||||
void read_script_data(byte *&data, uint16 &totalSize) {
|
||||
|
|
|
@ -344,8 +344,7 @@ struct RoomRandomActionSet {
|
|||
RoomRandomActionEntry *entries;
|
||||
};
|
||||
|
||||
void read_action_sequence(byte *&data, uint16 &totalSize)
|
||||
{
|
||||
void read_action_sequence(byte *&data, uint16 &totalSize) {
|
||||
uint16 hotspotIndex;
|
||||
HotspotHeaderEntry entryHeader;
|
||||
CurrentActionInput action;
|
||||
|
@ -381,8 +380,7 @@ void read_action_sequence(byte *&data, uint16 &totalSize)
|
|||
}
|
||||
|
||||
// Next get the set of offsetes for the start of each sequence
|
||||
for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex)
|
||||
{
|
||||
for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex) {
|
||||
if (randomActions[roomIndex].offset == 0)
|
||||
continue;
|
||||
|
||||
|
@ -393,8 +391,7 @@ void read_action_sequence(byte *&data, uint16 &totalSize)
|
|||
|
||||
// Loop through the entries
|
||||
uint16 offset = randomActions[roomIndex].offset + 1;
|
||||
for (uint8 entryCtr = 0; entryCtr < randomActions[roomIndex].numEntries; ++entryCtr)
|
||||
{
|
||||
for (uint8 entryCtr = 0; entryCtr < randomActions[roomIndex].numEntries; ++entryCtr) {
|
||||
randomActions[roomIndex].entries[entryCtr].repeatable = lureExe.readWord() == 1;
|
||||
offset += 2;
|
||||
|
||||
|
@ -485,12 +482,9 @@ void read_action_sequence(byte *&data, uint16 &totalSize)
|
|||
|
||||
// Finally process each of the random room actions
|
||||
|
||||
for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex)
|
||||
{
|
||||
for (index = 0; index < randomActions[roomIndex].numEntries; ++index)
|
||||
{
|
||||
if (randomActions[roomIndex].entries[index].offset != 0xfffe)
|
||||
{
|
||||
for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex) {
|
||||
for (index = 0; index < randomActions[roomIndex].numEntries; ++index) {
|
||||
if (randomActions[roomIndex].entries[index].offset != 0xfffe) {
|
||||
//printf("room=%d entry=%xh\n", roomIndex+1, randomActions[roomIndex].entries[index].offset);
|
||||
process_entry(randomActions[roomIndex].entries[index].offset, data, totalSize);
|
||||
}
|
||||
|
@ -509,8 +503,7 @@ void read_action_sequence(byte *&data, uint16 &totalSize)
|
|||
|
||||
// Output the data for the random room actions
|
||||
|
||||
for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex)
|
||||
{
|
||||
for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex) {
|
||||
if (randomActions[roomIndex].numEntries == 0)
|
||||
continue;
|
||||
|
||||
|
@ -540,10 +533,9 @@ void read_action_sequence(byte *&data, uint16 &totalSize)
|
|||
*pHeader++ = TO_LE_16(0xffff);
|
||||
|
||||
// Free up the random room action array
|
||||
for (roomIndex = 0; roomIndex < 1; ++roomIndex)
|
||||
{
|
||||
for (roomIndex = 0; roomIndex < 1; ++roomIndex) {
|
||||
if (randomActions[roomIndex].entries != NULL)
|
||||
delete randomActions[roomIndex].entries;
|
||||
delete[] randomActions[roomIndex].entries;
|
||||
}
|
||||
delete randomActions;
|
||||
delete[] randomActions;
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ int main(int argc, char *argv[])
|
|||
int err;
|
||||
int i;
|
||||
time_t theTime;
|
||||
const char *generationDate;
|
||||
char *generationDate;
|
||||
|
||||
const int entrySize = 256;
|
||||
int numEntries = 0, maxEntries = 1;
|
||||
|
@ -368,6 +368,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
free(entriesBuffer);
|
||||
free(generationDate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue