From 5076f59694e33d1099511d20ef72f4fc6cfa87cd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 7 Jun 2022 21:19:26 -0400 Subject: Use a consistent scheme for enum sizes --- src/mac.m | 4 ++-- src/types.h | 2 +- src/win.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mac.m b/src/mac.m index 4f5c08f..90e4505 100644 --- a/src/mac.m +++ b/src/mac.m @@ -998,7 +998,7 @@ updateSizeHint(PuglView* const view, const PuglSizeHint hint) static void updateSizeHints(PuglView* const view) { - for (unsigned i = 0u; i <= PUGL_MAX_ASPECT; ++i) { + for (unsigned i = 0u; i < PUGL_NUM_SIZE_HINTS; ++i) { updateSizeHint(view, (PuglSizeHint)i); } } @@ -1542,7 +1542,7 @@ puglSetSizeHint(PuglView* const view, const PuglSpan width, const PuglSpan height) { - if ((unsigned)hint > (unsigned)PUGL_MAX_ASPECT) { + if ((unsigned)hint >= PUGL_NUM_SIZE_HINTS) { return PUGL_BAD_PARAMETER; } diff --git a/src/types.h b/src/types.h index aa028b1..dc2e29f 100644 --- a/src/types.h +++ b/src/types.h @@ -46,7 +46,7 @@ struct PuglViewImpl { PuglRect frame; PuglConfigureEvent lastConfigure; PuglHints hints; - PuglViewSize sizeHints[(unsigned)PUGL_MAX_ASPECT + 1u]; + PuglViewSize sizeHints[PUGL_NUM_SIZE_HINTS]; bool visible; }; diff --git a/src/win.c b/src/win.c index 2cf2781..02d5bdb 100644 --- a/src/win.c +++ b/src/win.c @@ -1127,7 +1127,7 @@ puglSetSizeHint(PuglView* const view, const PuglSpan width, const PuglSpan height) { - if ((unsigned)hint > (unsigned)PUGL_MAX_ASPECT) { + if ((unsigned)hint >= PUGL_NUM_SIZE_HINTS) { return PUGL_BAD_PARAMETER; } -- cgit v1.2.1