Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources
This commit is contained in:
1 parent
7fff6c424f
commit
5ff847159c
1243 files changed
+29780
-36517
No files matched your search
@@ -21,7 +21,7 @@
|
||||
#include "dbcfile.h"
|
||||
|
||||
DBCFile::DBCFile(HANDLE file) :
|
||||
_file(file), _data(NULL), _stringTable(NULL)
|
||||
_file(file), _data(nullptr), _stringTable(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -31,26 +31,26 @@ bool DBCFile::open()
|
||||
unsigned int na, nb, es, ss;
|
||||
|
||||
DWORD readBytes = 0;
|
||||
SFileReadFile(_file, header, 4, &readBytes, NULL);
|
||||
SFileReadFile(_file, header, 4, &readBytes, nullptr);
|
||||
if (readBytes != 4) // Number of records
|
||||
return false;
|
||||
|
||||
if (header[0] != 'W' || header[1] != 'D' || header[2] != 'B' || header[3] != 'C')
|
||||
return false;
|
||||
|
||||
SFileReadFile(_file, &na, 4, &readBytes, NULL);
|
||||
SFileReadFile(_file, &na, 4, &readBytes, nullptr);
|
||||
if (readBytes != 4) // Number of records
|
||||
return false;
|
||||
|
||||
SFileReadFile(_file, &nb, 4, &readBytes, NULL);
|
||||
SFileReadFile(_file, &nb, 4, &readBytes, nullptr);
|
||||
if (readBytes != 4) // Number of fields
|
||||
return false;
|
||||
|
||||
SFileReadFile(_file, &es, 4, &readBytes, NULL);
|
||||
SFileReadFile(_file, &es, 4, &readBytes, nullptr);
|
||||
if (readBytes != 4) // Size of a record
|
||||
return false;
|
||||
|
||||
SFileReadFile(_file, &ss, 4, &readBytes, NULL);
|
||||
SFileReadFile(_file, &ss, 4, &readBytes, nullptr);
|
||||
if (readBytes != 4) // String size
|
||||
return false;
|
||||
|
||||
@@ -65,7 +65,7 @@ bool DBCFile::open()
|
||||
_stringTable = _data + _recordSize*_recordCount;
|
||||
|
||||
size_t data_size = _recordSize * _recordCount + _stringSize;
|
||||
SFileReadFile(_file, _data, data_size, &readBytes, NULL);
|
||||
SFileReadFile(_file, _data, data_size, &readBytes, nullptr);
|
||||
if (readBytes != data_size)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in new issue
Block a user