]> granicus.if.org Git - libexpat/commitdiff
Fix compiler warnings on Windows 64-bit
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 23 Jun 2017 08:39:26 +0000 (10:39 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 23 Jun 2017 08:40:05 +0000 (10:40 +0200)
Explicitly cast on integer downcasting to fix compiler warnings.

expat/lib/siphash.h

index 04a5de7d8f52fcd4a8f2be77eb9e4f46a9801404..e7df3367d35a27061e789567678bb7f9fa30f21b 100644 (file)
@@ -208,7 +208,7 @@ static struct siphash *sip24_update(struct siphash *H, const void *src, size_t l
 
 
 static uint64_t sip24_final(struct siphash *H) {
-       char left = H->p - H->buf;
+       char left = (char)(H->p - H->buf);
        uint64_t b = (H->c + left) << 56;
 
        switch (left) {
@@ -323,7 +323,7 @@ static int sip24_valid(void) {
        sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017");
 
        for (i = 0; i < sizeof in; ++i) {
-               in[i] = i;
+               in[i] = (unsigned char)i;
 
                if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i]))
                        return 0;