From c1e4ec68aa37718d7e472486c117a81d08363f14 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 1 Apr 2020 19:35:59 +0200 Subject: Add PUGL_BAD_PARAMETER status --- pugl/detail/implementation.c | 4 +++- pugl/pugl.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pugl/detail/implementation.c b/pugl/detail/implementation.c index d7f1413..1454899 100644 --- a/pugl/detail/implementation.c +++ b/pugl/detail/implementation.c @@ -60,6 +60,7 @@ puglStrerror(const PuglStatus status) case PUGL_FAILURE: return "Non-fatal failure"; case PUGL_UNKNOWN_ERROR: return "Unknown system error"; case PUGL_BAD_BACKEND: return "Invalid or missing backend"; + case PUGL_BAD_PARAMETER: return "Invalid parameter"; case PUGL_BACKEND_FAILED: return "Backend initialisation failed"; case PUGL_REGISTRATION_FAILED: return "Window class registration failed"; case PUGL_CREATE_WINDOW_FAILED: return "Window creation failed"; @@ -238,9 +239,10 @@ puglSetViewHint(PuglView* view, PuglViewHint hint, int value) { if (hint < PUGL_NUM_WINDOW_HINTS) { view->hints[hint] = value; + return PUGL_SUCCESS; } - return PUGL_SUCCESS; + return PUGL_BAD_PARAMETER; } PuglStatus diff --git a/pugl/pugl.h b/pugl/pugl.h index b09d883..8d0039e 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -482,6 +482,7 @@ typedef enum { PUGL_FAILURE, ///< Non-fatal failure PUGL_UNKNOWN_ERROR, ///< Unknown system error PUGL_BAD_BACKEND, ///< Invalid or missing backend + PUGL_BAD_PARAMETER, ///< Invalid parameter PUGL_BACKEND_FAILED, ///< Backend initialisation failed PUGL_REGISTRATION_FAILED, ///< Window class registration failed PUGL_CREATE_WINDOW_FAILED, ///< Window creation failed -- cgit v1.2.1