Ignore:
Timestamp:
Apr 15, 2011, 7:34:53 AM (12 years ago)
Author:
Sam Hocevar
Message:

Fix a few compiler warnings caused by bad type punning.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/palette.cpp

    r162 r476  
    100100
    101101uint32_t palette::getquad(int x)
    102 { char entry[4];
     102{ union { char entry[4]; uint32_t ret; };
    103103  entry[3]=0;
    104104  entry[2]=pal[x].red;
    105105  entry[1]=pal[x].green;
    106106  entry[0]=pal[x].blue;
    107   return *((uint32_t *)entry);
     107  return ret;
    108108}
    109109
     
    261261  else if (ncolors==16)
    262262    for (i=0;i<ncolors;i++)
    263       set(i,255-(i&3),255-(i&4)>>2,255-(i&8)>>3);
     263      set(i,255-(i&3),255-((i&4)>>2),255-((i&8)>>3));
    264264  else
    265265    for (i=0;i<ncolors;i++)
Note: See TracChangeset for help on using the changeset viewer.