diff options
author | bapt <bapt@FreeBSD.org> | 2015-11-08 21:22:24 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-11-08 21:22:24 +0000 |
commit | 6dbf9b92d94ac99671a10ceaa84bb4958ad2ed75 (patch) | |
tree | 4819a8e0a53faba407f6a39090d329f869a316b7 /usr.bin/localedef | |
parent | ca880ab120ce2001e8093d26dc5ea27ad36f053a (diff) | |
download | FreeBSD-src-6dbf9b92d94ac99671a10ceaa84bb4958ad2ed75.zip FreeBSD-src-6dbf9b92d94ac99671a10ceaa84bb4958ad2ed75.tar.gz |
Eliminate some gcc pragmas
Diffstat (limited to 'usr.bin/localedef')
-rw-r--r-- | usr.bin/localedef/collate.c | 11 | ||||
-rw-r--r-- | usr.bin/localedef/wide.c | 13 |
2 files changed, 7 insertions, 17 deletions
diff --git a/usr.bin/localedef/collate.c b/usr.bin/localedef/collate.c index 7e64e6a..91c9ec6 100644 --- a/usr.bin/localedef/collate.c +++ b/usr.bin/localedef/collate.c @@ -435,24 +435,19 @@ subst_compare(const void *n1, const void *n2) RB_GENERATE_STATIC(substs, subst, entry, subst_compare); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" - static int subst_compare_ref(const void *n1, const void *n2) { - int32_t *c1 = ((subst_t *)n1)->ref; - int32_t *c2 = ((subst_t *)n2)->ref; + const wchar_t *c1 = ((const subst_t *)n1)->ref; + const wchar_t *c2 = ((const subst_t *)n2)->ref; int rv; - rv = wcscmp((wchar_t *)c1, (wchar_t *)c2); + rv = wcscmp(c1, c2); return ((rv < 0) ? -1 : (rv > 0) ? 1 : 0); } RB_GENERATE_STATIC(substs_ref, subst, entry_ref, subst_compare_ref); -#pragma GCC diagnostic pop - void init_collate(void) { diff --git a/usr.bin/localedef/wide.c b/usr.bin/localedef/wide.c index d51b51f..7102eb5 100644 --- a/usr.bin/localedef/wide.c +++ b/usr.bin/localedef/wide.c @@ -310,15 +310,12 @@ tomb_utf8(char *mb, wchar_t wc) * 0x8000 - 0xffff - 2 byte encoding */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" - static int towide_dbcs(wchar_t *wc, const char *mb, unsigned n) { wchar_t c; - c = *(uint8_t *)mb; + c = *(const uint8_t *)mb; if ((c & 0x80) == 0) { /* 7-bit */ @@ -408,7 +405,7 @@ towide_gb18030(wchar_t *wc, const char *mb, unsigned n) { wchar_t c; - c = *(uint8_t *)mb; + c = *(const uint8_t *)mb; if ((c & 0x80) == 0) { /* 7-bit */ @@ -451,7 +448,7 @@ towide_mskanji(wchar_t *wc, const char *mb, unsigned n) { wchar_t c; - c = *(uint8_t *)mb; + c = *(const uint8_t *)mb; if ((c < 0x80) || ((c > 0xa0) && (c < 0xe0))) { /* 7-bit */ @@ -487,7 +484,7 @@ towide_euc_impl(wchar_t *wc, const char *mb, unsigned n, int width = 2; wchar_t c; - c = *(uint8_t *)mb; + c = *(const uint8_t *)mb; /* * All variations of EUC encode 7-bit ASCII as one byte, and use @@ -528,8 +525,6 @@ towide_euc_impl(wchar_t *wc, const char *mb, unsigned n, return (width); } -#pragma GCC diagnostic pop - /* * EUC-CN encodes as follows: * |