Merge "Fix misc-macro-parentheses warnings in hwui and graphic jni."

am: e66235bf00

* commit 'e66235bf00a695cacb44b0bc1a241cabb7de3b96':
  Fix misc-macro-parentheses warnings in hwui and graphic jni.

Change-Id: I08ab0efc29e8b595f087a781d8a66a472f1f9797
This commit is contained in:
Chih-Hung Hsieh
2016-05-19 23:07:09 +00:00
committed by android-build-merger
9 changed files with 14 additions and 14 deletions

View File

@@ -35,12 +35,12 @@
namespace android {
#define SWAP(a, b, temp) {temp = a; a = b; b = temp;}
#define SWAP(a, b, temp) {(temp) = a; (a) = b; (b) = temp;}
#define COORD(vert, i) ((float *)(vert))[i]
#define CLIP_AND_SWAP(elem, sign, k, p, q, r) { \
poly_clip_to_halfspace(p, q, &v->elem-(float *)v, sign, sign*k); \
if (q->n==0) {p1->n = 0; return POLY_CLIP_OUT;} \
poly_clip_to_halfspace(p, q, &v->elem-(float *)v, sign, (sign)*(k)); \
if ((q)->n==0) {p1->n = 0; return POLY_CLIP_OUT;} \
SWAP(p, q, r); \
}

View File

@@ -49,7 +49,7 @@ namespace android {
// Debug
static const bool kDebugGraphicBuffer = false;
#define LOCK_CANVAS_USAGE GraphicBuffer::USAGE_SW_READ_OFTEN | GraphicBuffer::USAGE_SW_WRITE_OFTEN
#define LOCK_CANVAS_USAGE (GraphicBuffer::USAGE_SW_READ_OFTEN | GraphicBuffer::USAGE_SW_WRITE_OFTEN)
// ----------------------------------------------------------------------------
// JNI Helpers

View File

@@ -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

View File

@@ -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()) {

View File

@@ -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); \

View File

@@ -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,

View File

@@ -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_*

View File

@@ -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) {

View File

@@ -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)