From 9ef08cbb19bac0dc1e636d8762a70a54ad02c065 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 13 Jul 2018 21:39:06 +0200 Subject: [PATCH] =?UTF-8?q?fix=20'warning:=20suggest=20parentheses=20aroun?= =?UTF-8?q?d=20arithmetic=20in=20operand=20of=20=E2=80=98|=E2=80=99'=20in?= =?UTF-8?q?=20public=20headers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rwbase.h | 4 ++-- src/rwobjects.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rwbase.h b/src/rwbase.h index 5058697..984ebba 100644 --- a/src/rwbase.h +++ b/src/rwbase.h @@ -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; diff --git a/src/rwobjects.h b/src/rwobjects.h index d5afdc2..a259e1a 100644 --- a/src/rwobjects.h +++ b/src/rwobjects.h @@ -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);