Skip to content
Snippets Groups Projects
Commit d6b8f9f3 authored by Oliver Bock's avatar Oliver Bock
Browse files

Ensure 64 bit compatibility

parent b9739aa3
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ void ResourceCompiler::compile() ...@@ -45,7 +45,7 @@ void ResourceCompiler::compile()
map<string, vector<unsigned char> >::iterator mapPos; map<string, vector<unsigned char> >::iterator mapPos;
vector<unsigned char>::iterator dataPos; vector<unsigned char>::iterator dataPos;
unsigned int currentIndex = 0; size_t currentIndex = 0;
// store total amount of resources // store total amount of resources
resourceIndexInitializer << "{0x" << hex << m_ResourceDataMap.size() << ", 0x0},"; resourceIndexInitializer << "{0x" << hex << m_ResourceDataMap.size() << ", 0x0},";
...@@ -64,7 +64,7 @@ void ResourceCompiler::compile() ...@@ -64,7 +64,7 @@ void ResourceCompiler::compile()
// iterate over the data content byte by byte // iterate over the data content byte by byte
for(dataPos = mapPos->second.begin(); dataPos != mapPos->second.end(); ++dataPos) { for(dataPos = mapPos->second.begin(); dataPos != mapPos->second.end(); ++dataPos) {
// store byte value as part of array initializer // store byte value as part of array initializer
resourceStorageInitializer << "0x" << hex << (int)*dataPos << ","; resourceStorageInitializer << "0x" << hex << (size_t)*dataPos << ",";
} }
} }
...@@ -89,7 +89,7 @@ void ResourceCompiler::compile() ...@@ -89,7 +89,7 @@ void ResourceCompiler::compile()
outputFile << endl << "};" << endl << endl; outputFile << endl << "};" << endl << endl;
output = resourceIndexInitializer.str(); output = resourceIndexInitializer.str();
outputFile << "extern const unsigned int c_ResourceIndex[][2] = {" << endl; outputFile << "extern const unsigned size_t c_ResourceIndex[][2] = {" << endl;
outputFile << output.substr(0, output.length() - 1); outputFile << output.substr(0, output.length() - 1);
outputFile << endl << "};" << endl << endl; outputFile << endl << "};" << endl << endl;
...@@ -124,13 +124,13 @@ void ResourceCompiler::parseInputFile() ...@@ -124,13 +124,13 @@ void ResourceCompiler::parseInputFile()
// read input file line by line // read input file line by line
while(getline(inputFile, line)) { while(getline(inputFile, line)) {
unsigned int firstCharacter = line.find_first_not_of(" \t\r\n\f"); size_t firstCharacter = line.find_first_not_of(" \t\r\n\f");
// we (sort of) allow for empty lines and comments // we (sort of) allow for empty lines and comments
if(firstCharacter != string::npos && line.substr(firstCharacter, 1) != "#") { if(firstCharacter != string::npos && line.substr(firstCharacter, 1) != "#") {
// find our token delimiter // find our token delimiter
unsigned int separator = line.find("|"); size_t separator = line.find("|");
// make sure there's exactly one delimiter // make sure there's exactly one delimiter
if(separator == string::npos || separator != line.rfind("|")) { if(separator == string::npos || separator != line.rfind("|")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment