Fixed: GCC warnings

This commit is contained in:
kervala 2015-12-26 14:09:15 +01:00
parent 584bb6cc99
commit 1b7bdfd485
5 changed files with 17 additions and 17 deletions

View file

@ -335,7 +335,7 @@ namespace NLGUI
sint32 newW, sint32 newH) const;
// move windows according to new screen size
void moveAllWindowsToNewScreenSize(sint32 newScreenW, sint32 newScreenH, bool fixCurrentUI );
void moveAllWindowsToNewScreenSize(uint32 newScreenW, uint32 newScreenH, bool fixCurrentUI );
void updateAllLocalisedElements();

View file

@ -715,7 +715,7 @@ namespace NLGUI
// *** Get the column sizes, we need to know min for the table
uint i;
sint column = 0;
uint column = 0;
_Columns.clear ();
for (i=0; i<_Cells.size(); i++)
{
@ -783,13 +783,12 @@ namespace NLGUI
// new column, set rowspan from current <TD>
_Columns[column].RowSpan = cell->RowSpan;
float colspan = 1.f / cell->ColSpan;
float rowspan = 1.f / cell->RowSpan;
// Update sizes
if (cellWidth*colspan > _Columns[column].Width)
_Columns[column].Width = cellWidth*colspan;
_Columns[column].Width = (sint32)(cellWidth*colspan);
if (cell->WidthMax*colspan > _Columns[column].WidthMax)
_Columns[column].WidthMax = cell->WidthMax*colspan;
_Columns[column].WidthMax = (sint32)(cell->WidthMax*colspan);
if (cell->TableRatio*colspan > _Columns[column].TableRatio)
_Columns[column].TableRatio = cell->TableRatio*colspan;
if (cell->WidthWanted*colspan + additionnalWidth > _Columns[column].WidthWanted)
@ -1035,7 +1034,7 @@ namespace NLGUI
if (cell->TableColumnIndex > 0)
{
// we have active rowspan, must add up 'skipped' columns
for( ; column<cell->TableColumnIndex; ++column)
for( ; column < (uint)cell->TableColumnIndex; ++column)
currentX += _Columns[column].Width + padding*2 + CellSpacing;
}
@ -1081,7 +1080,7 @@ namespace NLGUI
cell->Group->updateCoords();
// Resize the row array
float rowspan = 1 / cell->RowSpan;
float rowspan = 1.f / (float)cell->RowSpan;
_Rows.back().Height = std::max((sint32)(cell->Height*rowspan), std::max(_Rows.back().Height, (sint32)(cell->Group->getH()*rowspan)));
// Next column

View file

@ -398,7 +398,7 @@ namespace NLGUI
{
time_t now;
time(&now);
if (expires < now)
if (expires < (uint32)now)
{
nlwarning("cookie expired, remove from list '%s'", nsformat);
HTTPCookies[domain].erase(chunks[5]);

View file

@ -1774,7 +1774,7 @@ namespace NLGUI
}
// ------------------------------------------------------------------------------------------------
void CWidgetManager::moveAllWindowsToNewScreenSize(sint32 newScreenW, sint32 newScreenH, bool fixCurrentUI)
void CWidgetManager::moveAllWindowsToNewScreenSize(uint32 newScreenW, uint32 newScreenH, bool fixCurrentUI)
{
std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = getAllMasterGroup();
// If resolutions correctly setuped, and really different from new setup
@ -2083,7 +2083,7 @@ namespace NLGUI
if (CInterfaceElement::getEditorMode())
{
for( int i = 0; i < editorSelection.size(); i++ )
for(uint i = 0; i < editorSelection.size(); ++i)
{
CInterfaceElement *e = getElementFromId(editorSelection[i]);
if (e != NULL)
@ -3376,7 +3376,7 @@ namespace NLGUI
void CWidgetManager::getEditorSelection( std::vector< std::string > &selection )
{
selection.clear();
for( int i = 0; i < editorSelection.size(); i++ )
for(uint i = 0; i < editorSelection.size(); ++i)
selection.push_back(editorSelection[i]);
}
@ -3539,7 +3539,7 @@ namespace NLGUI
std::vector< CInterfaceElement* > elms;
// Resolve the widget names
for( int i = 0; i < editorSelection.size(); i++ )
for(uint i = 0; i < editorSelection.size(); ++i)
{
CInterfaceElement *e = getElementFromId(editorSelection[i]);
if (e != NULL)
@ -3562,7 +3562,7 @@ namespace NLGUI
std::string oldId;
// Reparent the widgets to the new group
for( int i = 0; i < elms.size(); i++ )
for(uint i = 0; i < elms.size(); ++i)
{
CInterfaceElement *e = elms[i];
oldId = e->getId();
@ -3631,7 +3631,7 @@ namespace NLGUI
{
reset();
for( int i = 0; i < _MasterGroups.size(); i++ )
for(uint i = 0; i < _MasterGroups.size(); ++i)
delete _MasterGroups[i].Group;
_MasterGroups.clear();

View file

@ -260,12 +260,13 @@ uint8 CBitmap::readGIF( NLMISC::IStream &f )
dstOffset+= dstChannels;
uint32 index = curFrame->RasterBits[srcOffset];
if (index != transparency)
if ((sint32)index != transparency)
{
// make sure color index is not outside colormap
if (ColorMap)
{
if (index > ColorMap->ColorCount)
if ((sint)index > ColorMap->ColorCount)
{
index = 0;
}