mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-20 06:59:46 -04:00
Tools/MapExtractor: Fix a warning reported by gcc 4.9
/var/lib/jenkins/jobs/tc_335_release_gcc49/workspace/src/tools/map_extractor/System.cpp:113:25: error: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result [-Werror=unused-result]
chdir("../");
*NO reextraction of dbcs/maps needed*
Binary compatibility is ensured
(cherry picked from commit f0c7061f0b)
Conflicts:
src/tools/map_extractor/CMakeLists.txt
src/tools/map_extractor/System.cpp
src/tools/map_extractor/loadlib.cpp
src/tools/map_extractor/loadlib/loadlib.h
src/tools/map_extractor/mpq_libmpq04.h
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
|
||||
#include "loadlib.h"
|
||||
#include <cstdio>
|
||||
|
||||
u_map_fcc MverMagic = { { 'R','E','V','M' } };
|
||||
|
||||
@@ -34,20 +33,20 @@ ChunkedFile::~ChunkedFile()
|
||||
free();
|
||||
}
|
||||
|
||||
bool ChunkedFile::loadFile(HANDLE mpq, char* filename, bool log)
|
||||
bool ChunkedFile::loadFile(HANDLE mpq, std::string const& fileName, bool log)
|
||||
{
|
||||
free();
|
||||
HANDLE file;
|
||||
if (!CascOpenFile(mpq, filename, CASC_LOCALE_ALL, 0, &file))
|
||||
if (!CascOpenFile(mpq, fileName.c_str(), CASC_LOCALE_ALL, 0, &file))
|
||||
{
|
||||
if (log)
|
||||
printf("No such file %s\n", filename);
|
||||
printf("No such file %s\n", fileName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
data_size = CascGetFileSize(file, NULL);
|
||||
data_size = CascGetFileSize(file, nullptr);
|
||||
data = new uint8[data_size];
|
||||
CascReadFile(file, data, data_size, NULL/*bytesRead*/);
|
||||
CascReadFile(file, data, data_size, nullptr/*bytesRead*/);
|
||||
parseChunks();
|
||||
if (prepareLoadedData())
|
||||
{
|
||||
@@ -55,7 +54,7 @@ bool ChunkedFile::loadFile(HANDLE mpq, char* filename, bool log)
|
||||
return true;
|
||||
}
|
||||
|
||||
printf("Error loading %s\n", filename);
|
||||
printf("Error loading %s\n", fileName.c_str());
|
||||
CascCloseFile(file);
|
||||
free();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user