diff options
author | David Robillard <d@drobilla.net> | 2019-06-29 18:15:28 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-06-29 18:15:28 +0200 |
commit | d34e0eb19db33b32644544207bd38908c8e35f68 (patch) | |
tree | 59f75ae37b1b9171d50cde6dc86bbbb161dd94a1 /pugl/pugl_internal.h | |
parent | b81dbe03ac16e4c5ccf3bcfd6795f476299a3852 (diff) | |
download | pugl-d34e0eb19db33b32644544207bd38908c8e35f68.tar.gz pugl-d34e0eb19db33b32644544207bd38908c8e35f68.tar.bz2 pugl-d34e0eb19db33b32644544207bd38908c8e35f68.zip |
Fix various warnings
Diffstat (limited to 'pugl/pugl_internal.h')
-rw-r--r-- | pugl/pugl_internal.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pugl/pugl_internal.h b/pugl/pugl_internal.h index 46e9d9d..05381fa 100644 --- a/pugl/pugl_internal.h +++ b/pugl/pugl_internal.h @@ -48,6 +48,9 @@ puglDefaultHints(void) PuglView* puglInit(int* pargc, char** argv) { + (void)pargc; + (void)argv; + PuglView* view = (PuglView*)calloc(1, sizeof(PuglView)); if (!view) { return NULL; @@ -210,7 +213,7 @@ puglSetEventFunc(PuglView* view, PuglEventFunc eventFunc) } /** Return the code point for buf, or the replacement character on error. */ -static uint32_t +static inline uint32_t puglDecodeUTF8(const uint8_t* buf) { #define FAIL_IF(cond) { if (cond) return 0xFFFD; } @@ -223,12 +226,12 @@ puglDecodeUTF8(const uint8_t* buf) return 0xFFFD; } else if (buf[0] < 0xE0) { FAIL_IF((buf[1] & 0xC0) != 0x80); - return (buf[0] << 6) + buf[1] - 0x3080; + return (buf[0] << 6) + buf[1] - 0x3080u; } else if (buf[0] < 0xF0) { FAIL_IF((buf[1] & 0xC0) != 0x80); FAIL_IF(buf[0] == 0xE0 && buf[1] < 0xA0); FAIL_IF((buf[2] & 0xC0) != 0x80); - return (buf[0] << 12) + (buf[1] << 6) + buf[2] - 0xE2080; + return (buf[0] << 12) + (buf[1] << 6) + buf[2] - 0xE2080u; } else if (buf[0] < 0xF5) { FAIL_IF((buf[1] & 0xC0) != 0x80); FAIL_IF(buf[0] == 0xF0 && buf[1] < 0x90); @@ -238,7 +241,7 @@ puglDecodeUTF8(const uint8_t* buf) return ((buf[0] << 18) + (buf[1] << 12) + (buf[2] << 6) + - buf[3] - 0x3C82080); + buf[3] - 0x3C82080u); } return 0xFFFD; } |