From: Anthony Liguori <aliguori@linux.vnet.ibm.com>
To: Corentin Chary <corentincj@iksaif.net>
Cc: Adam Litke <agl@us.ibm.com>,
qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH 1/3] vnc: tight: don't forget last pixel in tight_encode_indexed_rect
Date: Tue, 01 Jun 2010 16:17:47 -0500 [thread overview]
Message-ID: <4C0578FB.90304@linux.vnet.ibm.com> (raw)
In-Reply-To: <1275426344-26549-2-git-send-email-corentincj@iksaif.net>
On 06/01/2010 04:05 PM, Corentin Chary wrote:
> A simple patch would have been to just remove count -= 1, but this
> one also replace the while (count--) with a for(i = 0; i< count; i++)
> which I believe is more easy to understand.
>
> Signed-off-by: Corentin Chary<corentincj@iksaif.net>
>
Applied all. Thanks.
Regards,
Anthony Liguori
> ---
> vnc-encoding-tight.c | 9 ++++-----
> 1 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/vnc-encoding-tight.c b/vnc-encoding-tight.c
> index 50be44e..c8effe6 100644
> --- a/vnc-encoding-tight.c
> +++ b/vnc-encoding-tight.c
> @@ -249,18 +249,16 @@ static void print_palette(const char *key, QObject *obj, void *opaque)
> uint##bpp##_t *src; \
> uint##bpp##_t rgb; \
> uint8_t key[6]; \
> - int rep = 0; \
> + int i, rep; \
> uint8_t idx; \
> \
> src = (uint##bpp##_t *) buf; \
> \
> - count -= 1; \
> - while (count--) { \
> + for (i = 0; i< count; i++) { \
> rgb = *src++; \
> rep = 0; \
> - while (count&& *src == rgb) { \
> - rep++, src++, count--; \
> + while (i< count&& *src == rgb) { \
> + rep++, src++, i++; \
> } \
> tight_palette_rgb2buf(rgb, bpp, key); \
> if (!qdict_haskey(palette, (char *)key)) { \
>
next prev parent reply other threads:[~2010-06-01 21:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-01 21:05 [Qemu-devel] [PATCH 0/3] Small tight fixes Corentin Chary
2010-06-01 21:05 ` [Qemu-devel] [PATCH 1/3] vnc: tight: don't forget last pixel in tight_encode_indexed_rect Corentin Chary
2010-06-01 21:17 ` Anthony Liguori [this message]
2010-06-01 21:05 ` [Qemu-devel] [PATCH 2/3] vnc: tight: don't forget the third color Corentin Chary
2010-06-01 21:05 ` [Qemu-devel] [PATCH 3/3] vnc: add missing target for vnc-encodings-*.o Corentin Chary
-- strict thread matches above, loose matches on Subject: below --
2010-05-19 7:24 [Qemu-devel] [PATCH v3 00/12] *** SUBJECT HERE *** Corentin Chary
2010-05-27 6:21 ` [Qemu-devel] [PATCH 1/3] vnc: tight: don't forget last pixel in tight_encode_indexed_rect Corentin Chary
2010-05-27 14:28 ` Richard Henderson
2010-06-01 21:01 ` Corentin Chary
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C0578FB.90304@linux.vnet.ibm.com \
--to=aliguori@linux.vnet.ibm.com \
--cc=agl@us.ibm.com \
--cc=agraf@suse.de \
--cc=corentincj@iksaif.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.