* Fixes for compilation on 64-bit architectures :
  string position-returning functions return size_t, not uint.
  Fix that.
* Fixes warnings with new gcc about non-fixed string AND no arguments.

NOTE : 64-bit architectures still do not compile. There are 2 different places
where printf is used with a specifier that is not large enough on 64-bit because
size_t is now a ulong and not a uint. The solution on GNU systems is the %zu
specifier, but as I'm not sure it is supported on windows I don't want to
introduce a huge hard-to-notice bug, so I'll do it at a time when I got a
windowser to back me up.
This commit is contained in:
jean.chalard
2010-01-25 09:58:30 +00:00
parent 9b91fab61b
commit 0a083f4385
13 changed files with 48 additions and 49 deletions

View File

@@ -649,14 +649,14 @@ public:
//TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class;
for (int j = 0; j < Constants::NB_BASIC_ABILITIES; j++){
unsigned int found = sabilities.find(Constants::MTGBasicAbilities[j]);
size_t found = sabilities.find(Constants::MTGBasicAbilities[j]);
if (found != string::npos){
abilities.push_back(j);
}
}
for (int j = 0; j < Constants::MTG_NB_COLORS; j++){
unsigned int found = sabilities.find(Constants::MTGColorStrings[j]);
size_t found = sabilities.find(Constants::MTGColorStrings[j]);
if (found != string::npos){
colors.push_back(j);
}
@@ -664,7 +664,7 @@ public:
string s = stypes;
while (s.size()){
unsigned int found = s.find(" ");
size_t found = s.find(" ");
if (found != string::npos){
int id = Subtypes::subtypesList->find(s.substr(0,found));
types.push_back(id);
@@ -2154,14 +2154,14 @@ public:
//TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class;
for (int j = 0; j < Constants::NB_BASIC_ABILITIES; j++){
unsigned int found = sabilities.find(Constants::MTGBasicAbilities[j]);
size_t found = sabilities.find(Constants::MTGBasicAbilities[j]);
if (found != string::npos){
abilities.push_back(j);
}
}
for (int j = 0; j < Constants::MTG_NB_COLORS; j++){
unsigned int found = sabilities.find(Constants::MTGColorStrings[j]);
size_t found = sabilities.find(Constants::MTGColorStrings[j]);
if (found != string::npos){
colors.push_back(j);
}
@@ -2169,7 +2169,7 @@ public:
string s = stypes;
while (s.size()){
unsigned int found = s.find(" ");
size_t found = s.find(" ");
if (found != string::npos){
int id = Subtypes::subtypesList->find(s.substr(0,found));
types.push_back(id);