diff options
author | 2016-05-19 15:25:50 -0700 | |
---|---|---|
committer | 2016-05-19 15:25:50 -0700 | |
commit | cef190de850f163dd4b95d667a8d46d46e860363 (patch) | |
tree | 60aa601a7e46d2f39acfe5fb46a77b242b3cfa44 /libs | |
parent | 4bc3d32b15cdcae7685722e7a20007c7aa9ae949 (diff) |
Fix misc-macro-parentheses warnings in hwui and graphic jni.
Bug: 28705665
Change-Id: I7d1eb38a713fe6cc7f41a3cc3f2f9d0aa0114b2c
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/DisplayListOp.h | 4 | ||||
-rw-r--r-- | libs/hwui/Matrix.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/Properties.h | 4 | ||||
-rw-r--r-- | libs/hwui/RenderProperties.h | 2 | ||||
-rw-r--r-- | libs/hwui/font/FontUtil.h | 2 | ||||
-rw-r--r-- | libs/hwui/utils/LinearAllocator.cpp | 4 |
7 files changed, 10 insertions, 10 deletions
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h index 8b4b4ba2b79e..0d7911c1daa4 100644 --- a/libs/hwui/DisplayListOp.h +++ b/libs/hwui/DisplayListOp.h @@ -639,8 +639,8 @@ public: } #define SET_TEXTURE(ptr, posRect, offsetRect, texCoordsRect, xDim, yDim) \ - TextureVertex::set(ptr++, posRect.xDim - offsetRect.left, posRect.yDim - offsetRect.top, \ - texCoordsRect.xDim, texCoordsRect.yDim) + TextureVertex::set((ptr)++, (posRect).xDim - (offsetRect).left, (posRect).yDim - (offsetRect).top, \ + (texCoordsRect).xDim, (texCoordsRect).yDim) /** * This multi-draw operation builds a mesh on the stack by generating a quad diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp index 06e67c0e85ad..872abde2c765 100644 --- a/libs/hwui/Matrix.cpp +++ b/libs/hwui/Matrix.cpp @@ -425,7 +425,7 @@ void Matrix4::mapPoint3d(Vector3& vec) const { vec.z = orig.x * data[2] + orig.y * data[6] + orig.z * data[kScaleZ] + data[kTranslateZ]; } -#define MUL_ADD_STORE(a, b, c) a = (a) * (b) + (c) +#define MUL_ADD_STORE(a, b, c) ((a) = (a) * (b) + (c)) void Matrix4::mapPoint(float& x, float& y) const { if (isSimple()) { diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 5233a2377d7f..2caadc7aa1f7 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -898,7 +898,7 @@ void OpenGLRenderer::composeLayerRect(Layer* layer, const Rect& rect) { */ #define DRAW_DOUBLE_STENCIL_IF(COND, DRAW_COMMAND) { \ DRAW_COMMAND; \ - if (CC_UNLIKELY(Properties::debugOverdraw && getTargetFbo() == 0 && COND)) { \ + if (CC_UNLIKELY(Properties::debugOverdraw && getTargetFbo() == 0 && (COND))) { \ glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); \ DRAW_COMMAND; \ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); \ diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h index 26d8bf754ddb..5dea49387921 100644 --- a/libs/hwui/Properties.h +++ b/libs/hwui/Properties.h @@ -254,9 +254,9 @@ enum DebugLevel { /////////////////////////////////////////////////////////////////////////////// // Converts a number of mega-bytes into bytes -#define MB(s) s * 1024 * 1024 +#define MB(s) ((s) * 1024 * 1024) // Converts a number of kilo-bytes into bytes -#define KB(s) s * 1024 +#define KB(s) ((s) * 1024) enum class ProfileType { None, diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h index 11abd701b9d8..56a7886f930f 100644 --- a/libs/hwui/RenderProperties.h +++ b/libs/hwui/RenderProperties.h @@ -46,7 +46,7 @@ class RenderNode; class RenderProperties; // The __VA_ARGS__ will be executed if a & b are not equal -#define RP_SET(a, b, ...) (a != b ? (a = b, ##__VA_ARGS__, true) : false) +#define RP_SET(a, b, ...) ((a) != (b) ? ((a) = (b), ##__VA_ARGS__, true) : false) #define RP_SET_AND_DIRTY(a, b) RP_SET(a, b, mPrimitiveFields.mMatrixOrPivotDirty = true) // Keep in sync with View.java:LAYER_TYPE_* diff --git a/libs/hwui/font/FontUtil.h b/libs/hwui/font/FontUtil.h index 4e5debe33c4a..db6b63602e13 100644 --- a/libs/hwui/font/FontUtil.h +++ b/libs/hwui/font/FontUtil.h @@ -44,7 +44,7 @@ typedef uint16_t glyph_t; #define TO_GLYPH(g) g #define GET_METRICS(cache, glyph) cache->getGlyphIDMetrics(glyph) - #define GET_GLYPH(text) nextGlyph((const uint16_t**) &text) + #define GET_GLYPH(text) nextGlyph((const uint16_t**) &(text)) #define IS_END_OF_STRING(glyph) false static inline glyph_t nextGlyph(const uint16_t** srcPtr) { diff --git a/libs/hwui/utils/LinearAllocator.cpp b/libs/hwui/utils/LinearAllocator.cpp index 59b12cf66a89..e2578041dbe1 100644 --- a/libs/hwui/utils/LinearAllocator.cpp +++ b/libs/hwui/utils/LinearAllocator.cpp @@ -48,8 +48,8 @@ #define ALIGN_SZ (sizeof(int)) #endif -#define ALIGN(x) ((x + ALIGN_SZ - 1 ) & ~(ALIGN_SZ - 1)) -#define ALIGN_PTR(p) ((void*)(ALIGN((size_t)p))) +#define ALIGN(x) (((x) + ALIGN_SZ - 1 ) & ~(ALIGN_SZ - 1)) +#define ALIGN_PTR(p) ((void*)(ALIGN((size_t)(p)))) #if LOG_NDEBUG #define ADD_ALLOCATION(size) |