summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2021-04-04 11:24:51 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2021-04-04 11:39:06 +0900
commit5d1c7a77e6153227701fc906d3611b15e5b390ee (patch)
tree012d444d4912bd842f4da6d22b8760892373e052
parent2ddc547f014afdc25b73a2f26f28b70728d79105 (diff)
downloadlibhangul-5d1c7a77e6153227701fc906d3611b15e5b390ee.tar.gz
Remove compiler warnings with -Wpedantic (#44)
pedantic 옵션을 추가했을 때 발생하는 워닝을 제거한다. 다른 워닝이 발생하는 곳도 같이 수정한다. https://github.com/libhangul/libhangul/issues/44
-rw-r--r--hangul/hangul.h2
-rw-r--r--hangul/hangulinputcontext.c4
-rw-r--r--test/hangul.c1
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 <inttypes.h>
#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);