Suppress Compiler Warnings - Compare of mixed signedness

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6957 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: def9a411943451e5b2f6555e8779eb88327ae870
Former-commit-id: 4909b6226d2f95aba29ed8d4ed783020034daa68
This commit is contained in:
scttgs0 2020-04-25 01:46:29 +00:00
parent 10253aefdf
commit 564bc36686
6 changed files with 11 additions and 13 deletions

View file

@ -383,7 +383,7 @@ void Driver::InitTrack(
LogSHADOW.debug( "%s: %g, %g\n", buf, innerModA, innerModB );
while( m_priv[p].INNER_MOD.size() < bend * 2 + 2 )
while (m_priv[p].INNER_MOD.size() < static_cast<size_t>(bend * 2 + 2))
m_priv[p].INNER_MOD.push_back( 0 );
if( innerModA != 999 )

View file

@ -39,9 +39,9 @@ void PathOffsets::setBaseFilename( const char* pBaseFilename )
void PathOffsets::update( const MyTrack& track, const tCarElt* pCar )
{
const int NSEG = track.GetSize();
const size_t NSEG = track.GetSize();
if( _offsets.size() != NSEG )
if (_offsets.size() != NSEG)
{
_offsets.clear();
_offsets.resize( NSEG );

View file

@ -1188,7 +1188,7 @@ void Stuck::getUnstuck( const MyTrack& track, tCarElt* me, const tSituation* s )
{
LogSHADOW.debug( "[%d] stuck::getUnstuck\n", me->index );
if( _planIndex >= _plan.size() - 1 )
if ( static_cast<size_t>(_planIndex) >= _plan.size() - 1 )
{
_stuckState = RACING;
return;
@ -1201,7 +1201,7 @@ void Stuck::getUnstuck( const MyTrack& track, tCarElt* me, const tSituation* s )
int best = -1;
double bestDist = 9e9;
LogSHADOW.debug( "[%d] (%d,%d) nearest pt: ", me->index, car_pt1.x(), car_pt1.y() );
for( int i = _planIndex; i < _plan.size(); i++ )
for( size_t i = _planIndex; i < _plan.size(); i++ )
{
const GridPoint& pt = _plan[i];
double dist = pt.dist(car_pt1);
@ -1222,7 +1222,7 @@ void Stuck::getUnstuck( const MyTrack& track, tCarElt* me, const tSituation* s )
return;
}
int ahead = best + 1 < _plan.size() ? best + 1 : best;
int ahead = best + 1 < static_cast<int>(_plan.size()) ? best + 1 : best;
double heading = _plan[ahead].iang() * 2 * PI / 64;
double deltaAng = heading - me->pub.DynGC.pos.az;
NORM_PI_PI(deltaAng);

View file

@ -53,7 +53,7 @@ void TeamInfo::Add( int index, Item* pItem )
{
LogSHADOW.debug( "TeamInfo::Add [%d] %s\n", index, pItem->pCar->info.carName );
if( index >= m_items.size() )
if( static_cast<size_t>(index) >= m_items.size() )
{
// expand array.
m_items.resize( index + 1 );

View file

@ -182,7 +182,7 @@ tScreenSize* GfScrGetSupportedSizes(int nColorDepth, bool bFullScreen, int* pnSi
}
}
else if (SDL_GetDisplayMode(0, avail-1, &mode) == 0) {
if (SDL_BITSPERPIXEL(mode.format) == nColorDepth
if (SDL_BITSPERPIXEL(mode.format) == static_cast<Uint32>(nColorDepth)
#if 1 // ignore multiple entries with different frequencies
&& (last.width != mode.w || last.height != mode.h)
#endif

View file

@ -307,12 +307,10 @@ void NotificationManager::removeOldUi(){
}
//iterate trougth ui and set them invisible
for (int i = 0; i < notifyUiId.size(); i++)
for (size_t i = 0; i < notifyUiId.size(); i++)
{
GfuiVisibilitySet(this->prevScreenHandle, this->notifyUiId[i], GFUI_INVISIBLE);
}
}
}
//delete the prev ui's
@ -331,7 +329,7 @@ void NotificationManager::createUi()
int yposmod= ypos;
//iterate trougth lines
for (int i = 0; i < this->messageLines.size(); i++)
for (size_t i = 0; i < this->messageLines.size(); i++)
{
int uiId;
uiId= GfuiMenuCreateLabelControl(this->screenHandle, this->menuXMLDescHdle, "slide");