mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
clang: Don't compute absolute value of unsigned
Clang's warning on absolute-value. > red-record-qxl.c:297:39: error: taking the absolute value of unsigned > type 'uint32_t' (aka 'unsigned int') has no effect > bitmap_size = qxl->bitmap.y * abs(qxl->bitmap.stride); > ^ > red-record-qxl.c:297:39: note: remove the call to 'abs' since unsigned > values cannot be negative > bitmap_size = qxl->bitmap.y * abs(qxl->bitmap.stride); > ^~~ > red-replay-qxl.c:471:39: error: taking the absolute value of unsigned type > 'uint32_t' (aka 'unsigned int') has no effect > bitmap_size = qxl->bitmap.y * abs(qxl->bitmap.stride); > ^ > red-replay-qxl.c:471:39: note: remove the call to 'abs' since unsigned > values cannot be negative > bitmap_size = qxl->bitmap.y * abs(qxl->bitmap.stride); > ^~~ Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
4458cc372b
commit
e005e7017b
@ -294,7 +294,7 @@ static void red_record_image(FILE *fd, RedMemSlotInfo *slots, int group_id,
|
||||
fprintf(fd, "ents %d\n", qp->ents[i]);
|
||||
}
|
||||
}
|
||||
bitmap_size = qxl->bitmap.y * abs(qxl->bitmap.stride);
|
||||
bitmap_size = qxl->bitmap.y * qxl->bitmap.stride;
|
||||
if (qxl_flags & QXL_BITMAP_DIRECT) {
|
||||
red_record_image_data_flat(fd, slots, group_id,
|
||||
qxl->bitmap.data,
|
||||
|
||||
@ -468,7 +468,7 @@ static QXLImage *red_replay_image(SpiceReplay *replay, uint32_t flags)
|
||||
} else {
|
||||
qxl->bitmap.palette = 0;
|
||||
}
|
||||
bitmap_size = qxl->bitmap.y * abs(qxl->bitmap.stride);
|
||||
bitmap_size = qxl->bitmap.y * qxl->bitmap.stride;
|
||||
qxl->bitmap.data = 0;
|
||||
if (qxl_flags & QXL_BITMAP_DIRECT) {
|
||||
qxl->bitmap.data = QXLPHYSICAL_FROM_PTR(red_replay_image_data_flat(replay, &bitmap_size));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user