From: Thomas Huth <thuth@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>
Subject: [PATCH] contrib/vhost-user-gpu: Fix compiler warning when compiling with -Wshadow
Date: Fri, 6 Oct 2023 19:35:18 +0200 [thread overview]
Message-ID: <20231006173518.539085-1-thuth@redhat.com> (raw)
Rename some variables to avoid compiler warnings when compiling
with -Wshadow=local.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
contrib/vhost-user-gpu/vugpu.h | 8 ++++----
contrib/vhost-user-gpu/vhost-user-gpu.c | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h
index 509b679f03..5cede45134 100644
--- a/contrib/vhost-user-gpu/vugpu.h
+++ b/contrib/vhost-user-gpu/vugpu.h
@@ -164,12 +164,12 @@ struct virtio_gpu_ctrl_command {
};
#define VUGPU_FILL_CMD(out) do { \
- size_t s; \
- s = iov_to_buf(cmd->elem.out_sg, cmd->elem.out_num, 0, \
+ size_t s_; \
+ s_ = iov_to_buf(cmd->elem.out_sg, cmd->elem.out_num, 0, \
&out, sizeof(out)); \
- if (s != sizeof(out)) { \
+ if (s_ != sizeof(out)) { \
g_critical("%s: command size incorrect %zu vs %zu", \
- __func__, s, sizeof(out)); \
+ __func__, s_, sizeof(out)); \
return; \
} \
} while (0)
diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c b/contrib/vhost-user-gpu/vhost-user-gpu.c
index aa304475a0..bb41758e34 100644
--- a/contrib/vhost-user-gpu/vhost-user-gpu.c
+++ b/contrib/vhost-user-gpu/vhost-user-gpu.c
@@ -834,7 +834,7 @@ vg_resource_flush(VuGpu *g,
.width = width,
.height = height,
};
- pixman_image_t *i =
+ pixman_image_t *img =
pixman_image_create_bits(pixman_image_get_format(res->image),
msg->payload.update.width,
msg->payload.update.height,
@@ -842,11 +842,11 @@ vg_resource_flush(VuGpu *g,
payload.update.data),
width * bpp);
pixman_image_composite(PIXMAN_OP_SRC,
- res->image, NULL, i,
+ res->image, NULL, img,
extents->x1, extents->y1,
0, 0, 0, 0,
width, height);
- pixman_image_unref(i);
+ pixman_image_unref(img);
vg_send_msg(g, msg, -1);
g_free(msg);
}
--
2.41.0
next reply other threads:[~2023-10-06 17:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 17:35 Thomas Huth [this message]
2023-10-08 6:47 ` [PATCH] contrib/vhost-user-gpu: Fix compiler warning when compiling with -Wshadow Marc-André Lureau
2023-10-08 8:54 ` Michael S. Tsirkin
2023-10-08 8:58 ` Michael S. Tsirkin
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=20231006173518.539085-1-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=armbru@redhat.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).