diff options
author | David Robillard <d@drobilla.net> | 2025-02-06 14:41:48 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-02-06 14:41:48 -0500 |
commit | 83ec362de059e27f9bae4ec15e2a701e4f1568fa (patch) | |
tree | 1921c4ddfa475cdacf7e97705817fecbdc657ffa | |
parent | 336cc985d28666e1d00edf7df6f7f6126d6a5be1 (diff) | |
download | pugl-83ec362de059e27f9bae4ec15e2a701e4f1568fa.tar.gz pugl-83ec362de059e27f9bae4ec15e2a701e4f1568fa.tar.bz2 pugl-83ec362de059e27f9bae4ec15e2a701e4f1568fa.zip |
Fully parenthesize mathematical expressions
-rw-r--r-- | src/mac.m | 4 | ||||
-rw-r--r-- | src/win.c | 7 | ||||
-rw-r--r-- | src/x11.c | 4 |
3 files changed, 8 insertions, 7 deletions
@@ -1166,8 +1166,8 @@ puglGetAncestorCenter(const PuglView* const view) const NSRect boundsPx = nsRectFromPoints(view, boundsPt); const PuglPoint center = { - (PuglCoord)(boundsPx.origin.x + boundsPx.size.width / 2.0), - (PuglCoord)(boundsPx.origin.y + boundsPx.size.height / 2.0)}; + (PuglCoord)(boundsPx.origin.x + (boundsPx.size.width / 2.0)), + (PuglCoord)(boundsPx.origin.y + (boundsPx.size.height / 2.0))}; return center; } @@ -44,7 +44,8 @@ #ifdef __cplusplus # define PUGL_INIT_STRUCT \ - {} + { \ + } #else # define PUGL_INIT_STRUCT {0} #endif @@ -1581,8 +1582,8 @@ puglGetAncestorCenter(const PuglView* const view) &rect); const PuglPoint center = { - (PuglCoord)(rect.left + (rect.right - rect.left) / 2), - (PuglCoord)(rect.top + (rect.bottom - rect.top) / 2)}; + (PuglCoord)(rect.left + ((rect.right - rect.left) / 2)), + (PuglCoord)(rect.top + ((rect.bottom - rect.top) / 2))}; return center; } @@ -523,8 +523,8 @@ puglGetAncestorCenter(const PuglView* const view) &ancestorAttrs); const PuglPoint center = { - (PuglCoord)(ancestorAttrs.x + ancestorAttrs.width / 2), - (PuglCoord)(ancestorAttrs.y + ancestorAttrs.height / 2)}; + (PuglCoord)(ancestorAttrs.x + (ancestorAttrs.width / 2)), + (PuglCoord)(ancestorAttrs.y + (ancestorAttrs.height / 2))}; return center; } |