GCC8 warnings fixes.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2018-07-09 19:47:59 -03:00
parent 3d89add357
commit 5ae5e2be6a
5 changed files with 26 additions and 16 deletions

View File

@@ -90,7 +90,10 @@ void BatchRenderer::addVertexs( const unsigned int& num ) {
if ( ( mNumVertex + num ) >= mVertexSize ) {
eeVertex * newVertex = eeNewArray( eeVertex, mVertexSize * 2 );
memcpy( &mVertex[0], &newVertex[0], mVertexSize * sizeof(eeVertex) );
for ( Uint32 i = 0; i < mVertexSize; i++ )
newVertex[i] = mVertex[i];
eeSAFE_DELETE_ARRAY( mVertex );
mVertex = newVertex;
mVertexSize = mVertexSize * 2;

View File

@@ -607,7 +607,7 @@ const Uint8* Image::getPixelsPtr() {
Color Image::getPixel( const unsigned int& x, const unsigned int& y ) {
eeASSERT( !( mPixels == NULL || x > mWidth || y > mHeight ) );
Color dst;
memcpy( &dst, &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], mChannels );
memcpy( (void*)&dst, &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], mChannels );
return dst;
}

View File

@@ -867,7 +867,6 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) {
Int32 rpos = from;
Int32 lpos = 0;
Uint32 i;
Uint32 qsize = sizeof(Color) * GLi->quadVertexs();
String::StringBaseType curChar;
// Spaces, new lines and tabs are not rendered, and not counted as a color
@@ -902,20 +901,22 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) {
rpos--;
if ( '\n' == curChar) {
if ( underlined ) {
memcpy( &(mColors[ rpos * GLi->quadVertexs() ]), &colors[0], qsize );
rpos++;
if ( underlined || strikeThrough ) {
for ( int i = 0; i < GLi->quadVertexs(); i++ )
mColors[ rpos * GLi->quadVertexs() + i ] = colors[i];
}
if ( strikeThrough ) {
memcpy( &(mColors[ rpos * GLi->quadVertexs() ]), &colors[0], qsize );
if ( underlined )
rpos++;
if ( strikeThrough )
rpos++;
}
}
}
}
memcpy( &(mColors[ lpos * GLi->quadVertexs() ]), &colors[0], qsize );
for ( int i = 0; i < GLi->quadVertexs(); i++ )
mColors[ lpos * GLi->quadVertexs() + i ] = colors[i];
}
if ( rto == s ) {
@@ -923,16 +924,20 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) {
lpos++;
Uint32 pos = lpos * GLi->quadVertexs();
if ( pos < mColors.size() )
memcpy( &(mColors[ lpos * GLi->quadVertexs() ]), &colors[0], qsize );
if ( pos < mColors.size() ) {
for ( int i = 0; i < GLi->quadVertexs(); i++ )
mColors[ lpos * GLi->quadVertexs() + i ] = colors[i];
}
}
if ( strikeThrough ) {
lpos++;
Uint32 pos = lpos * GLi->quadVertexs();
if ( pos < mColors.size() )
memcpy( &(mColors[ lpos * GLi->quadVertexs() ]), &colors[0], qsize );
if ( pos < mColors.size() ) {
for ( int i = 0; i < GLi->quadVertexs(); i++ )
mColors[ lpos * GLi->quadVertexs() + i ] = colors[i];
}
}
}
}

View File

@@ -212,7 +212,8 @@ UISkinComplex * UISkinComplex::clone( const std::string& NewName, const bool& Co
if ( CopyColorsState ) {
SkinC->mColorDefault = mColorDefault;
memcpy( &SkinC->mColor[0], &mColor[0], UISkinState::StateCount * sizeof(Color) );
for ( size_t i = 0; i < UISkinState::StateCount; i++ )
SkinC->mColor[i] = mColor[i];
}
memcpy( &SkinC->mDrawable[0], &mDrawable[0], UISkinState::StateCount * SideCount * sizeof(Drawable*) );

View File

@@ -62,7 +62,8 @@ UISkinSimple * UISkinSimple::clone( const std::string& NewName, const bool& Copy
if ( CopyColorsState ) {
SkinS->mColorDefault = mColorDefault;
memcpy( &SkinS->mColor[0], &mColor[0], UISkinState::StateCount * sizeof(Color) );
for ( size_t i = 0; i < UISkinState::StateCount; i++ )
SkinS->mColor[i] = mColor[i];
}
memcpy( &SkinS->mDrawable[0], &mDrawable[0], UISkinState::StateCount * sizeof(Drawable*) );