* grub-core/video/readers/jpeg.c: Use unsigned where appropriate.

This commit is contained in:
Vladimir Serbinenko 2013-10-25 20:35:02 +02:00
parent fb56391ee3
commit 74ff2c0501
2 changed files with 12 additions and 7 deletions

View file

@ -1,3 +1,7 @@
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/video/readers/jpeg.c: Use unsigned where appropriate.
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com> 2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/zfs/zfs.c (xor_out): Use unsigned modular arithmetics * grub-core/fs/zfs/zfs.c (xor_out): Use unsigned modular arithmetics

View file

@ -80,8 +80,8 @@ struct grub_jpeg_data
struct grub_video_bitmap **bitmap; struct grub_video_bitmap **bitmap;
grub_uint8_t *bitmap_ptr; grub_uint8_t *bitmap_ptr;
int image_width; unsigned image_width;
int image_height; unsigned image_height;
grub_uint8_t *huff_value[4]; grub_uint8_t *huff_value[4];
int huff_offset[4][16]; int huff_offset[4][16];
@ -94,9 +94,9 @@ struct grub_jpeg_data
jpeg_data_unit_t crdu; jpeg_data_unit_t crdu;
jpeg_data_unit_t cbdu; jpeg_data_unit_t cbdu;
int vs, hs; unsigned vs, hs;
int dri; int dri;
int r1; unsigned r1;
int dc_value[3]; int dc_value[3];
@ -613,7 +613,7 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data)
static grub_err_t static grub_err_t
grub_jpeg_decode_data (struct grub_jpeg_data *data) grub_jpeg_decode_data (struct grub_jpeg_data *data)
{ {
int c1, vb, hb, nr1, nc1; unsigned c1, vb, hb, nr1, nc1;
int rst = data->dri; int rst = data->dri;
vb = data->vs * 8; vb = data->vs * 8;
@ -626,7 +626,7 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data)
for (c1 = 0; c1 < nc1 && (!data->dri || rst); for (c1 = 0; c1 < nc1 && (!data->dri || rst);
c1++, rst--, data->bitmap_ptr += hb * 3) c1++, rst--, data->bitmap_ptr += hb * 3)
{ {
int r2, c2, nr2, nc2; unsigned r2, c2, nr2, nc2;
grub_uint8_t *ptr2; grub_uint8_t *ptr2;
for (r2 = 0; r2 < data->vs; r2++) for (r2 = 0; r2 < data->vs; r2++)
@ -649,7 +649,8 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data)
for (r2 = 0; r2 < nr2; r2++, ptr2 += (data->image_width - nc2) * 3) for (r2 = 0; r2 < nr2; r2++, ptr2 += (data->image_width - nc2) * 3)
for (c2 = 0; c2 < nc2; c2++, ptr2 += 3) for (c2 = 0; c2 < nc2; c2++, ptr2 += 3)
{ {
int i0, yy; unsigned i0;
int yy;
i0 = (r2 / data->vs) * 8 + (c2 / data->hs); i0 = (r2 / data->vs) * 8 + (c2 / data->hs);
yy = data->ydu[(r2 / 8) * 2 + (c2 / 8)][(r2 % 8) * 8 + (c2 % 8)]; yy = data->ydu[(r2 / 8) * 2 + (c2 / 8)][(r2 % 8) * 8 + (c2 % 8)];