aboutsummaryrefslogtreecommitdiffstats
path: root/src/internal.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-08 19:44:41 -0500
committerDavid Robillard <d@drobilla.net>2023-01-08 22:32:09 -0500
commit426222903151173637c9a49246c182e79618bf83 (patch)
tree536914cb50c2e6e32f32190d2e3b7c997cb01ca7 /src/internal.c
parentf1524acbd3e708d1764b7f1533d707b22254ae95 (diff)
downloadpugl-426222903151173637c9a49246c182e79618bf83.tar.gz
pugl-426222903151173637c9a49246c182e79618bf83.tar.bz2
pugl-426222903151173637c9a49246c182e79618bf83.zip
Use ensureHint pattern everywhere
Diffstat (limited to 'src/internal.c')
-rw-r--r--src/internal.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/internal.c b/src/internal.c
index 5549cbc..cfb444e 100644
--- a/src/internal.c
+++ b/src/internal.c
@@ -12,6 +12,14 @@
#include <stdlib.h>
#include <string.h>
+void
+puglEnsureHint(PuglView* const view, const PuglViewHint hint, const int value)
+{
+ if (view->hints[hint] == PUGL_DONT_CARE) {
+ view->hints[hint] = value;
+ }
+}
+
PuglStatus
puglSetBlob(PuglBlob* const dest, const void* const data, const size_t len)
{