diff --git a/src/conf.c b/src/conf.c
index 0c6c695f..6253fb9e 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -227,7 +227,7 @@ static char *readline(FILE * fp, char *buf, size_t buflen) {
 	if(feof(fp))
 		return NULL;
 
-	p = fgets(buf, buflen, fp);
+	p = fgets(buf, (int)buflen, fp);
 
 	if(!p)
 		return NULL;
@@ -255,7 +255,7 @@ config_t *parse_config_line(char *line, const char *fname, int lineno) {
 	while(strchr("\t ", *--eol))
 		*eol = '\0';
 
-	len = strcspn(value, "\t =");
+	len = (int)strcspn(value, "\t =");
 	value += len;
 	value += strspn(value, "\t ");
 	if(*value == '=') {
diff --git a/src/hash.c b/src/hash.c
index 91fc3d67..7836e51e 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -28,8 +28,8 @@ static uint32_t hash_function(const void *p, size_t len) {
 	const uint8_t *q = p;
 	uint32_t hash = 0;
 	while(true) {
-		for(int i = len > 4 ? 4 : len; --i;)
-			hash += q[len - i] << (8 * i);
+		for(size_t i = len > 4 ? 4 : len; --i;)
+			hash += (uint32_t)(q[len - i] << (8 * i));
 		hash *= 0x9e370001UL; // Golden ratio prime.
 		if(len <= 4)
 			break;
diff --git a/src/meta.c b/src/meta.c
index 9038ff85..35672a78 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -142,7 +142,7 @@ bool receive_meta_sptps(void *handle, uint8_t type, const void *vdata, uint16_t
 }
 
 bool receive_meta(connection_t *c) {
-	int inlen;
+	ssize_t inlen;
 	char inbuf[MAXBUFSIZE];
 	char *bufp = inbuf, *endp;