mirror of
https://github.com/glest/glest-source.git
synced 2025-09-27 07:59:00 +02:00
- attempt to bugfix windows using proper printf syntax for data types
This commit is contained in:
@@ -795,7 +795,7 @@ void MapPreview::loadFromFile(const string &path) {
|
||||
size_t bytes = fread(&header, sizeof(MapFileHeader), 1, f1);
|
||||
if(bytes != 1) {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__);
|
||||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",bytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
fromEndianMapFileHeader(header);
|
||||
@@ -820,7 +820,7 @@ void MapPreview::loadFromFile(const string &path) {
|
||||
bytes = fread(&startLocations[i].x, sizeof(int32), 1, f1);
|
||||
if(bytes != 1) {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__);
|
||||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",bytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
startLocations[i].x = Shared::PlatformByteOrder::fromCommonEndian(startLocations[i].x);
|
||||
@@ -828,7 +828,7 @@ void MapPreview::loadFromFile(const string &path) {
|
||||
bytes = fread(&startLocations[i].y, sizeof(int32), 1, f1);
|
||||
if(bytes != 1) {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__);
|
||||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",bytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
startLocations[i].y = Shared::PlatformByteOrder::fromCommonEndian(startLocations[i].y);
|
||||
@@ -841,7 +841,7 @@ void MapPreview::loadFromFile(const string &path) {
|
||||
bytes = fread(&cells[i][j].height, sizeof(float), 1, f1);
|
||||
if(bytes != 1) {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__);
|
||||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",bytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
cells[i][j].height = Shared::PlatformByteOrder::fromCommonEndian(cells[i][j].height);
|
||||
@@ -854,7 +854,7 @@ void MapPreview::loadFromFile(const string &path) {
|
||||
bytes = fread(&cells[i][j].surface, sizeof(int8), 1, f1);
|
||||
if(bytes != 1) {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__);
|
||||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",bytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
cells[i][j].surface = Shared::PlatformByteOrder::fromCommonEndian(cells[i][j].surface);
|
||||
@@ -868,7 +868,7 @@ void MapPreview::loadFromFile(const string &path) {
|
||||
bytes = fread(&obj, sizeof(int8), 1, f1);
|
||||
if(bytes != 1) {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__);
|
||||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",bytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
obj = Shared::PlatformByteOrder::fromCommonEndian(obj);
|
||||
@@ -1056,7 +1056,7 @@ bool MapPreview::loadMapInfo(string file, MapInfo *mapInfo, string i18nMaxMapPla
|
||||
|
||||
if(errorOnInvalidMap == true) {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"In [%s::%s Line: %d]\nfile [%s]\nreadBytes != sizeof(MapFileHeader) [%zu] [%zu]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,file.c_str(),readBytes,sizeof(MapFileHeader));
|
||||
snprintf(szBuf,8096,"In [%s::%s Line: %d]\nfile [%s]\nreadBytes != sizeof(MapFileHeader) [" MG_SIZE_T_SPECIFIER "] [" MG_SIZE_T_SPECIFIER "]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,file.c_str(),readBytes,sizeof(MapFileHeader));
|
||||
SystemFlags::OutputDebug(SystemFlags::debugError,"%s",szBuf);
|
||||
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
|
Reference in New Issue
Block a user