Skip to content

Commit

Permalink
contrib/vhost-user-gpu: Fix compiler warning when compiling with -Wsh…
Browse files Browse the repository at this point in the history
…adow

Rename some variables to avoid compiler warnings when compiling
with -Wshadow=local.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20231009083726.30301-1-thuth@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
  • Loading branch information
huth authored and Markus Armbruster committed Oct 12, 2023
1 parent 9e7d339 commit cc46a7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions contrib/vhost-user-gpu/vhost-user-gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,19 +834,19 @@ 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,
p + offsetof(VhostUserGpuMsg,
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);
}
Expand Down
8 changes: 4 additions & 4 deletions contrib/vhost-user-gpu/vugpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 vugpufillcmd_s_ = \
iov_to_buf(cmd->elem.out_sg, cmd->elem.out_num, 0, \
&out, sizeof(out)); \
if (s != sizeof(out)) { \
if (vugpufillcmd_s_ != sizeof(out)) { \
g_critical("%s: command size incorrect %zu vs %zu", \
__func__, s, sizeof(out)); \
__func__, vugpufillcmd_s_, sizeof(out)); \
return; \
} \
} while (0)
Expand Down

0 comments on commit cc46a7e

Please sign in to comment.