fix 'warning: suggest parentheses around arithmetic in operand of ‘|’' in public headers

This commit is contained in:
Anonymous Maarten 2018-07-13 21:39:06 +02:00
parent 12269003da
commit 9ef08cbb19
2 changed files with 5 additions and 5 deletions

View File

@ -601,7 +601,7 @@ libraryIDPack(int version, int build)
{
if(version <= 0x31000)
return version>>8;
return (version-0x30000 & 0x3FF00) << 14 | (version&0x3F) << 16 |
return ((version-0x30000) & 0x3FF00) << 14 | (version&0x3F) << 16 |
(build & 0xFFFF);
}
@ -609,7 +609,7 @@ inline int
libraryIDUnpackVersion(uint32 libid)
{
if(libid & 0xFFFF0000)
return (libid>>14 & 0x3FF00) + 0x30000 |
return ((libid>>14 & 0x3FF00) + 0x30000) |
(libid>>16 & 0x3F);
else
return libid<<8;

View File

@ -258,11 +258,11 @@ struct Texture
static Texture *fromDict(LLLink *lnk){
return LLLinkGetData(lnk, Texture, inDict); }
FilterMode getFilter(void) { return (FilterMode)(filterAddressing & 0xFF); }
void setFilter(FilterMode f) { filterAddressing = filterAddressing & ~0xFF | f; }
void setFilter(FilterMode f) { filterAddressing = (filterAddressing & ~0xFF) | f; }
Addressing getAddressU(void) { return (Addressing)((filterAddressing >> 8) & 0xF); }
Addressing getAddressV(void) { return (Addressing)((filterAddressing >> 12) & 0xF); }
void setAddressU(Addressing u) { filterAddressing = filterAddressing & ~0xF00 | u<<8; }
void setAddressV(Addressing v) { filterAddressing = filterAddressing & ~0xF000 | v<<12; }
void setAddressU(Addressing u) { filterAddressing = (filterAddressing & ~0xF00) | u<<8; }
void setAddressV(Addressing v) { filterAddressing = (filterAddressing & ~0xF000) | v<<12; }
static Texture *streamRead(Stream *stream);
bool streamWrite(Stream *stream);
uint32 streamGetSize(void);