Fix compilation with older compilers.

* grub-core/Makefile.core.def (mpi): Add mpi-inline.c.
	* grub-core/lib/libgcrypt_wrap/cipher_wrap.h: Remove redundant
	declarations.
	* grub-core/lib/posix_wrap/string.h: Include sys/types.h.
	* grub-core/lib/posix_wrap/sys/types.h: Add common types.
	* grub-core/lib/xzembed/xz_dec_lzma2.c (dict_put): Replace byte
	identifier with b.
	* grub-core/lib/xzembed/xz_dec_stream.c (dec_vli): Likewise.
	* include/grub/crypto.h: Add type defines.
	* util/import_gcrypth.sed: Remove duplicate type defines.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-01-13 21:06:25 +01:00
parent adcc602041
commit 4a9950ecb0
9 changed files with 39 additions and 17 deletions

View file

@ -197,20 +197,20 @@ static bool fill_temp(struct xz_dec *s, struct xz_buf *b)
static enum xz_ret dec_vli(struct xz_dec *s,
const uint8_t *in, size_t *in_pos, size_t in_size)
{
uint8_t byte;
uint8_t b;
if (s->pos == 0)
s->vli = 0;
while (*in_pos < in_size) {
byte = in[*in_pos];
b = in[*in_pos];
++*in_pos;
s->vli |= (vli_type)(byte & 0x7F) << s->pos;
s->vli |= (vli_type)(b & 0x7F) << s->pos;
if ((byte & 0x80) == 0) {
if ((b & 0x80) == 0) {
/* Don't allow non-minimal encodings. */
if (byte == 0 && s->pos != 0)
if (b == 0 && s->pos != 0)
return XZ_DATA_ERROR;
s->pos = 0;