From 83ec362de059e27f9bae4ec15e2a701e4f1568fa Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 6 Feb 2025 14:41:48 -0500 Subject: Fully parenthesize mathematical expressions --- src/mac.m | 4 ++-- src/win.c | 7 ++++--- src/x11.c | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mac.m b/src/mac.m index 74241d6..d5797c3 100644 --- a/src/mac.m +++ b/src/mac.m @@ -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; } diff --git a/src/win.c b/src/win.c index 99f47fb..6be7e17 100644 --- a/src/win.c +++ b/src/win.c @@ -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; } diff --git a/src/x11.c b/src/x11.c index 3cde709..91bdbf2 100644 --- a/src/x11.c +++ b/src/x11.c @@ -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; } -- cgit v1.2.1