Applied patch for #600 (support 64 bit compilation on windows).

This commit is contained in:
hiker 2014-09-23 14:41:32 +10:00
parent 9ce20435d2
commit ad20635cce
52 changed files with 155 additions and 154 deletions

View File

@ -218,7 +218,7 @@ void AddonsManager::initAddons(const XMLNode *xml)
else
{
m_addons_list.getData().push_back(addon);
index = m_addons_list.getData().size()-1;
index = (int) m_addons_list.getData().size()-1;
}
// Mark that this addon still exists on the server
m_addons_list.getData()[index].setStillExists();
@ -240,7 +240,7 @@ void AddonsManager::initAddons(const XMLNode *xml)
// an addon that's still on the server and an invalid entry in the
// addons installed file), it will be re-downloaded later.
m_addons_list.lock();
unsigned int count = m_addons_list.getData().size();
unsigned int count = (unsigned int) m_addons_list.getData().size();
for(unsigned int i=0; i<count;)
{

View File

@ -81,7 +81,7 @@ public:
void setErrorState() { m_state.setAtomic(STATE_ERROR); }
// ------------------------------------------------------------------------
/** Returns the list of addons (installed and uninstalled). */
unsigned int getNumAddons() const { return m_addons_list.getData().size();}
unsigned int getNumAddons() const { return (unsigned int) m_addons_list.getData().size();}
// ------------------------------------------------------------------------
/** Returns the i-th addons. */
const Addon& getAddon(unsigned int i) { return m_addons_list.getData()[i];}

View File

@ -124,7 +124,7 @@ SFXManager::~SFXManager()
pthread_cond_destroy(&m_cond_request);
// ---- clear m_all_sfx
const int sfx_amount = m_all_sfx.size();
const int sfx_amount = (int) m_all_sfx.size();
for (int n=0; n<sfx_amount; n++)
{
delete m_all_sfx[n];
@ -249,7 +249,7 @@ void SFXManager::soundToggled(const bool on)
resumeAll();
const int sfx_amount = m_all_sfx.size();
const int sfx_amount = (int)m_all_sfx.size();
for (int n=0; n<sfx_amount; n++)
{
m_all_sfx[n]->onSoundEnabledBack();

View File

@ -31,7 +31,6 @@ static PtrVector<UserConfigParam, REF> all_params;
#define PARAM_DEFAULT(X) = X
#include "config/user_config.hpp"
#include "config/player_profile.hpp"
#include "config/saved_grand_prix.hpp"
#include "config/stk_config.hpp"
#include "guiengine/engine.hpp"
@ -91,7 +90,7 @@ GroupUserConfigParam::GroupUserConfigParam(const char* group_name,
// ----------------------------------------------------------------------------
void GroupUserConfigParam::write(std::ofstream& stream) const
{
const int attr_amount = m_attributes.size();
const int attr_amount = (int)m_attributes.size();
// comments
if(m_comment.size() > 0) stream << " <!-- " << m_comment.c_str();
@ -110,7 +109,7 @@ void GroupUserConfigParam::write(std::ofstream& stream) const
m_attributes[n]->writeInner(stream, 1);
}
stream << " >\n";
const int children_amount = m_children.size();
const int children_amount = (int)m_children.size();
for (int n=0; n<children_amount; n++)
{
m_children[n]->writeInner(stream, 1);

View File

@ -100,7 +100,7 @@ int LODNode::getLevel()
* camera is activated, since it zooms in to the kart. */
void LODNode::forceLevelOfDetail(int n)
{
m_forced_lod = (n >=(int)m_detail.size()) ? m_detail.size()-1 : n;
m_forced_lod = (n >=(int)m_detail.size()) ? (int)m_detail.size()-1 : n;
} // forceLevelOfDetail
// ----------------------------------------------------------------------------

View File

@ -605,7 +605,7 @@ void Material::initParticlesEffect(const XMLNode *node)
std::vector<std::string> conditions;
node->get("condition", &conditions);
const int count = conditions.size();
const int count = (int)conditions.size();
if (count == 0)
{

View File

@ -337,7 +337,7 @@ Material *MaterialManager::getMaterial(const std::string& fname,
*/
void MaterialManager::makeMaterialsPermanent()
{
m_shared_material_index = m_materials.size();
m_shared_material_index = (int) m_materials.size();
} // makeMaterialsPermanent
// ----------------------------------------------------------------------------

View File

@ -64,7 +64,7 @@ Stars::Stars(scene::ISceneNode* parentKart, core::vector3df center)
Stars::~Stars()
{
const int nodeAmount = m_nodes.size();
const int nodeAmount = (int) m_nodes.size();
for (int n=0; n<nodeAmount; n++)
{
m_parent_kart_node->removeChild(m_nodes[n]);
@ -79,8 +79,8 @@ void Stars::showFor(float time)
m_remaining_time = time;
m_fade_in_time = 1.0f;
const int nodeAmount = m_nodes.size();
for (int n=0; n<nodeAmount; n++)
const int node_amount = (int)m_nodes.size();
for (int n=0; n<node_amount; n++)
{
m_nodes[n]->setVisible(true);
((scene::IBillboardSceneNode*)m_nodes[n])
@ -111,16 +111,16 @@ void Stars::update(float delta_t)
{
m_enabled = false;
const int nodeAmount = m_nodes.size();
for (int n=0; n<nodeAmount; n++)
const int node_amount = (int)m_nodes.size();
for (int n=0; n<node_amount; n++)
{
m_nodes[n]->setVisible(false);
}
return;
}
const int nodeAmount = m_nodes.size();
for (int n=0; n<nodeAmount; n++)
const int node_amount = (int)m_nodes.size();
for (int n=0; n<node_amount; n++)
{
// do one full rotation every 4 seconds (this "ranges" ranges
// from 0 to 1)

View File

@ -737,7 +737,7 @@ namespace GUIEngine
void showMessage(const wchar_t* message, const float time)
{
// check for duplicates
const int count = gui_messages.size();
const int count = (int) gui_messages.size();
for (int n=0; n<count; n++)
{
if (gui_messages[n].m_message == message) return;
@ -1330,7 +1330,7 @@ namespace GUIEngine
SColor(255,255,255,255),
true/* center h */, false /* center v */ );
const int icon_count = g_loading_icons.size();
const int icon_count = (int)g_loading_icons.size();
const int icon_size = (int)(screen_w / 16.0f);
const int ICON_MARGIN = 6;
int x = ICON_MARGIN;

View File

@ -221,7 +221,7 @@ void DynamicRibbonWidget::add()
if (item_count < 1)
{
item_count = m_items.size();
item_count = (int) m_items.size();
}
if (item_count < 1)
@ -327,7 +327,7 @@ void DynamicRibbonWidget::buildInternalStructure()
m_col_amount = (int)roundf( m_w / ( m_child_width*ratio_zoom ) );
// ajust column amount to not add more item slots than we actually need
const int item_count = m_items.size();
const int item_count = (int) m_items.size();
//std::cout << "item_count=" << item_count << ", row_amount*m_col_amount=" << m_row_amount*m_col_amount << std::endl;
if (m_row_amount*m_col_amount > item_count)
{
@ -647,7 +647,7 @@ EventPropagation DynamicRibbonWidget::transmitEvent(Widget* w,
if (selected_ribbon != NULL)
{
m_selected_item[playerID] = selected_ribbon->m_selection[playerID] + m_scroll_offset;
if (m_selected_item[playerID] >= (int)m_items.size()) m_selected_item[playerID] -= m_items.size();
if (m_selected_item[playerID] >= (int)m_items.size()) m_selected_item[playerID] -= (int)m_items.size();
}
}
@ -755,7 +755,7 @@ void DynamicRibbonWidget::scroll(const int x_delta)
{
RibbonWidget* ribbon = m_rows.get(0); // there is a single row when we can select items
int id = m_selected_item[n] - m_scroll_offset;
if (id < 0) id += m_items.size();
if (id < 0) id += (int) m_items.size();
ribbon->setSelection(id, n);
}
}
@ -791,7 +791,7 @@ void DynamicRibbonWidget::propagateSelection()
if (m_combo)
{
m_selected_item[p] = relative_selection + m_scroll_offset;
if (m_selected_item[p] >= (int)m_items.size()) m_selected_item[p] -= m_items.size();
if (m_selected_item[p] >= (int)m_items.size()) m_selected_item[p] -= (int)m_items.size();
}
// set same selection in all ribbons
@ -819,7 +819,7 @@ void DynamicRibbonWidget::updateLabel(RibbonWidget* from_this_ribbon)
std::string selection_id = row->getSelectionIDString(playerID);
const int amount = m_items.size();
const int amount = (int)m_items.size();
for (int n=0; n<amount; n++)
{
if (m_items[n].m_code_name == selection_id)
@ -844,14 +844,14 @@ void DynamicRibbonWidget::updateItemDisplay()
if ((int)m_items.size() != m_previous_item_count)
{
buildInternalStructure();
m_previous_item_count = m_items.size();
m_previous_item_count = (int)m_items.size();
}
// ---- some variables
int icon_id = 0;
const int row_amount = m_rows.size();
const int item_amount = m_items.size();
const int row_amount = (int)m_rows.size();
const int item_amount = (int)m_items.size();
//FIXME: isn't this set by 'buildInternalStructure' already?
m_needed_cols = (int)ceil( (float)item_amount / (float)row_amount );
@ -860,7 +860,8 @@ void DynamicRibbonWidget::updateItemDisplay()
// the number of items that fit perfectly the number of rows we have
// (this value will be useful to compute scrolling)
int fitting_item_amount = (m_scrolling_enabled ? m_needed_cols * row_amount : m_items.size());
int fitting_item_amount = (m_scrolling_enabled ? m_needed_cols * row_amount
: (int)m_items.size());
// ---- to determine which items go in which cell of the dynamic ribbon now,
// we create a temporary 2D table and fill them with the ID of the item
@ -980,7 +981,7 @@ void DynamicRibbonWidget::update(float dt)
{
int col_scroll = i + m_scroll_offset;
int item_id = (col_scroll)*row_amount + n;
if (item_id >= (int)m_items.size()) item_id -= m_items.size();
if (item_id >= (int)m_items.size()) item_id -= (int)m_items.size();
assert(item_id >= 0);
assert(item_id < (int)m_items.size());
@ -1097,7 +1098,7 @@ bool DynamicRibbonWidget::setSelection(const std::string &item_codename,
{
if (m_deactivated && !evenIfDeactivated) return false;
const int item_count = m_items.size();
const int item_count = (int)m_items.size();
for (int n=0; n<item_count; n++)
{
if (m_items[n].m_code_name == item_codename)

View File

@ -404,7 +404,7 @@ int XMLNode::get(const std::string &attribute,
if(!get(attribute, &s)) return 0;
*value = StringUtils::split(s,' ');
return value->size();
return (int) value->size();
} // get(vector<string>)
// ----------------------------------------------------------------------------
@ -423,7 +423,7 @@ int XMLNode::get(const std::string &attribute,
std::vector<std::string> v = StringUtils::split(s,' ');
value->clear();
const unsigned int count = v.size();
const unsigned int count = (unsigned int)v.size();
for (unsigned int i=0; i<count; i++)
{
float curr;
@ -436,7 +436,7 @@ int XMLNode::get(const std::string &attribute,
value->push_back(curr);
}
return value->size();
return (int) value->size();
} // get(vector<float>)
// ----------------------------------------------------------------------------
@ -454,7 +454,7 @@ int XMLNode::get(const std::string &attribute, std::vector<int> *value) const
std::vector<std::string> v = StringUtils::split(s,' ');
value->clear();
const unsigned int count = v.size();
const unsigned int count = (unsigned int)v.size();
for (unsigned int i=0; i<count; i++)
{
int val;
@ -467,7 +467,7 @@ int XMLNode::get(const std::string &attribute, std::vector<int> *value) const
value->push_back(val);
}
return value->size();
return (int) value->size();
} // get(vector<int>)
// ----------------------------------------------------------------------------
@ -529,7 +529,6 @@ int XMLNode::get(core::vector3df *value) const
{
float f;
int bits=0;
core::vector3df result = *value;
if(get("x", &f)) { value->X = f; bits |= 1; }
if(get("h", &f)) { value->X = f; bits |= 1; }
if(get("y", &f)) { value->Y = f; bits |= 2; }
@ -551,7 +550,6 @@ int XMLNode::getXYZ(core::vector3df *value) const
{
float f;
int bits=0;
core::vector3df result = *value;
if(get("x", &f)) { value->X = f; bits |= 1; }
if(get("y", &f)) { value->Y = f; bits |= 2; }
if(get("z", &f)) { value->Z = f; bits |= 4; }
@ -570,7 +568,6 @@ int XMLNode::getXYZ(Vec3 *value) const
{
float f;
int bits=0;
Vec3 result = *value;
if(get("x", &f)) { value->setX(f); bits |= 1; }
if(get("y", &f)) { value->setY(f); bits |= 2; }
if(get("z", &f)) { value->setZ(f); bits |= 4; }
@ -589,7 +586,6 @@ int XMLNode::getHPR(core::vector3df *value) const
{
float f;
int bits=0;
core::vector3df result = *value;
if(get("h", &f)) { value->X = f; bits |= 1; }
if(get("p", &f)) { value->Y = f; bits |= 2; }
if(get("r", &f)) { value->Z = f; bits |= 4; }
@ -608,7 +604,6 @@ int XMLNode::getHPR(Vec3 *value) const
{
float f;
int bits=0;
Vec3 result = *value;
if(get("h", &f)) { value->setX(f); bits |= 1; }
if(get("p", &f)) { value->setY(f); bits |= 2; }
if(get("r", &f)) { value->setZ(f); bits |= 4; }

View File

@ -70,7 +70,7 @@ public:
const XMLNode *getNode(const std::string &name) const;
const void getNodes(const std::string &s, std::vector<XMLNode*>& out) const;
const XMLNode *getNode(unsigned int i) const;
unsigned int getNumNodes() const {return m_nodes.size(); }
unsigned int getNumNodes() const {return (unsigned int) m_nodes.size(); }
int get(const std::string &attribute, std::string *value) const;
int get(const std::string &attribute, core::stringw *value) const;
int get(const std::string &attribute, int32_t *value) const;

View File

@ -207,9 +207,9 @@ void ItemManager::insertItem(Item *item)
// Find where the item can be stored in the index list: either in a
// previously deleted entry, otherwise at the end.
int index = -1;
for(index=m_all_items.size()-1; index>=0 && m_all_items[index]; index--) {}
for(index=(int)m_all_items.size()-1; index>=0 && m_all_items[index]; index--) {}
if(index==-1) index = m_all_items.size();
if(index==-1) index = (int)m_all_items.size();
if(index<(int)m_all_items.size())
m_all_items[index] = item;
@ -422,7 +422,7 @@ void ItemManager::deleteItem(Item *item)
int sector = QuadGraph::UNKNOWN_SECTOR;
QuadGraph::get()->findRoadSector(xyz, &sector);
unsigned int indx = sector==QuadGraph::UNKNOWN_SECTOR
? m_items_in_quads->size()-1
? (unsigned int) m_items_in_quads->size()-1
: sector;
AllItemTypes &items = (*m_items_in_quads)[indx];
AllItemTypes::iterator it = std::find(items.begin(), items.end(),item);

View File

@ -111,7 +111,7 @@ public:
void switchItems ();
// ------------------------------------------------------------------------
/** Returns the number of items. */
unsigned int getNumberOfItems() const { return m_all_items.size(); }
unsigned int getNumberOfItems() const { return (unsigned int) m_all_items.size(); }
// ------------------------------------------------------------------------
/** Returns a pointer to the n-th item. */
const Item* getItem(unsigned int n) const { return m_all_items[n]; };

View File

@ -1118,7 +1118,7 @@ void SkiddingAI::evaluateItems(const Item *item, float kart_aim_angle,
// This list is usually very short, so use a simple bubble sort
list->push_back(item);
int i;
for(i=list->size()-2; i>=0; i--)
for(i=(int)list->size()-2; i>=0; i--)
{
float d = ((*list)[i]->getXYZ() - m_kart->getXYZ()).length2_2d();
if(d<=new_distance)

View File

@ -99,7 +99,7 @@ public:
void removeLastSelectedKart() { m_selected_karts.pop_back(); }
// ------------------------------------------------------------------------
/** Returns the number of selected karts (used in networking only). */
int getNumSelectedKarts() const { return m_selected_karts.size(); }
int getNumSelectedKarts() const { return (int) m_selected_karts.size(); }
// ------------------------------------------------------------------------
/** Sets a kartid to be selected (used in networking only). */
void selectKart(int kartid) { m_selected_karts.push_back(kartid); }

View File

@ -468,6 +468,6 @@ unsigned int Skidding::getSkidBonus(float *bonus_time,
*bonus_time = m_skid_bonus_time[i];
*bonus_force = m_skid_bonus_force[i];
}
return m_skid_bonus_speed.size();
return (unsigned int) m_skid_bonus_speed.size();
} // getSkidBonusForce

View File

@ -151,7 +151,7 @@ public:
float getSkidReduceTurnMax () const { return m_skid_reduce_turn_max; }
// ------------------------------------------------------------------------
/** Returns how many boni are defined for this kart. */
int getNumberOfBonusTimes() const { return m_skid_bonus_time.size(); }
int getNumberOfBonusTimes() const { return (int) m_skid_bonus_time.size(); }
// ------------------------------------------------------------------------
/** Returns how long a kart must skid in order to reach the specified
* bonus level.

View File

@ -770,7 +770,7 @@ int handleCmdLine()
const std::vector<std::string> l=StringUtils::split(std::string(s),',');
race_manager->setDefaultAIKartList(l);
// Add 1 for the player kart
race_manager->setNumKarts(l.size()+1);
race_manager->setNumKarts((int)l.size()+1);
} // --ai
if(CommandLine::has( "--mode", &s))

View File

@ -87,7 +87,7 @@ void LinearWorld::reset()
m_last_lap_sfx_played = false;
m_last_lap_sfx_playing = false;
const unsigned int kart_amount = m_karts.size();
const unsigned int kart_amount = (unsigned int) m_karts.size();
for(unsigned int i=0; i<kart_amount; i++)
{
m_kart_info[i].reset();
@ -650,7 +650,7 @@ void LinearWorld::updateRacePosition()
{
// Mostly for debugging:
beginSetKartPositions();
const unsigned int kart_amount = m_karts.size();
const unsigned int kart_amount = (unsigned int) m_karts.size();
#ifdef DEBUG
bool rank_changed = false;

View File

@ -120,7 +120,7 @@ void OverWorld::update(float dt)
}
WorldWithRank::update(dt);
WorldWithRank::updateTrack(dt);
const unsigned int kart_amount = m_karts.size();
const unsigned int kart_amount = (unsigned int)m_karts.size();
// isn't it cool, on the overworld nitro is free!
for(unsigned int n=0; n<kart_amount; n++)

View File

@ -263,7 +263,7 @@ void ProfileWorld::enterRaceOverState()
for(std::set<std::string>::iterator it = all_groups.begin();
it !=all_groups.end(); it++)
{
if(it->size()>max_len) max_len = it->size();
if(it->size()>max_len) max_len = (unsigned int) it->size();
}
max_len++; // increase by 1 for one additional space after the name
@ -281,7 +281,7 @@ void ProfileWorld::enterRaceOverState()
int expl_count = 0, off_track_count = 0;
float skidding_time = 0.0f, rescue_time = 0.0f, expl_time = 0.0f;
float av_time = 0.0f;
for ( unsigned int i = 0; i < m_karts.size(); ++i)
for ( unsigned int i = 0; i < (unsigned int)m_karts.size(); ++i)
{
KartWithStats* kart = dynamic_cast<KartWithStats*>(m_karts[i]);
const std::string &name=kart->getController()->getControllerName();

View File

@ -87,7 +87,7 @@ const std::string& StandardRace::getIdent() const
*/
void StandardRace::endRaceEarly()
{
const unsigned int kart_amount = m_karts.size();
const unsigned int kart_amount = (unsigned int)m_karts.size();
std::vector<int> active_players;
// Required for debugging purposes
beginSetKartPositions();
@ -110,7 +110,7 @@ void StandardRace::endRaceEarly()
else
{
// AI karts finish
setKartPosition(kartid, i - active_players.size());
setKartPosition(kartid, i - (unsigned int) active_players.size());
kart->finishedRace(estimateFinishTimeForKart(kart));
}
} // i <= kart_amount
@ -118,7 +118,7 @@ void StandardRace::endRaceEarly()
for (unsigned int i = 0; i < active_players.size(); i++)
{
int kartid = active_players[i];
int position = getNumKarts() - active_players.size() + 1 + i;
int position = getNumKarts() - (int) active_players.size() + 1 + i;
setKartPosition(kartid, position);
m_karts[kartid]->eliminate();
} // Finish the active players

View File

@ -569,7 +569,7 @@ void World::resetAllKarts()
if(UserConfigParams::m_track_debug)
{
// Loop over all karts, in case that some karts are dfferent
for(unsigned int kart_id=0; kart_id<m_karts.size(); kart_id++)
for(unsigned int kart_id=0; kart_id<(unsigned int)m_karts.size(); kart_id++)
{
for(unsigned int rescue_pos=0;
rescue_pos<getNumberOfRescuePositions();
@ -1020,7 +1020,7 @@ void World::updateHighscores(int* best_highscore_rank, int* best_finish_time,
// if we ever decide to display a message (e.g. during a race)
unsigned int *index = new unsigned int[m_karts.size()];
const unsigned int kart_amount = m_karts.size();
const unsigned int kart_amount = (unsigned int) m_karts.size();
for (unsigned int i=0; i<kart_amount; i++ )
{
index[i] = 999; // first reset the contents of the array

View File

@ -290,7 +290,7 @@ public:
RaceGUIBase *getRaceGUI() const { return m_race_gui;}
// ------------------------------------------------------------------------
/** Returns the number of karts in the race. */
unsigned int getNumKarts() const { return m_karts.size(); }
unsigned int getNumKarts() const { return (unsigned int) m_karts.size(); }
// ------------------------------------------------------------------------
/** Returns the kart with a given world id. */
AbstractKart *getKart(int kartId) const {

View File

@ -75,11 +75,13 @@ void* btKartRaycaster::castRay(const btVector3& from, const btVector3& to,
if(m_smooth_normals &&
rayCallback.getTriangleIndex()>-1)
{
#undef DEBUG_NORMALS
#ifdef DEBUG_NORMALS
btVector3 n=result.m_hitNormalInWorld;
#endif
result.m_hitNormalInWorld =
tm.getInterpolatedNormal(rayCallback.getTriangleIndex(),
result.m_hitPointInWorld);
#undef DEBUG_NORMALS
#ifdef DEBUG_NORMALS
printf("old %f %f %f new %f %f %f\n",
n.getX(), n.getY(), n.getZ(),

View File

@ -51,9 +51,7 @@ public:
GrandPrixManager();
~GrandPrixManager();
void reload();
GrandPrixData* getGrandPrix(const int i) const { return m_gp_data[i]; }
GrandPrixData* getGrandPrix(const std::string& s) const;
unsigned int getNumberOfGrandPrix() const { return m_gp_data.size(); }
bool existsName(const irr::core::stringw& name) const;
void checkConsistency();
@ -63,6 +61,13 @@ public:
GrandPrixData* copy(const std::string& id,
const irr::core::stringw& newName);
void remove(const std::string& id);
// ------------------------------------------------------------------------
/** Returns a pointer to the data for the specified GP.
* \param i Index of the GP. */
GrandPrixData* getGrandPrix(const int i) const { return m_gp_data[i]; }
// ------------------------------------------------------------------------
/** Returns the number of GPs. */
unsigned int getNumberOfGrandPrix() const { return (int)m_gp_data.size(); }
}; // GrandPrixManager
extern GrandPrixManager *grand_prix_manager;

View File

@ -181,7 +181,7 @@ const AbstractKart *RaceManager::getKartWithGPRank(unsigned int n)
*/
int RaceManager::getLocalPlayerGPRank(const int player_id) const
{
const int amount = m_kart_status.size();
const int amount = (int)m_kart_status.size();
for (int n=0; n<amount; n++)
{
if (m_kart_status[n].m_local_player_id == player_id)
@ -238,7 +238,7 @@ void RaceManager::setTrack(const std::string& track)
*/
void RaceManager::computeRandomKartList()
{
int n = m_num_karts - m_player_karts.size();
int n = m_num_karts - (int)m_player_karts.size();
if(UserConfigParams::logMisc())
std::cout << "AI karts count = " << n << " for m_num_karts="
<< m_num_karts << " and m_player_karts.size()="
@ -309,7 +309,7 @@ void RaceManager::startNew(bool from_overworld)
race_manager->getMinorMode()==RaceManager::MINOR_MODE_FOLLOW_LEADER
? -1
: 0;
const unsigned int ai_kart_count = m_ai_kart_list.size();
const unsigned int ai_kart_count = (unsigned int) m_ai_kart_list.size();
for(unsigned int i=0; i<ai_kart_count; i++)
{
m_kart_status.push_back(KartStatus(m_ai_kart_list[i], i, -1, -1,
@ -324,7 +324,7 @@ void RaceManager::startNew(bool from_overworld)
// Then the players, which start behind the AI karts
// -------------------------------------------------
for(unsigned int i=0; i<m_player_karts.size(); i++)
for(unsigned int i=0; i<(int)m_player_karts.size(); i++)
{
KartType kt= m_player_karts[i].isNetworkPlayer() ? KT_NETWORK_PLAYER : KT_PLAYER;
m_kart_status.push_back(KartStatus(m_player_karts[i].getKartName(), i,
@ -408,7 +408,7 @@ void RaceManager::startNextRace()
// the end because of the simple reason that they
// are at the end when getting added. Keep them out
// of the later sorting and they will stay there.
player_last_offset = m_player_karts.size();
player_last_offset = (int)m_player_karts.size();
}
std::sort(m_kart_status.begin()+offset,
@ -645,13 +645,13 @@ void RaceManager::exitRace(bool delete_world)
StateManager::get()->resetAndGoToScreen( MainMenuScreen::getInstance() );
bool someHumanPlayerWon = false;
const unsigned int kartStatusCount = m_kart_status.size();
const unsigned int kart_status_count = (unsigned int)m_kart_status.size();
const int loserThreshold = 3;
std::string winners[3];
std::vector<std::string> humanLosers; // because we don't care about AIs that lost
for (unsigned int i=0; i < kartStatusCount; ++i)
for (unsigned int i=0; i < kart_status_count; ++i)
{
if(UserConfigParams::logMisc())
{

View File

@ -476,7 +476,7 @@ public:
// ------------------------------------------------------------------------
unsigned int getNumLocalPlayers() const
{
return m_local_player_karts.size();
return (unsigned int)m_local_player_karts.size();
}
// ------------------------------------------------------------------------
/** Returns the selected number of karts (selected number of players and
@ -488,7 +488,7 @@ public:
// ------------------------------------------------------------------------
MinorRaceModeType getMinorMode() const { return m_minor_mode; }
// ------------------------------------------------------------------------
unsigned int getNumPlayers() const { return m_player_karts.size(); }
unsigned int getNumPlayers() const { return (unsigned int) m_player_karts.size(); }
// ------------------------------------------------------------------------
/** \brief Returns the number lf laps.
* In case of FTL or battle mode always return 9999, since they don't

View File

@ -67,7 +67,7 @@ void ArenasScreen::beforeAddingWidget()
bool soccer_mode = race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER;
const std::vector<std::string>& groups = track_manager->getAllArenaGroups(soccer_mode);
const int group_amount = groups.size();
const int group_amount = (int)groups.size();
if (group_amount > 1)
{
@ -161,7 +161,7 @@ void ArenasScreen::eventCallback(Widget* widget, const std::string& name, const
}
RandomGenerator random;
const int randomID = random.get(curr_group.size());
const int randomID = random.get((int)curr_group.size());
Track* clicked_track = track_manager->getTrack( curr_group[randomID] );
if (clicked_track != NULL)
@ -218,9 +218,9 @@ void ArenasScreen::buildTrackList()
if (curr_group_name == ALL_ARENA_GROUPS_ID)
{
const int trackAmount = track_manager->getNumberOfTracks();
const int track_amount = (int)track_manager->getNumberOfTracks();
for (int n=0; n<trackAmount; n++)
for (int n=0; n<track_amount; n++)
{
Track* curr = track_manager->getTrack(n);
if (soccer_mode)
@ -248,9 +248,9 @@ void ArenasScreen::buildTrackList()
else
{
const std::vector<int>& currArenas = track_manager->getArenasInGroup(curr_group_name, soccer_mode);
const int trackAmount = currArenas.size();
const int track_amount = (int)currArenas.size();
for (int n=0; n<trackAmount; n++)
for (int n=0; n<track_amount; n++)
{
Track* curr = track_manager->getTrack(currArenas[n]);
if (soccer_mode)

View File

@ -350,7 +350,7 @@ void CreditsScreen::onUpdate(float elapsed_time)
color, false /* center h */, true /* center v */, NULL,
true /* ignore RTL */ );
const int subamount = m_sections[m_curr_section]
const int subamount = (int)m_sections[m_curr_section]
.m_entries[m_curr_element].m_subentries.size();
int suby = m_y + m_h/3;
const int inc = subamount == 0 ? m_h/8

View File

@ -173,7 +173,7 @@ void EditTrackScreen::init()
// -----------------------------------------------------------------------------
void EditTrackScreen::loadTrackList()
{
bool belongsToGroup;
bool belongs_to_group;
DynamicRibbonWidget* tracks_widget = getWidget<DynamicRibbonWidget>("tracks");
assert(tracks_widget != NULL);
@ -183,12 +183,11 @@ void EditTrackScreen::loadTrackList()
for (unsigned int i = 0; i < track_manager->getNumberOfTracks(); i++)
{
Track* t = track_manager->getTrack(i);
const std::vector<std::string>& groups = t->getGroups();
belongsToGroup = (m_track_group.empty() ||
belongs_to_group = (m_track_group.empty() ||
m_track_group == ALL_TRACKS_GROUP_ID ||
t->isInGroup(m_track_group) );
if (!t->isArena() && !t->isSoccer() &&
!t->isInternal() && belongsToGroup )
!t->isInternal() && belongs_to_group )
{
tracks_widget->addItem(translations->fribidize(t->getName()),
t->getIdent(),

View File

@ -429,12 +429,12 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
if (!m_unlocked_stuff[n].m_pictures.empty())
{
const int pictureCount = m_unlocked_stuff[n].m_pictures.size();
const int picture_count = (int)m_unlocked_stuff[n].m_pictures.size();
if (pictureCount > 1)
if (picture_count > 1)
{
const int previousTextureID = m_unlocked_stuff[n].m_curr_image;
const int textureID = int(m_global_time/1.2f) % pictureCount;
const int textureID = int(m_global_time/1.2f) % picture_count;
if (textureID != previousTextureID)
{
@ -467,7 +467,7 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
m_unlocked_stuff[n].m_curr_image = textureID;
} // textureID != previousTextureID
} // if pictureCount>1
} // if picture_count>1
} // if !m_unlocked_stuff[n].m_pictures.empty()
float scale = m_unlocked_stuff[n].m_scale;
@ -538,16 +538,16 @@ void FeatureUnlockedCutScene::addUnlockedGP(const GrandPrixData* gp)
else
{
const std::vector<std::string> gptracks = gp->getTrackNames();
const int trackAmount = gptracks.size();
const int track_amount = (int)gptracks.size();
if (trackAmount == 0)
if (track_amount == 0)
{
std::cerr << "ERROR: Unlocked GP is empty???\n";
video::ITexture* WTF_image = irr_driver->getTexture( file_manager->getAsset(FileManager::GUI,"main_help.png"));
images.push_back(WTF_image);
}
for (int t=0; t<trackAmount; t++)
for (int t=0; t<track_amount; t++)
{
Track* track = track_manager->getTrack(gptracks[t]);

View File

@ -228,7 +228,7 @@ void GPInfoScreen::addTracks()
ListWidget *list = getWidget<ListWidget>("tracks");
list->clear();
for (unsigned int i = 0; i < tracks.size(); i++)
for (unsigned int i = 0; i < (unsigned int)tracks.size(); i++)
{
const Track *track = track_manager->getTrack(tracks[i]);
std::string s = StringUtils::toString(i);

View File

@ -185,7 +185,7 @@ void GrandPrixLose::setKarts(std::vector<std::string> ident_arg)
m_kart_y = KART_Y;
m_kart_z = KART_Z;
const int count = ident_arg.size();
const int count = (int)ident_arg.size();
for (int n=0; n<count; n++)
{
const KartProperties* kart = kart_properties_manager->getKart(ident_arg[n]);

View File

@ -964,7 +964,7 @@ void KartSelectionScreen::beforeAddingWidget()
const std::vector<std::string>& groups =
kart_properties_manager->getAllGroups();
const int group_amount = groups.size();
const int group_amount = (int)groups.size();
// add all group first
if (group_amount > 1)
@ -1446,8 +1446,8 @@ void KartSelectionScreen::playerConfirm(const int playerID)
// Check if we have enough karts for everybody. If there are more players
// than karts then just allow duplicates
const int availableKartCount = w->getItems().size();
const bool willNeedDuplicates = (amount > availableKartCount);
const int available_kart_count = (int) w->getItems().size();
const bool will_need_duplicates = (amount > available_kart_count);
// make sure no other player selected the same identity or kart
for (int n=0; n<amount; n++)
@ -1464,7 +1464,7 @@ void KartSelectionScreen::playerConfirm(const int playerID)
m_kart_widgets[playerID]);
if (player_ready && (ident_conflict || kart_conflict) &&
!willNeedDuplicates)
!will_need_duplicates)
{
if (UserConfigParams::logGUI())
Log::warn("[KartSelectionScreen]", "You can't select this identity "
@ -1667,7 +1667,7 @@ void KartSelectionScreen::eventCallback(Widget* widget,
" lost their selection when switching tabs!!!",n);
// Select a random kart in this case
const int count = w->getItems().size();
const int count = (int) w->getItems().size();
if (count > 0)
{
// FIXME: two players may be given the same kart by
@ -1808,7 +1808,7 @@ void KartSelectionScreen::allPlayersDone()
std::vector<ItemDescription> items = w->getItems();
// remove the 'random' item itself
const int item_count = items.size();
const int item_count = (int) items.size();
for (int n=0; n<item_count; n++)
{
if (items[n].m_code_name == RANDOM_KART_ID)

View File

@ -92,15 +92,15 @@ void OptionsScreenUI::loadedFromFile()
return;
}
const int skinCount = m_skins.size();
for (int n=0; n<skinCount; n++)
const int skin_count = (int)m_skins.size();
for (int n=0; n<skin_count; n++)
{
const std::string skinFileName = StringUtils::getBasename(m_skins[n]);
const std::string skinName = StringUtils::removeExtension( skinFileName );
skinSelector->addLabel( core::stringw(skinName.c_str()) );
}
skinSelector->m_properties[GUIEngine::PROP_MIN_VALUE] = "0";
skinSelector->m_properties[GUIEngine::PROP_MAX_VALUE] = StringUtils::toString(skinCount-1);
skinSelector->m_properties[GUIEngine::PROP_MAX_VALUE] = StringUtils::toString(skin_count-1);
} // loadedFromFile
@ -137,7 +137,7 @@ void OptionsScreenUI::init()
// --- select the right skin in the spinner
bool currSkinFound = false;
const int skinCount = m_skins.size();
const int skinCount = (int) m_skins.size();
for (int n=0; n<skinCount; n++)
{
const std::string skinFileName = StringUtils::getBasename(m_skins[n]);
@ -164,7 +164,7 @@ void OptionsScreenUI::init()
list_widget->addItem("system", _("System Language"));
const std::vector<std::string>* lang_list = translations->getLanguageList();
const int amount = lang_list->size();
const int amount = (int)lang_list->size();
// The names need to be sorted alphabetically. Store the 2-letter
// language names in a mapping, to be able to get them from the

View File

@ -175,7 +175,7 @@ void OptionsScreenVideo::init()
const std::vector<IrrDriver::VideoMode>& modes =
irr_driver->getVideoModes();
const int amount = modes.size();
const int amount = (int)modes.size();
bool found_config_res = false;

View File

@ -158,7 +158,7 @@ void RaceResultGUI::enableAllButtons()
// If something was unlocked
// -------------------------
int n = PlayerManager::getCurrentPlayer()->getRecentlyCompletedChallenges().size();
int n = (int)PlayerManager::getCurrentPlayer()->getRecentlyCompletedChallenges().size();
if(n>0)
{
top->setText(n==1 ? _("You completed a challenge!")
@ -227,7 +227,7 @@ void RaceResultGUI::eventCallback(GUIEngine::Widget* widget,
// If something was unlocked, the 'continue' button was
// actually used to display "Show unlocked feature(s)" text.
// ---------------------------------------------------------
int n = PlayerManager::getCurrentPlayer()
int n = (int)PlayerManager::getCurrentPlayer()
->getRecentlyCompletedChallenges().size();
if(n>0)
{
@ -627,7 +627,7 @@ void RaceResultGUI::renderGlobal(float dt)
m_timer += dt;
assert(World::getWorld()->getPhase()==WorldStatus::RESULT_DISPLAY_PHASE);
unsigned int num_karts = m_all_row_infos.size();
unsigned int num_karts = (unsigned int)m_all_row_infos.size();
// First: Update the finite state machine
// ======================================

View File

@ -141,7 +141,7 @@ void TracksScreen::beforeAddingWidget()
tabs->clearAllChildren();
const std::vector<std::string>& groups = track_manager->getAllTrackGroups();
const int group_amount = groups.size();
const int group_amount = (int)groups.size();
if (group_amount > 1)
{
@ -161,7 +161,7 @@ void TracksScreen::beforeAddingWidget()
tabs->addTextChild( _(groups[n].c_str()), groups[n] );
DynamicRibbonWidget* tracks_widget = getWidget<DynamicRibbonWidget>("tracks");
tracks_widget->setItemCountHint( track_manager->getNumberOfTracks()+1 );
tracks_widget->setItemCountHint( (int)track_manager->getNumberOfTracks()+1 );
} // beforeAddingWidget
// -----------------------------------------------------------------------------
@ -256,7 +256,7 @@ void TracksScreen::buildTrackList()
const std::string& curr_group_name = tabs->getSelectionIDString(0);
const int track_amount = track_manager->getNumberOfTracks();
const int track_amount = (int)track_manager->getNumberOfTracks();
// First build a list of all tracks to be displayed
// (e.g. exclude arenas, ...)

View File

@ -207,7 +207,7 @@ next:
if (pedantic)
warning("leading whitespace before string");
get_string_line(out, i);
get_string_line(out, (unsigned int) i);
goto next;
}
else if (isspace(current_line[i]))
@ -245,7 +245,7 @@ POParser::parse_header(const std::string& header)
if (has_prefix(line, "Content-Type:"))
{
// from_charset = line.substr(len);
unsigned int len = strlen("Content-Type: text/plain; charset=");
unsigned int len = (unsigned int) strlen("Content-Type: text/plain; charset=");
if (line.compare(0, len, "Content-Type: text/plain; charset=") == 0)
{
from_charset = line.substr(len);

View File

@ -56,6 +56,6 @@ public:
Vec3 getHPR(float t) const;
/** Returns the number of points in this bezier curve. */
unsigned int getNumPoints() const {return m_all_data.size(); }
unsigned int getNumPoints() const {return (unsigned int) m_all_data.size(); }
}; // BezierCurve
#endif

View File

@ -64,7 +64,7 @@ public:
static void destroy() { delete m_check_manager; m_check_manager = NULL; }
// ------------------------------------------------------------------------
/** Returns the number of check structures defined. */
unsigned int getCheckStructureCount() const { return m_all_checks.size(); }
unsigned int getCheckStructureCount() const { return (unsigned int) m_all_checks.size(); }
// ------------------------------------------------------------------------
/** Returns the nth. check structure. */
CheckStructure *getCheckStructure(unsigned int n) const

View File

@ -97,7 +97,7 @@ void QuadGraph::load(const std::string &filename)
// i.e. each quad is part of the graph exactly once.
// First create an empty graph node for each quad:
for(unsigned int i=0; i<QuadSet::get()->getNumberOfQuads(); i++)
m_all_nodes.push_back(new GraphNode(i, m_all_nodes.size()));
m_all_nodes.push_back(new GraphNode(i, (unsigned int) m_all_nodes.size()));
// Then set the default loop:
setDefaultSuccessors();
computeDirectionData();
@ -131,7 +131,7 @@ void QuadGraph::load(const std::string &filename)
xml_node->get("to-quad", &to);
for(unsigned int i=from; i<=to; i++)
{
m_all_nodes.push_back(new GraphNode(i, m_all_nodes.size()));
m_all_nodes.push_back(new GraphNode(i, (unsigned int) m_all_nodes.size()));
}
}
else if(xml_node->getName()=="node")
@ -139,7 +139,7 @@ void QuadGraph::load(const std::string &filename)
// A single quad is connected to a single graph node.
unsigned int id;
xml_node->get("quad", &id);
m_all_nodes.push_back(new GraphNode(id, m_all_nodes.size()));
m_all_nodes.push_back(new GraphNode(id, (unsigned int) m_all_nodes.size()));
}
// Then the definition of edges between the graph nodes:
@ -752,7 +752,7 @@ void QuadGraph::determineDirection(unsigned int current,
// If the direction is still the same during a lap the last node
// in the same direction is the previous node;
int max_step = m_all_nodes.size()-1;
int max_step = (int)m_all_nodes.size()-1;
while(max_step-- != 0)
{
@ -841,8 +841,8 @@ void QuadGraph::findRoadSector(const Vec3& xyz, int *sector,
// the node on F, and then keep on going straight ahead instead of
// using the loop at all.
unsigned int max_count = (*sector!=UNKNOWN_SECTOR && all_sectors!=NULL)
? all_sectors->size()
: m_all_nodes.size();
? (unsigned int)all_sectors->size()
: (unsigned int)m_all_nodes.size();
*sector = UNKNOWN_SECTOR;
for(unsigned int i=0; i<max_count; i++)
{
@ -896,7 +896,7 @@ int QuadGraph::findOutOfRoadSector(const Vec3& xyz,
const int curr_sector,
std::vector<int> *all_sectors) const
{
int count = (all_sectors!=NULL) ? all_sectors->size() : getNumNodes();
int count = (all_sectors!=NULL) ? (int) all_sectors->size() : getNumNodes();
int current_sector = 0;
if(curr_sector != UNKNOWN_SECTOR && !all_sectors)
{

View File

@ -130,13 +130,13 @@ public:
unsigned int count);
void setupPaths();
void computeChecklineRequirements();
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------======
/** Returns the one instance of this object. It is possible that there
* is no instance created (e.g. in battle mode, since it doesn't have
* a quad graph), so we don't assert that an instance exist, and we
* also don't create one if it doesn't exists. */
static QuadGraph *get() { return m_quad_graph; }
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------==
/** Creates a QuadGraph instance. */
static void create(const std::string &quad_file_name,
const std::string graph_file_name,
@ -147,7 +147,7 @@ public:
// functions called from the constructor need it to be defined.
new QuadGraph(quad_file_name, graph_file_name, reverse);
} // create
// ----------------------------------------------------------------------
// ------------------------------------------------------------------------
/** Cleans up the quad graph. It is possible that this function is called
* even if no instance exists (e.g. in battle mode). So it is not an
* error if there is no instance. */
@ -159,37 +159,37 @@ public:
m_quad_graph = NULL;
}
} // destroy
// ----------------------------------------------------------------------
// ------------------------------------------------------------------------
/** Returns the number of nodes in the graph. */
unsigned int getNumNodes() const { return m_all_nodes.size(); }
// ----------------------------------------------------------------------
unsigned int getNumNodes() const { return (unsigned int)m_all_nodes.size();}
// ------------------------------------------------------------------------
/** Return the distance to the j-th successor of node n. */
float getDistanceToNext(int n, int j) const
{ return m_all_nodes[n]->getDistanceToSuccessor(j);}
// ----------------------------------------------------------------------
// ------------------------------------------------------------------------
/** Returns the angle of the line between node n and its j-th.
* successor. */
float getAngleToNext(int n, int j) const
{ return m_all_nodes[n]->getAngleToSuccessor(j); }
// ----------------------------------------------------------------------
// ------------------------------------------------------------------------
/** Returns the number of successors of a node n. */
int getNumberOfSuccessors(int n) const
{ return m_all_nodes[n]->getNumberOfSuccessors(); }
// ----------------------------------------------------------------------
// ------------------------------------------------------------------------
/** Returns the quad that belongs to a graph node. */
const Quad& getQuadOfNode(unsigned int j) const
{ return QuadSet::get()->getQuad(m_all_nodes[j]->getQuadIndex()); }
// ----------------------------------------------------------------------
// ------------------------------------------------------------------------
/** Returns the quad that belongs to a graph node. */
GraphNode& getNode(unsigned int j) const{ return *m_all_nodes[j]; }
// ----------------------------------------------------------------------
// ------------------------------------------------------------------------
/** Returns the distance from the start to the beginning of a quad. */
float getDistanceFromStart(int j) const
{ return m_all_nodes[j]->getDistanceFromStart(); }
// ----------------------------------------------------------------------
// ------------------------------------------------------------------------
/** Returns the length of the main driveline. */
float getLapLength() const {return m_lap_length; }
// ----------------------------------------------------------------------
// ------------------------------------------------------------------------
/** Returns true if the graph is to be reversed. */
bool isReverse() const {return m_reverse; }

View File

@ -59,7 +59,7 @@ void QuadSet::getPoint(const XMLNode *xml, const std::string &attribute_name,
{
std::string s;
xml->get(attribute_name, &s);
int pos=s.find_first_of(":");
int pos=(int)s.find_first_of(":");
if(pos>0) // n:p specification
{
std::vector<std::string> l = StringUtils::split(s, ':');

View File

@ -1704,7 +1704,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
}
loadMainTrack(*root);
unsigned int main_track_count = m_all_nodes.size();
unsigned int main_track_count = (unsigned int)m_all_nodes.size();
ModelDefinitionLoader model_def_loader(this);
@ -1754,7 +1754,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
}
// Enable for for all track nodes if fog is used
const unsigned int count = m_all_nodes.size();
const unsigned int count = (int)m_all_nodes.size();
for(unsigned int i=0; i<count; i++)
{
adjustForFog(m_all_nodes[i]);

View File

@ -543,7 +543,7 @@ public:
{ return m_root+"/"+s; }
// ------------------------------------------------------------------------
/** Returns the number of modes available for this track. */
unsigned int getNumberOfModes() const { return m_all_modes.size(); }
unsigned int getNumberOfModes() const { return (unsigned int) m_all_modes.size(); }
// ------------------------------------------------------------------------
/** Returns number of completed challenges. */
unsigned int getNumOfCompletedChallenges();
@ -568,7 +568,7 @@ public:
// ------------------------------------------------------------------------
/** Get the number of start positions defined in the scene file. */
unsigned int getNumberOfStartPositions() const
{ return m_start_transforms.size(); }
{ return (unsigned int)m_start_transforms.size(); }
// ------------------------------------------------------------------------
bool getWeatherLightning() {return m_weather_lightning;}
// ------------------------------------------------------------------------

View File

@ -304,14 +304,14 @@ void TrackManager::updateGroups(const Track* track)
(track->isSoccer() ? m_soccer_arena_group_names :
m_track_group_names));
const unsigned int groups_amount = new_groups.size();
const unsigned int groups_amount = (unsigned int)new_groups.size();
for(unsigned int i=0; i<groups_amount; i++)
{
bool group_exists = group_2_indices.find(new_groups[i])
!= group_2_indices.end();
if(!group_exists)
group_names.push_back(new_groups[i]);
group_2_indices[new_groups[i]].push_back(m_tracks.size()-1);
group_2_indices[new_groups[i]].push_back((int)m_tracks.size()-1);
}
} // updateGroups

View File

@ -55,7 +55,7 @@ public:
m_y.push_back(y);
if(m_y.size()>1)
{
const unsigned int last=m_x.size()-1;
const unsigned int last=(unsigned int) m_x.size()-1;
// Avoid division by zero, just set m_delta to a large
// value with the right sign
if(m_x[last]==m_x[last-1])
@ -69,7 +69,7 @@ public:
} // push_back
// ------------------------------------------------------------------------
/** Returns the number of X/Y points. */
unsigned int size() const { return m_x.size(); }
unsigned int size() const { return (unsigned int) m_x.size(); }
// ------------------------------------------------------------------------
/** Returns the X value for a specified point. */
float getX(unsigned int i) const { return m_x[i]; }
@ -121,7 +121,7 @@ public:
{
if(y > m_y[0]) return m_x[0];
const unsigned int last = m_x.size();
const unsigned int last = (unsigned int) m_x.size();
for(unsigned int i=1; i<last; i++)
{
@ -134,7 +134,7 @@ public:
{
if(y < m_y[0]) return m_x[0];
const unsigned int last = m_x.size();
const unsigned int last = (unsigned int) m_x.size();
for(unsigned int i=1; i<last; i++)
{

View File

@ -99,7 +99,7 @@ public:
// ------------------------------------------------------------------------
unsigned int size() const
{
return m_contents_vector.size();
return (int) m_contents_vector.size();
} // size
// ------------------------------------------------------------------------

View File

@ -167,14 +167,14 @@ namespace StringUtils
try
{
std::string::size_type start=0;
while(start!=std::string::npos && start<s.size())
while(start!=std::string::npos && start<(unsigned int)s.size())
{
std::string::size_type i=s.find(c, start);
if (i!=std::string::npos)
{
if (keepSplitChar)
{
int from = start-1;
int from = (int)start-1;
if (from < 0) from = 0;
result.push_back(std::string(s, from, i-from));
@ -344,7 +344,7 @@ namespace StringUtils
unsigned int insertValID = 0;
const unsigned int item_count = sv.size();
const unsigned int item_count = (int)sv.size();
for (unsigned int i=0; i<item_count; i++)
{
if(sv[i][0] != '%')
@ -416,7 +416,7 @@ namespace StringUtils
irr::core::stringw new_string="";
const unsigned int size = sv.size();
const unsigned int size = (int)sv.size();
for (unsigned int i=0; i<size; i++)
{
if(sv[i][0] != '%')
@ -563,7 +563,7 @@ namespace StringUtils
while (true)
{
const int pos = wip.find(from);
const int pos = (int) wip.find(from);
if (pos == -1)
{
return wip;