From 1dce4defe62b5e0ed70460b52c444dc51a701e18 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 22 Jan 2025 18:42:11 -0500 Subject: Make puglSetSizeHint() consistent with puglSetSize() In general, it's more convenient to have full-width integers as parameters, since C will promote any arithmetic on smaller types to them anyway. Using narrow types here, then, doesn't really make anything stricter, just forces an annoying cast when lots of warnings are enabled, which is likely unchecked. Better to handle it here, since it's more convenient, and the integer range checks the compiler can do aren't correct anyway (the max width/height is intentionally smaller than the max PuglSpan, so it can fit in a signed 16-bit integer). --- src/internal.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/internal.h') diff --git a/src/internal.h b/src/internal.h index 3721c10..f978074 100644 --- a/src/internal.h +++ b/src/internal.h @@ -34,6 +34,13 @@ puglSetBlob(PuglBlob* dest, const void* data, size_t len); void puglSetString(char** dest, const char* string); +/// Store `width` and `height` as the current value of a size `hint` +PuglStatus +puglStoreSizeHint(PuglView* view, + PuglSizeHint hint, + unsigned width, + unsigned height); + /// Handle a changed string property PUGL_API PuglStatus -- cgit v1.2.1