Build code with -Wconversion.

--HG--
extra : convert_revision : ac2ea951cae1e739335e428e0fc4d0f90045b77d
This commit is contained in:
Juan RP 2009-04-11 16:15:06 +02:00
parent bd3484fa6b
commit 504e123044
3 changed files with 6 additions and 4 deletions

View File

@ -128,7 +128,7 @@ repoidx_addpkg(const char *file, const char *filename, const char *pkgdir)
continue;
}
propslen = archive_entry_size(entry);
propslen = (size_t)archive_entry_size(entry);
props = malloc(propslen);
if (props == NULL) {
rv = errno;

View File

@ -243,7 +243,8 @@ SHA256_Update(SHA256_CTX* context, const uint8_t *data, size_t len)
/* Sanity check: */
assert(context != NULL && data != NULL);
usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
usedspace =
(unsigned int)(context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
if (usedspace > 0) {
/* Calculate how much free space is available in the buffer */
freespace = SHA256_BLOCK_LENGTH - usedspace;
@ -292,7 +293,8 @@ SHA256_Final(sha2_byte digest[], SHA256_CTX* context)
/* If no digest buffer is passed, we don't bother doing this: */
if (digest != (sha2_byte*)0) {
usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
usedspace =
(unsigned int)(context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
#ifndef WORDS_BIGENDIAN
/* Convert FROM host byte order */
REVERSE64(context->bitcount,context->bitcount);

View File

@ -12,5 +12,5 @@ CPPFLAGS += -I$(TOPDIR)/include -D_BSD_SOURCE -D_XOPEN_SOURCE=600
CPPFLAGS += -D_GNU_SOURCE
WARNFLAGS ?= -pedantic -std=c99 -Wall -Wextra -Werror -Wshadow -Wformat=2
WARNFLAGS += -Wmissing-declarations -Wcomment -Wunused-macros -Wendif-labels
WARNFLAGS += -Wcast-qual -Wcast-align -Wsign-conversion
WARNFLAGS += -Wcast-qual -Wcast-align -Wconversion
CFLAGS += $(WARNFLAGS) -O2 -fPIC -DPIC