From af0eabbdeac5880d203d695251c637a06a0582bc Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 26 Dec 2015 14:09:15 +0100 Subject: [PATCH] Fixed: GCC warnings --HG-- branch : develop --- code/nel/include/nel/gui/widget_manager.h | 2 +- code/nel/src/gui/group_table.cpp | 11 +++++------ code/nel/src/gui/libwww.cpp | 2 +- code/nel/src/gui/widget_manager.cpp | 14 +++++++------- code/nel/src/misc/bitmap_gif.cpp | 5 +++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/code/nel/include/nel/gui/widget_manager.h b/code/nel/include/nel/gui/widget_manager.h index 21d1e7a38..9d8ff060e 100644 --- a/code/nel/include/nel/gui/widget_manager.h +++ b/code/nel/include/nel/gui/widget_manager.h @@ -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(); diff --git a/code/nel/src/gui/group_table.cpp b/code/nel/src/gui/group_table.cpp index 8b5b94b90..a82ad5617 100644 --- a/code/nel/src/gui/group_table.cpp +++ b/code/nel/src/gui/group_table.cpp @@ -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 _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( ; columnTableColumnIndex; ++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 diff --git a/code/nel/src/gui/libwww.cpp b/code/nel/src/gui/libwww.cpp index 54e28abf0..800c4d1e3 100644 --- a/code/nel/src/gui/libwww.cpp +++ b/code/nel/src/gui/libwww.cpp @@ -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]); diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index d4a45c592..37a115965 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -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,8 +3376,8 @@ namespace NLGUI void CWidgetManager::getEditorSelection( std::vector< std::string > &selection ) { selection.clear(); - for( int i = 0; i < editorSelection.size(); i++ ) - selection.push_back( editorSelection[ i ] ); + for(uint i = 0; i < editorSelection.size(); ++i) + selection.push_back(editorSelection[i]); } void CWidgetManager::selectWidget( const std::string &name ) @@ -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(); diff --git a/code/nel/src/misc/bitmap_gif.cpp b/code/nel/src/misc/bitmap_gif.cpp index 74f75a968..34ece8b60 100644 --- a/code/nel/src/misc/bitmap_gif.cpp +++ b/code/nel/src/misc/bitmap_gif.cpp @@ -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; }