Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 404e2b21 authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh Committed by android-build-merger
Browse files

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

am: e66235bf

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

Change-Id: I08ab0efc29e8b595f087a781d8a66a472f1f9797
parents 5dfe673b e66235bf
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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); \
}

+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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()) {
+1 −1
Original line number Diff line number Diff line
@@ -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); \
Loading