Merge branch 'master' into phcoder/ports/alpha

This commit is contained in:
Vladimir Serbinenko committed 2013-10-25 23:27:18 +02:00
commit 3f170e4e73
3 files changed
+20 -8

No files matched your search

+11
View File
@@ -1,3 +1,14 @@
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/normal/cmdline.c (grub_history_get): Make argument into
unsigned.
(grub_history_replace): Likewise.
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/raid6_recover.c: Use unsigned arithmetics when
appropriate.
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com> 2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/video/bitmap_scale.c: Use unsigned arithmetics when * grub-core/video/bitmap_scale.c: Use unsigned arithmetics when
+7 -6
View File
@@ -30,11 +30,11 @@ GRUB_MOD_LICENSE ("GPLv3+");
/* x**y. */ /* x**y. */
static grub_uint8_t powx[255 * 2]; static grub_uint8_t powx[255 * 2];
/* Such an s that x**s = y */ /* Such an s that x**s = y */
static int powx_inv[256]; static unsigned powx_inv[256];
static const grub_uint8_t poly = 0x1d; static const grub_uint8_t poly = 0x1d;
static void static void
grub_raid_block_mulx (int mul, char *buf, int size) grub_raid_block_mulx (unsigned mul, char *buf, int size)
{ {
int i; int i;
grub_uint8_t *p; grub_uint8_t *p;
@@ -48,7 +48,7 @@ grub_raid_block_mulx (int mul, char *buf, int size)
static void static void
grub_raid6_init_table (void) grub_raid6_init_table (void)
{ {
int i; unsigned i;
grub_uint8_t cur = 1; grub_uint8_t cur = 1;
for (i = 0; i < 255; i++) for (i = 0; i < 255; i++)
@@ -148,7 +148,7 @@ grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p,
else else
{ {
/* Two bad devices */ /* Two bad devices */
int c; unsigned c;
if (grub_diskfilter_read_node (&array->nodes[p], sector, if (grub_diskfilter_read_node (&array->nodes[p], sector,
size >> GRUB_DISK_SECTOR_BITS, buf)) size >> GRUB_DISK_SECTOR_BITS, buf))
@@ -162,10 +162,11 @@ grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p,
grub_crypto_xor (qbuf, qbuf, buf, size); grub_crypto_xor (qbuf, qbuf, buf, size);
c = (255 - bad1 + (255 - powx_inv[(powx[bad2 - bad1 + 255] ^ 1)])) % 255; c = ((255 ^ bad1)
+ (255 ^ powx_inv[(powx[bad2 + (bad1 ^ 255)] ^ 1)])) % 255;
grub_raid_block_mulx (c, qbuf, size); grub_raid_block_mulx (c, qbuf, size);
c = (bad2 + c) % 255; c = ((unsigned) bad2 + c) % 255;
grub_raid_block_mulx (c, pbuf, size); grub_raid_block_mulx (c, pbuf, size);
grub_crypto_xor (pbuf, pbuf, qbuf, size); grub_crypto_xor (pbuf, pbuf, qbuf, size);
+2 -2
View File
@@ -92,7 +92,7 @@ grub_set_history (int newsize)
/* Get the entry POS from the history where `0' is the newest /* Get the entry POS from the history where `0' is the newest
entry. */ entry. */
static grub_uint32_t * static grub_uint32_t *
grub_history_get (int pos) grub_history_get (unsigned pos)
{ {
pos = (hist_pos + pos) % hist_size; pos = (hist_pos + pos) % hist_size;
return hist_lines[pos]; return hist_lines[pos];
@@ -154,7 +154,7 @@ grub_history_add (grub_uint32_t *s, grub_size_t len)
/* Replace the history entry on position POS with the string S. */ /* Replace the history entry on position POS with the string S. */
static void static void
grub_history_replace (int pos, grub_uint32_t *s, grub_size_t len) grub_history_replace (unsigned pos, grub_uint32_t *s, grub_size_t len)
{ {
grub_history_set ((hist_pos + pos) % hist_size, s, len); grub_history_set ((hist_pos + pos) % hist_size, s, len);
} }