fix some harmless warnings with LLVM with signed vs unsigned buffer types.

This commit is contained in:
Vincent Hanquez 2014-07-18 15:32:55 +01:00
parent a0ce598e37
commit 8562223d57
2 changed files with 19 additions and 18 deletions

View File

@ -52,24 +52,25 @@ static uint8_t S_table[] = {
0x31, 0x44, 0x50, 0xB4, 0x8F, 0xED, 0x1F, 0x1A, 0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14 0x31, 0x44, 0x50, 0xB4, 0x8F, 0xED, 0x1F, 0x1A, 0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14
}; };
#define UBYTES(s) ((uint8_t *) s)
static uint8_t *padding_table[] = { static uint8_t *padding_table[] = {
"", UBYTES(""),
"\x1", UBYTES("\x1"),
"\x2\x2", UBYTES("\x2\x2"),
"\x3\x3\x3", UBYTES("\x3\x3\x3"),
"\x4\x4\x4\x4", UBYTES("\x4\x4\x4\x4"),
"\x5\x5\x5\x5\x5", UBYTES("\x5\x5\x5\x5\x5"),
"\x6\x6\x6\x6\x6\x6", UBYTES("\x6\x6\x6\x6\x6\x6"),
"\x7\x7\x7\x7\x7\x7\x7", UBYTES("\x7\x7\x7\x7\x7\x7\x7"),
"\x8\x8\x8\x8\x8\x8\x8\x8", UBYTES("\x8\x8\x8\x8\x8\x8\x8\x8"),
"\x9\x9\x9\x9\x9\x9\x9\x9\x9", UBYTES("\x9\x9\x9\x9\x9\x9\x9\x9\x9"),
"\xa\xa\xa\xa\xa\xa\xa\xa\xa\xa", UBYTES("\xa\xa\xa\xa\xa\xa\xa\xa\xa\xa"),
"\xb\xb\xb\xb\xb\xb\xb\xb\xb\xb\xb", UBYTES("\xb\xb\xb\xb\xb\xb\xb\xb\xb\xb\xb"),
"\xc\xc\xc\xc\xc\xc\xc\xc\xc\xc\xc\xc", UBYTES("\xc\xc\xc\xc\xc\xc\xc\xc\xc\xc\xc\xc"),
"\xd\xd\xd\xd\xd\xd\xd\xd\xd\xd\xd\xd\xd", UBYTES("\xd\xd\xd\xd\xd\xd\xd\xd\xd\xd\xd\xd\xd"),
"\xe\xe\xe\xe\xe\xe\xe\xe\xe\xe\xe\xe\xe\xe", UBYTES("\xe\xe\xe\xe\xe\xe\xe\xe\xe\xe\xe\xe\xe\xe"),
"\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf", UBYTES("\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf\xf"),
"\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10" UBYTES("\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10")
}; };
static void md2_do_chunk(struct md2_ctx *ctx, uint8_t *buf) static void md2_do_chunk(struct md2_ctx *ctx, uint8_t *buf)

View File

@ -233,7 +233,7 @@ void cryptonite_sha512_init_t(struct sha512_ctx *ctx, int t)
ctx->h[i] ^= 0xa5a5a5a5a5a5a5a5ULL; ctx->h[i] ^= 0xa5a5a5a5a5a5a5a5ULL;
i = sprintf(buf, "SHA-512/%d", t); i = sprintf(buf, "SHA-512/%d", t);
cryptonite_sha512_update(ctx, buf, i); cryptonite_sha512_update(ctx, (uint8_t *) buf, i);
cryptonite_sha512_finalize(ctx, out); cryptonite_sha512_finalize(ctx, out);
/* re-init the context, otherwise len is changed */ /* re-init the context, otherwise len is changed */