deleteWidgets();
debug(("engine: free databuffer\n"));
- if (dataBuffer != NULL)
- delete[] dataBuffer;
+ delete[] dataBuffer;
debug(("engine: free binarybuffer\n"));
- if (binaryBuffer != NULL)
- delete[] binaryBuffer;
+ delete[] binaryBuffer;
debug(("Clearing Define List...\n"));
defineList.clear();
{
if (fileType == PAK_DATA)
{
- if (dataBuffer != NULL)
- delete[] dataBuffer;
-
+ delete[] dataBuffer;
dataBuffer = NULL;
}
else
{
- if (binaryBuffer != NULL)
- delete[] binaryBuffer;
-
+ delete[] binaryBuffer;
binaryBuffer = NULL;
}
bool Engine::loadData(const char *filename)
{
- if (dataBuffer != NULL)
- {
- delete[] dataBuffer;
- dataBuffer = NULL;
- }
+ delete[] dataBuffer;
+ dataBuffer = NULL;
#if USEPAK
return unpack(filename, PAK_DATA);
Pak::~Pak()
{
- if (input != NULL)
- delete[] input;
-
- input = NULL;
-
- if (fd != NULL)
- delete[] fd;
-
- fd = NULL;
+ delete[] input;
+ delete[] fd;
}
void Pak::showPakErrorAndExit()
fseek(pak, currentFile->location, SEEK_SET);
- if (input != NULL)
- {
- delete[] input;
- }
-
+ delete[] input;
input = NULL;
input = new unsigned char[(int)(currentFile->cSize * 1.01) + 12];
fclose(pak);
- if (input != NULL)
- delete[] input;
-
+ delete[] input;
input = NULL;
debug(("Pak : Unpack %s...Done\n", filename));
void cleanup()
{
- if (buffer != NULL)
- {
- delete[] buffer;
- }
-
- if (output != NULL)
- {
- delete[] output;
- }
+ delete[] buffer;
+ delete[] output;
}
void countFiles(const char *dirName)
fclose(infile);
- if (buffer != NULL)
- {
- delete[] buffer;
- buffer = NULL;
- }
-
+ delete[] buffer;
buffer = new unsigned char[filesize];
- if (output != NULL)
- {
- delete[] output;
- output = NULL;
- }
-
+ delete[] output;
output = new unsigned char[(int)(filesize * 1.01) + 12];
fp = gzopen(filename, "rb");