diff options
author | Ian Osgood <iano@quirkster.com> | 2006-10-15 07:15:25 -0700 |
---|---|---|
committer | Ian Osgood <iano@quirkster.com> | 2006-10-15 07:15:25 -0700 |
commit | 5d6fee1cc806d7197ced2ad154cce5336ae7e914 (patch) | |
tree | 43a7228f4c2b8227e739725bb55aa546f747d0af /renderutil | |
parent | e09eb3ae2f7f98255ee722cc1c7555ff6f8c7b8b (diff) |
Oops, glyphcmds aren't in network byte order.
Diffstat (limited to 'renderutil')
-rw-r--r-- | renderutil/glyph.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/renderutil/glyph.c b/renderutil/glyph.c index dc6624f..1721cad 100644 --- a/renderutil/glyph.c +++ b/renderutil/glyph.c @@ -100,7 +100,7 @@ xcb_render_util_glyphs_8 ( uint32_t count, const uint8_t *glyphs ) { - _glyph_header_t header = { count, {0,0,0}, htons(dx), htons(dy) }; + _glyph_header_t header = { count, {0,0,0}, dx, dy }; if (count > 252) return; /* FIXME */ @@ -126,8 +126,7 @@ xcb_render_util_glyphs_16 ( uint32_t count, const uint16_t *glyphs ) { - uint16_t *current16; - _glyph_header_t header = { count, {0,0,0}, htons(dx), htons(dy) }; + _glyph_header_t header = { count, {0,0,0}, dx, dy }; if (count > 254) return; /* FIXME */ @@ -141,11 +140,8 @@ xcb_render_util_glyphs_16 ( memcpy(stream->current, &header, sizeof(header)); stream->current += 2; - current16 = (uint16_t *)stream->current; - while (count--) { - *current16++ = htons(*glyphs++); - } - stream->current += ((int)header.count*sizeof(*glyphs)+1)>>2; + memcpy(stream->current, glyphs, header.count*sizeof(*glyphs)); + stream->current += ((int)header.count*sizeof(*glyphs)+3)>>2; } void @@ -156,7 +152,7 @@ xcb_render_util_glyphs_32 ( uint32_t count, const uint32_t *glyphs ) { - _glyph_header_t header = { count, {0,0,0}, htons(dx), htons(dy) }; + _glyph_header_t header = { count, {0,0,0}, dx, dy }; if (count > 254) return; /* FIXME */ @@ -170,9 +166,8 @@ xcb_render_util_glyphs_32 ( memcpy(stream->current, &header, sizeof(header)); stream->current += 2; - while (count--) { - *stream->current++ = htonl(*glyphs++); - } + memcpy(stream->current, glyphs, header.count*sizeof(*glyphs)); + stream->current += header.count; } /* note: these glyph arrays must be swapped to network byte order */ @@ -192,7 +187,7 @@ xcb_render_util_change_glyphset ( memcpy(stream->current, &header, sizeof(header)); stream->current += 2; - *stream->current = htonl(glyphset); + *stream->current = glyphset; stream->current++; stream->current_glyphset = glyphset; |