fixed some vc++ compiler warnings
This commit is contained in:
parent
e64cdda6da
commit
b3a9ad5411
|
@ -36,7 +36,7 @@ const string SVN_Rev = string("Rev: ") + string(SVNVERSION);
|
||||||
const string SVN_RawRev = string(SVNVERSION);
|
const string SVN_RawRev = string(SVNVERSION);
|
||||||
const string SVN_Rev = string("Rev: ") + string(SVNVERSION);
|
const string SVN_Rev = string("Rev: ") + string(SVNVERSION);
|
||||||
#else
|
#else
|
||||||
const string SVN_RawRev = "$4761$";
|
const string SVN_RawRev = "$4790$";
|
||||||
const string SVN_Rev = "$Rev$";
|
const string SVN_Rev = "$Rev$";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -5474,7 +5474,7 @@ void Game::render2d() {
|
||||||
int mh= metrics.getMinimapH();
|
int mh= metrics.getMinimapH();
|
||||||
|
|
||||||
if(this->getRenderInGamePerformance() == true) {
|
if(this->getRenderInGamePerformance() == true) {
|
||||||
mh = mh + (gamePerformanceCounts.size() * 14);
|
mh = mh + ((int)gamePerformanceCounts.size() * 14);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Vec4f fontColor=getGui()->getDisplay()->getColor();
|
const Vec4f fontColor=getGui()->getDisplay()->getColor();
|
||||||
|
|
|
@ -351,7 +351,7 @@ bool prev_word_is_ASCII(const string &str_,int end_index) {
|
||||||
return prev_word_is_ASCII(str_,start_index-1);
|
return prev_word_is_ASCII(str_,start_index-1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return isalnum(str_[start_index]);
|
return isalnum(str_[start_index]) != 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -360,7 +360,7 @@ bool prev_word_is_ASCII(const string &str_,int end_index) {
|
||||||
//printf("Line: %d word [%s] length: %d\n",__LINE__,word.c_str(),length);
|
//printf("Line: %d word [%s] length: %d\n",__LINE__,word.c_str(),length);
|
||||||
for(int index = 0; index < word.size(); ++index) {
|
for(int index = 0; index < word.size(); ++index) {
|
||||||
//printf("%c = %d,",word[index],isalnum(word[index]));
|
//printf("%c = %d,",word[index],isalnum(word[index]));
|
||||||
if(isalnum(word[index])) {
|
if(isalnum(word[index]) != 0) {
|
||||||
//printf("Prev %c = %d [%d] [%s],",word[index],isalnum(word[index]),index,(index > 0 ? word.substr(index-1,2).c_str() : "n/a"));
|
//printf("Prev %c = %d [%d] [%s],",word[index],isalnum(word[index]),index,(index > 0 ? word.substr(index-1,2).c_str() : "n/a"));
|
||||||
// if(index > 0 && word.substr(index-1,2) == "\\n") {
|
// if(index > 0 && word.substr(index-1,2) == "\\n") {
|
||||||
// continue;
|
// continue;
|
||||||
|
@ -399,7 +399,7 @@ bool next_word_is_ASCII(const string &str_,int start_index) {
|
||||||
|
|
||||||
}
|
}
|
||||||
if(end_index >= str_.size()) {
|
if(end_index >= str_.size()) {
|
||||||
end_index = str_.size()-1;
|
end_index = (int)str_.size()-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("Line: %d start_index: %d end_index: %d\n",__LINE__,start_index,end_index);
|
//printf("Line: %d start_index: %d end_index: %d\n",__LINE__,start_index,end_index);
|
||||||
|
@ -413,7 +413,7 @@ bool next_word_is_ASCII(const string &str_,int start_index) {
|
||||||
return next_word_is_ASCII(str_,end_index+1);
|
return next_word_is_ASCII(str_,end_index+1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return isalnum(str_[start_index]);
|
return isalnum(str_[start_index]) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -424,7 +424,7 @@ bool next_word_is_ASCII(const string &str_,int start_index) {
|
||||||
int alphaCount = 0;
|
int alphaCount = 0;
|
||||||
for(int index = 0; index < word.size(); ++index) {
|
for(int index = 0; index < word.size(); ++index) {
|
||||||
//printf("%c = %d,",word[index],isalnum(word[index]));
|
//printf("%c = %d,",word[index],isalnum(word[index]));
|
||||||
if(isalnum(word[index])) {
|
if(isalnum(word[index]) != 0) {
|
||||||
//printf("Next %c = %d [%d] [%s],",word[index],isalnum(word[index]),index,(index > 0 ? word.substr(index-1,2).c_str() : "n/a"));
|
//printf("Next %c = %d [%d] [%s],",word[index],isalnum(word[index]),index,(index > 0 ? word.substr(index-1,2).c_str() : "n/a"));
|
||||||
// if(index > 0 && word.substr(index-1,2) == "\\n") {
|
// if(index > 0 && word.substr(index-1,2) == "\\n") {
|
||||||
// continue;
|
// continue;
|
||||||
|
@ -519,7 +519,7 @@ vector<pair<char, int> > Font::extract_mixed_LTR_RTL_map(string &str_) {
|
||||||
ascii_char_map.push_back(make_pair(str_[index],index));
|
ascii_char_map.push_back(make_pair(str_[index],index));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int index = ascii_char_map.size()-1; index >= 0; --index) {
|
for (int index = (int)ascii_char_map.size()-1; index >= 0; --index) {
|
||||||
str_.erase(ascii_char_map[index].second,1);
|
str_.erase(ascii_char_map[index].second,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,7 +631,7 @@ void Font::bidi_cvt(string &str_) {
|
||||||
char *op = NULL;
|
char *op = NULL;
|
||||||
|
|
||||||
//Size to allocate for the char arrays
|
//Size to allocate for the char arrays
|
||||||
int size = str_.size() + 2;
|
int size = (int)str_.size() + 2;
|
||||||
|
|
||||||
//Allocate memory:
|
//Allocate memory:
|
||||||
//It's probably way too much, but at least it's not too little
|
//It's probably way too much, but at least it's not too little
|
||||||
|
@ -660,23 +660,23 @@ void Font::bidi_cvt(string &str_) {
|
||||||
orig_len = len = strlen( ip );
|
orig_len = len = strlen( ip );
|
||||||
|
|
||||||
//Insert ip to logical as unicode (and find it's size now)
|
//Insert ip to logical as unicode (and find it's size now)
|
||||||
len = fribidi_charset_to_unicode (char_set_num, ip, len, logical);
|
len = fribidi_charset_to_unicode (char_set_num, ip, (FriBidiStrIndex)len, logical);
|
||||||
|
|
||||||
base = FRIBIDI_TYPE_ON;
|
base = FRIBIDI_TYPE_ON;
|
||||||
|
|
||||||
//printf("STRIPPED: [%s]\n",str_.c_str());
|
//printf("STRIPPED: [%s]\n",str_.c_str());
|
||||||
|
|
||||||
//Convert logical text to visual
|
//Convert logical text to visual
|
||||||
log2vis = fribidi_log2vis (logical, len, &base, visual, ltov, vtol, NULL);
|
log2vis = fribidi_log2vis (logical, (FriBidiStrIndex)len, &base, visual, ltov, vtol, NULL);
|
||||||
|
|
||||||
//If convertion was successful
|
//If convertion was successful
|
||||||
if(log2vis)
|
if(log2vis)
|
||||||
{
|
{
|
||||||
//Remove bidi marks (that we don't need) from the output text
|
//Remove bidi marks (that we don't need) from the output text
|
||||||
len = fribidi_remove_bidi_marks (visual, len, ltov, vtol, NULL);
|
len = fribidi_remove_bidi_marks (visual, (FriBidiStrIndex)len, ltov, vtol, NULL);
|
||||||
|
|
||||||
//Convert unicode string back to the encoding the input string was in
|
//Convert unicode string back to the encoding the input string was in
|
||||||
fribidi_unicode_to_charset ( char_set_num, visual, len ,op);
|
fribidi_unicode_to_charset ( char_set_num, visual, (FriBidiStrIndex)len ,op);
|
||||||
|
|
||||||
//Insert the output string into the result
|
//Insert the output string into the result
|
||||||
str_ = op;
|
str_ = op;
|
||||||
|
|
|
@ -248,7 +248,7 @@ void TextRenderer2DGl::render(const string &text, float x, float y, bool centere
|
||||||
}
|
}
|
||||||
|
|
||||||
glListBase(font->getHandle());
|
glListBase(font->getHandle());
|
||||||
glCallLists(renderText.length(), GL_UNSIGNED_SHORT, &utext[0]);
|
glCallLists((GLsizei)renderText.length(), GL_UNSIGNED_SHORT, &utext[0]);
|
||||||
|
|
||||||
//std::locale loc("");
|
//std::locale loc("");
|
||||||
//wstring wText = widen(text);
|
//wstring wText = widen(text);
|
||||||
|
@ -664,7 +664,7 @@ void TextRenderer3DGl::internalRender(const string &text, float x, float y, boo
|
||||||
|
|
||||||
string utfText = renderText;
|
string utfText = renderText;
|
||||||
glListBase(font->getHandle());
|
glListBase(font->getHandle());
|
||||||
glCallLists(renderText.length(), GL_UNSIGNED_SHORT, &utext[0]);
|
glCallLists((GLsizei)renderText.length(), GL_UNSIGNED_SHORT, &utext[0]);
|
||||||
|
|
||||||
//std::locale loc("");
|
//std::locale loc("");
|
||||||
//wstring wText = widen(text);
|
//wstring wText = widen(text);
|
||||||
|
|
|
@ -870,7 +870,7 @@ Vec2i LuaArguments::getVec2i(int argumentIndex) const{
|
||||||
//printf("xa = %s argumentIndex = %d\n",lua_tostring(luaState, argumentIndex),argumentIndex);
|
//printf("xa = %s argumentIndex = %d\n",lua_tostring(luaState, argumentIndex),argumentIndex);
|
||||||
|
|
||||||
//v.x= luaL_checkint(luaState, argumentIndex);
|
//v.x= luaL_checkint(luaState, argumentIndex);
|
||||||
v.x= lua_tointeger(luaState, argumentIndex);
|
v.x= (int)lua_tointeger(luaState, argumentIndex);
|
||||||
lua_pop(luaState, 1);
|
lua_pop(luaState, 1);
|
||||||
|
|
||||||
//printf("X = %d\n",v.x);
|
//printf("X = %d\n",v.x);
|
||||||
|
@ -879,7 +879,7 @@ Vec2i LuaArguments::getVec2i(int argumentIndex) const{
|
||||||
//printf("ya = %s\n",lua_tostring(luaState, argumentIndex));
|
//printf("ya = %s\n",lua_tostring(luaState, argumentIndex));
|
||||||
|
|
||||||
//v.y= luaL_checkint(luaState, argumentIndex);
|
//v.y= luaL_checkint(luaState, argumentIndex);
|
||||||
v.y= lua_tointeger(luaState, argumentIndex);
|
v.y= (int)lua_tointeger(luaState, argumentIndex);
|
||||||
lua_pop(luaState, 1);
|
lua_pop(luaState, 1);
|
||||||
|
|
||||||
//printf("Y = %d\n",v.y);
|
//printf("Y = %d\n",v.y);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user