diff options
author | David Robillard <d@drobilla.net> | 2023-05-03 10:25:01 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-05-03 10:25:01 -0400 |
commit | 3932b6bb06a0fe28a990d4906b4e9ca77764a729 (patch) | |
tree | f4e27a3bc90b28bd8a54c7d86469dc0cc27ae86e /src | |
parent | e578e0d8b44eadc53084249dbc06052e6458ede9 (diff) | |
download | pugl-3932b6bb06a0fe28a990d4906b4e9ca77764a729.tar.gz pugl-3932b6bb06a0fe28a990d4906b4e9ca77764a729.tar.bz2 pugl-3932b6bb06a0fe28a990d4906b4e9ca77764a729.zip |
Fix tautological unsigned comparisons
Diffstat (limited to 'src')
-rw-r--r-- | src/common.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common.c b/src/common.c index eafb07a..6f1e017 100644 --- a/src/common.c +++ b/src/common.c @@ -87,7 +87,7 @@ puglSetWorldString(PuglWorld* const world, const PuglStringHint key, const char* const value) { - if ((unsigned)key < 0 || (unsigned)key >= PUGL_NUM_STRING_HINTS) { + if ((unsigned)key >= PUGL_NUM_STRING_HINTS) { return PUGL_BAD_PARAMETER; } @@ -98,7 +98,7 @@ puglSetWorldString(PuglWorld* const world, const char* puglGetWorldString(const PuglWorld* const world, const PuglStringHint key) { - if ((unsigned)key < 0 || (unsigned)key >= PUGL_NUM_STRING_HINTS) { + if ((unsigned)key >= PUGL_NUM_STRING_HINTS) { return NULL; } @@ -238,7 +238,7 @@ puglSetViewHint(PuglView* view, PuglViewHint hint, int value) } } - if (hint >= 0 && hint < PUGL_NUM_VIEW_HINTS) { + if ((unsigned)hint < PUGL_NUM_VIEW_HINTS) { view->hints[hint] = value; return PUGL_SUCCESS; } @@ -249,7 +249,7 @@ puglSetViewHint(PuglView* view, PuglViewHint hint, int value) int puglGetViewHint(const PuglView* view, PuglViewHint hint) { - if (hint >= 0 && hint < PUGL_NUM_VIEW_HINTS) { + if ((unsigned)hint < PUGL_NUM_VIEW_HINTS) { return view->hints[hint]; } @@ -261,7 +261,7 @@ puglSetViewString(PuglView* const view, const PuglStringHint key, const char* const value) { - if ((unsigned)key < 0 || (unsigned)key >= PUGL_NUM_STRING_HINTS) { + if ((unsigned)key >= PUGL_NUM_STRING_HINTS) { return PUGL_BAD_PARAMETER; } @@ -272,7 +272,7 @@ puglSetViewString(PuglView* const view, const char* puglGetViewString(const PuglView* const view, const PuglStringHint key) { - if ((unsigned)key < 0 || (unsigned)key >= PUGL_NUM_STRING_HINTS) { + if ((unsigned)key >= PUGL_NUM_STRING_HINTS) { return NULL; } |