From e075bff1fe6a36953125b9468b7d12fc97f7e1b0 Mon Sep 17 00:00:00 2001 From: Choe Hwanjin Date: Sun, 4 Apr 2021 11:24:51 +0900 Subject: Remove compiler warnings with -Wpedantic (#44) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pedantic 옵션을 추가했을 때 발생하는 워닝을 제거한다. 다른 워닝이 발생하는 곳도 같이 수정한다. https://github.com/libhangul/libhangul/issues/44 --- hangul/hangul.h | 2 +- hangul/hangulinputcontext.c | 4 ++-- test/hangul.c | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hangul/hangul.h b/hangul/hangul.h index dcafcd4..36156db 100644 --- a/hangul/hangul.h +++ b/hangul/hangul.h @@ -23,7 +23,7 @@ #include #ifdef __GNUC__ -#define LIBHANGUL_DEPRECATED __attribute__((deprecated)); +#define LIBHANGUL_DEPRECATED __attribute__((deprecated)) #else #define LIBHANGUL_DEPRECATED #endif diff --git a/hangul/hangulinputcontext.c b/hangul/hangulinputcontext.c index d8d93f6..cd54945 100644 --- a/hangul/hangulinputcontext.c +++ b/hangul/hangulinputcontext.c @@ -1411,10 +1411,10 @@ void hangul_ic_connect_callback(HangulInputContext* hic, const char* event, return; if (strcasecmp(event, "translate") == 0) { - hic->on_translate = (HangulOnTranslate)callback; + *(void**)(&hic->on_translate) = callback; hic->on_translate_data = user_data; } else if (strcasecmp(event, "transition") == 0) { - hic->on_transition = (HangulOnTransition)callback; + *(void**)(&hic->on_transition) = callback; hic->on_transition_data = user_data; } } diff --git a/test/hangul.c b/test/hangul.c index cbaf38f..797c14d 100644 --- a/test/hangul.c +++ b/test/hangul.c @@ -46,6 +46,7 @@ void ucs4_to_utf8(char *buf, const ucschar *ucs4, size_t bufsize) outbuf = buf; outbytesleft = bufsize; ret = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + (void)ret; iconv_close(cd); -- cgit v1.2.1