Skip to content

Commit 8f52588

Browse files
authored
bpo-30726: expat: Fix compiler warnings on Windows 64-bit (#2368)
Explicitly cast on integer downcasting to fix compiler warnings. (cherry picked from libexpat commit 788bff7a3baad1983b15b17c29e19e1a1a795c48)
1 parent 50c2850 commit 8f52588

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/expat/siphash.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static struct siphash *sip24_update(struct siphash *H, const void *src, size_t l
198198

199199

200200
static uint64_t sip24_final(struct siphash *H) {
201-
char left = H->p - H->buf;
201+
char left = (char)(H->p - H->buf);
202202
uint64_t b = (H->c + left) << 56;
203203

204204
switch (left) {
@@ -313,7 +313,7 @@ static int sip24_valid(void) {
313313
sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017");
314314

315315
for (i = 0; i < sizeof in; ++i) {
316-
in[i] = i;
316+
in[i] = (unsigned char)i;
317317

318318
if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i]))
319319
return 0;

0 commit comments

Comments
 (0)