aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-05-03 10:25:20 -0400
committerDavid Robillard <d@drobilla.net>2023-05-03 10:38:23 -0400
commit7f7ff7e0a1f3bb936006615773a974e2bcd2afb0 (patch)
tree1069c3ec9c26bf8e7ecac6a9ff516804b838decb
parent3932b6bb06a0fe28a990d4906b4e9ca77764a729 (diff)
downloadpugl-7f7ff7e0a1f3bb936006615773a974e2bcd2afb0.tar.gz
pugl-7f7ff7e0a1f3bb936006615773a974e2bcd2afb0.tar.bz2
pugl-7f7ff7e0a1f3bb936006615773a974e2bcd2afb0.zip
Fix implicit sign conversions
-rw-r--r--examples/pugl_management_demo.c2
-rw-r--r--src/win.c4
-rw-r--r--src/x11.c6
-rw-r--r--src/x11_cairo.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/examples/pugl_management_demo.c b/examples/pugl_management_demo.c
index 766bee1..50109a4 100644
--- a/examples/pugl_management_demo.c
+++ b/examples/pugl_management_demo.c
@@ -146,7 +146,7 @@ onKeyPress(PuglView* view, const PuglKeyEvent* event)
case 'm':
if ((flags & PUGL_VIEW_STYLE_TALL) && (flags & PUGL_VIEW_STYLE_WIDE)) {
return puglSetViewStyle(
- view, flags & ~(PUGL_VIEW_STYLE_TALL | PUGL_VIEW_STYLE_WIDE));
+ view, flags & ~(unsigned)(PUGL_VIEW_STYLE_TALL | PUGL_VIEW_STYLE_WIDE));
}
return puglSetViewStyle(
diff --git a/src/win.c b/src/win.c
index 33b37b6..4abed87 100644
--- a/src/win.c
+++ b/src/win.c
@@ -1561,8 +1561,8 @@ getInitialFrame(PuglView* const view)
// Center the frame around the center of the bounding rectangle
const LONG centerX = rect.left + (rect.right - rect.left) / 2;
const LONG centerY = rect.top + (rect.bottom - rect.top) / 2;
- const PuglRect frame = {(PuglCoord)(centerX - (defaultWidth / 2U)),
- (PuglCoord)(centerY - (defaultHeight / 2U)),
+ const PuglRect frame = {(PuglCoord)(centerX - (defaultWidth / 2)),
+ (PuglCoord)(centerY - (defaultHeight / 2)),
defaultWidth,
defaultHeight};
return frame;
diff --git a/src/x11.c b/src/x11.c
index d0a61f0..22c71d5 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -510,8 +510,8 @@ getInitialFrame(PuglView* const view)
// Center the frame within the parent bounds
const int centerX = parentAttrs.x + parentAttrs.width / 2;
const int centerY = parentAttrs.y + parentAttrs.height / 2;
- const PuglRect frame = {(PuglCoord)(centerX - (defaultWidth / 2U)),
- (PuglCoord)(centerY - (defaultHeight / 2U)),
+ const PuglRect frame = {(PuglCoord)(centerX - (defaultWidth / 2)),
+ (PuglCoord)(centerY - (defaultHeight / 2)),
defaultWidth,
defaultHeight};
return frame;
@@ -1069,7 +1069,7 @@ makeConfigureEvent(PuglView* const view)
} else if (view->impl->mapped) {
event.configure.style |= PUGL_VIEW_STYLE_MAPPED;
} else {
- event.configure.style &= ~PUGL_VIEW_STYLE_MAPPED;
+ event.configure.style &= ~(PuglViewStyleFlags)PUGL_VIEW_STYLE_MAPPED;
}
return event;
diff --git a/src/x11_cairo.c b/src/x11_cairo.c
index eabf46f..e9d0cea 100644
--- a/src/x11_cairo.c
+++ b/src/x11_cairo.c
@@ -99,8 +99,8 @@ puglX11CairoEnter(PuglView* view, const PuglExposeEvent* expose)
if (expose) {
const PuglViewSize viewSize = puglX11CairoGetViewSize(view);
- const PuglSpan right = expose->x + expose->width;
- const PuglSpan bottom = expose->y + expose->height;
+ const PuglSpan right = (PuglSpan)(expose->x + expose->width);
+ const PuglSpan bottom = (PuglSpan)(expose->y + expose->height);
const PuglSpan surfaceWidth = MAX(right, viewSize.width);
const PuglSpan surfaceHeight = MAX(bottom, viewSize.height);
if (!(st = puglX11CairoOpen(view, surfaceWidth, surfaceHeight))) {