diff options
Diffstat (limited to 'libqpdf/sph')
-rw-r--r-- | libqpdf/sph/md_helper.c | 4 | ||||
-rw-r--r-- | libqpdf/sph/sph_types.h | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libqpdf/sph/md_helper.c b/libqpdf/sph/md_helper.c index 5384f03f..829391a7 100644 --- a/libqpdf/sph/md_helper.c +++ b/libqpdf/sph/md_helper.c @@ -145,7 +145,7 @@ SPH_XCAT(sph_, HASH)(void *cc, const void *data, size_t len) clen = SPH_BLEN - current; if (clen > len) - clen = len; + clen = (unsigned)len; memcpy(sc->buf + current, data, clen); data = (const unsigned char *)data + clen; current += clen; @@ -257,7 +257,7 @@ SPH_XCAT(HASH, _addbits_and_close)(void *cc, { unsigned z; - z = 0x80 >> n; + z = 0x80U >> n; sc->buf[current ++] = ((ub & -z) | z) & 0xFF; } #endif diff --git a/libqpdf/sph/sph_types.h b/libqpdf/sph/sph_types.h index f434d8bb..e3b648c1 100644 --- a/libqpdf/sph/sph_types.h +++ b/libqpdf/sph/sph_types.h @@ -1337,8 +1337,8 @@ sph_bswap64(sph_u64 x) static SPH_INLINE void sph_enc16be(void *dst, unsigned val) { - ((unsigned char *)dst)[0] = (val >> 8); - ((unsigned char *)dst)[1] = val; + ((unsigned char *)dst)[0] = (unsigned char)(val >> 8); + ((unsigned char *)dst)[1] = (unsigned char)val; } static SPH_INLINE unsigned @@ -1351,8 +1351,8 @@ sph_dec16be(const void *src) static SPH_INLINE void sph_enc16le(void *dst, unsigned val) { - ((unsigned char *)dst)[0] = val; - ((unsigned char *)dst)[1] = val >> 8; + ((unsigned char *)dst)[0] = (unsigned char)val; + ((unsigned char *)dst)[1] = (unsigned char)(val >> 8); } static SPH_INLINE unsigned |