Fix minor windows pedantic warnings.

This commit is contained in:
Jason Felds
2016-03-27 22:03:15 -04:00
parent 534909d30a
commit bec18a0d36
31 changed files with 173 additions and 67 deletions
+7 -2
View File
@@ -120,22 +120,27 @@ void RageSurfaceUtils::Palettize( RageSurface *&pImg, int iColors, bool bDither
* [GRR POSSIBLE BUG: what about 32^4 ?] */
acolorhist_item *achv;
int colors;
while(1)
for(;;)
{
achv = pam_computeacolorhist( pImg, MAXCOLORS, &colors );
if( achv != NULL )
{
break;
}
pixval newmaxval = maxval / 2;
int table[256];
for( int c = 0; c <= maxval; ++c )
{
table[c] = ( (uint8_t) c * newmaxval + maxval/2 ) / maxval;
}
for( int row = 0; row < pImg->h; ++row )
{
apixel *pP = (apixel *) (pImg->pixels+row*pImg->pitch);
for( int col = 0; col < pImg->w; ++col, ++pP )
{
PAM_DEPTH( *pP );
}
}
maxval = newmaxval;
}