mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Fix build for Visual Studio (explicitly cast pointers) (#10256)
This commit is contained in:
parent
542df11bed
commit
d22fd6fc34
@ -301,7 +301,7 @@
|
|||||||
|
|
||||||
int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len)
|
int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len)
|
||||||
{
|
{
|
||||||
const unsigned char *data = data_;
|
const unsigned char *data = (const unsigned char *)data_;
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
HASH_LONG l;
|
HASH_LONG l;
|
||||||
size_t n;
|
size_t n;
|
||||||
|
@ -18,13 +18,13 @@ const char SHA256_version[] = "SHA-256" OPENSSL_VERSION_PTEXT;
|
|||||||
unsigned static char cleanse_ctr = 0;
|
unsigned static char cleanse_ctr = 0;
|
||||||
static void OPENSSL_cleanse(void *ptr, size_t len)
|
static void OPENSSL_cleanse(void *ptr, size_t len)
|
||||||
{
|
{
|
||||||
unsigned char *p = ptr;
|
unsigned char *p = (unsigned char *)ptr;
|
||||||
size_t loop = len, ctr = cleanse_ctr;
|
size_t loop = len, ctr = cleanse_ctr;
|
||||||
while (loop--) {
|
while (loop--) {
|
||||||
*(p++) = (unsigned char)ctr;
|
*(p++) = (unsigned char)ctr;
|
||||||
ctr += (17 + ((size_t)p & 0xF));
|
ctr += (17 + ((size_t)p & 0xF));
|
||||||
}
|
}
|
||||||
p = memchr(ptr, (unsigned char)ctr, len);
|
p = (unsigned char *)memchr(ptr, (unsigned char)ctr, len);
|
||||||
if (p)
|
if (p)
|
||||||
ctr += (63 + (size_t)p);
|
ctr += (63 + (size_t)p);
|
||||||
cleanse_ctr = (unsigned char)ctr;
|
cleanse_ctr = (unsigned char)ctr;
|
||||||
@ -262,7 +262,7 @@ static void sha256_block_data_order(SHA256_CTX *ctx, const void *in,
|
|||||||
unsigned MD32_REG_T a, b, c, d, e, f, g, h, s0, s1, T1;
|
unsigned MD32_REG_T a, b, c, d, e, f, g, h, s0, s1, T1;
|
||||||
SHA_LONG X[16];
|
SHA_LONG X[16];
|
||||||
int i;
|
int i;
|
||||||
const unsigned char *data = in;
|
const unsigned char *data = (const unsigned char *)in;
|
||||||
const union {
|
const union {
|
||||||
long one;
|
long one;
|
||||||
char little;
|
char little;
|
||||||
|
Loading…
Reference in New Issue
Block a user