diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2007-06-24 10:38:58 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2007-06-24 10:38:58 +0000 |
commit | 1daa2ff9a9874f452f733584f7f0a21053add244 (patch) | |
tree | 1a8df947bf2ce2182bdbe8377d1ec2ab9cb342b8 | |
parent | ff835de85e45a77c810d0f8dc7916ff0be677545 (diff) | |
download | libhubbub-1daa2ff9a9874f452f733584f7f0a21053add244.tar.gz libhubbub-1daa2ff9a9874f452f733584f7f0a21053add244.tar.bz2 |
Silence cast alignment warnings
svn path=/trunk/hubbub/; revision=3363
-rw-r--r-- | src/input/utf16_stream.c | 12 | ||||
-rw-r--r-- | src/utils/utf16.c | 16 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/input/utf16_stream.c b/src/input/utf16_stream.c index 05ba5d3..1d19a7e 100644 --- a/src/input/utf16_stream.c +++ b/src/input/utf16_stream.c @@ -376,7 +376,8 @@ uint32_t hubbub_utf16stream_cur_pos(hubbub_inputstream *stream, */ void hubbub_utf16stream_lowercase(hubbub_inputstream *stream) { - uint16_t *buf = (uint16_t *) (stream->buffer + stream->cursor); + uint16_t *buf = (uint16_t *) + ((void *) (stream->buffer + stream->cursor)); if (0x0041 <= buf[0] && buf[0] <= 0x005B) buf[0] += 0x0020; @@ -389,7 +390,8 @@ void hubbub_utf16stream_lowercase(hubbub_inputstream *stream) */ void hubbub_utf16stream_uppercase(hubbub_inputstream *stream) { - uint16_t *buf = (uint16_t *) (stream->buffer + stream->cursor); + uint16_t *buf = (uint16_t *) + ((void *) (stream->buffer + stream->cursor)); if (0x0061 <= buf[0] && buf[0] <= 0x007B) buf[0] -= 0x0020; @@ -472,8 +474,8 @@ int hubbub_utf16stream_compare_range_ci(hubbub_inputstream *stream, return 0; do { - c1 = *((uint16_t *) range1); - c2 = *((uint16_t *) range2); + c1 = *((uint16_t *) (void *) range1); + c2 = *((uint16_t *) (void *) range2); if ((0x0041 <= c1 && c1 <= 0x005B)) c1 |= 0x0020; @@ -530,7 +532,7 @@ int hubbub_utf16stream_compare_range_ascii(hubbub_inputstream *stream, return 1; /* arbitrary */ do { - c1 = *((uint16_t *) range); + c1 = *((uint16_t *) (void *) range); c2 = *data; range += 2; diff --git a/src/utils/utf16.c b/src/utils/utf16.c index 8d337e3..715be5c 100644 --- a/src/utils/utf16.c +++ b/src/utils/utf16.c @@ -27,7 +27,7 @@ inline hubbub_error hubbub_utf16_to_ucs4(const uint8_t *s, size_t len, uint32_t *ucs4, size_t *clen) { - const uint16_t *ss = (const uint16_t *) s; + const uint16_t *ss = (const uint16_t *) (const void *) s; if (s == NULL || ucs4 == NULL || clen == NULL) return HUBBUB_BADPARM; @@ -65,7 +65,7 @@ inline hubbub_error hubbub_utf16_to_ucs4(const uint8_t *s, size_t len, inline hubbub_error hubbub_utf16_from_ucs4(uint32_t ucs4, uint8_t *s, size_t *len) { - uint16_t *ss = (uint16_t *) s; + uint16_t *ss = (uint16_t *) (void *) s; uint32_t l = 0; if (s == NULL || len == NULL) @@ -97,8 +97,8 @@ inline hubbub_error hubbub_utf16_from_ucs4(uint32_t ucs4, uint8_t *s, inline hubbub_error hubbub_utf16_length(const uint8_t *s, size_t max, size_t *len) { - const uint16_t *ss = (const uint16_t *) s; - const uint16_t *end = (const uint16_t *) (s + max); + const uint16_t *ss = (const uint16_t *) (const void *) s; + const uint16_t *end = (const uint16_t *) (const void *) (s + max); int l = 0; if (s == NULL || len == NULL) @@ -128,7 +128,7 @@ inline hubbub_error hubbub_utf16_length(const uint8_t *s, size_t max, inline hubbub_error hubbub_utf16_char_byte_length(const uint8_t *s, size_t *len) { - const uint16_t *ss = (const uint16_t *) s; + const uint16_t *ss = (const uint16_t *) (const void *) s; if (s == NULL || len == NULL) return HUBBUB_BADPARM; @@ -153,7 +153,7 @@ inline hubbub_error hubbub_utf16_char_byte_length(const uint8_t *s, inline hubbub_error hubbub_utf16_prev(const uint8_t *s, uint32_t off, uint32_t *prevoff) { - const uint16_t *ss = (const uint16_t *) s; + const uint16_t *ss = (const uint16_t *) (const void *) s; if (s == NULL || prevoff == NULL) return HUBBUB_BADPARM; @@ -181,7 +181,7 @@ inline hubbub_error hubbub_utf16_prev(const uint8_t *s, uint32_t off, inline hubbub_error hubbub_utf16_next(const uint8_t *s, uint32_t len, uint32_t off, uint32_t *nextoff) { - const uint16_t *ss = (const uint16_t *) s; + const uint16_t *ss = (const uint16_t *) (const void *) s; if (s == NULL || off >= len || nextoff == NULL) return HUBBUB_BADPARM; @@ -209,7 +209,7 @@ inline hubbub_error hubbub_utf16_next(const uint8_t *s, uint32_t len, inline hubbub_error hubbub_utf16_next_paranoid(const uint8_t *s, uint32_t len, uint32_t off, uint32_t *nextoff) { - const uint16_t *ss = (const uint16_t *) s; + const uint16_t *ss = (const uint16_t *) (const void *) s; if (s == NULL || off >= len || nextoff == NULL) return HUBBUB_BADPARM; |