diff --git a/formats/format_wav.c b/formats/format_wav.c
index e9c4e4303f4cdb88bf01d204dc73be70f91f3eb2..194f8245803d7b288dfd7e8c2f96678624bc634a 100644
--- a/formats/format_wav.c
+++ b/formats/format_wav.c
@@ -350,7 +350,9 @@ static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext)
 {
 	int res;
 	int samples;	/* actual samples read */
+#if __BYTE_ORDER == __BIG_ENDIAN
 	int x;
+#endif
 	short *tmp;
 	int bytes = WAV_BUF_SIZE;	/* in bytes */
 	off_t here;
@@ -389,8 +391,8 @@ static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext)
 
 static int wav_write(struct ast_filestream *fs, struct ast_frame *f)
 {
-	int x;
 #if __BYTE_ORDER == __BIG_ENDIAN
+	int x;
 	short tmp[8000], *tmpi;
 #endif
 	struct wav_desc *s = (struct wav_desc *)fs->private;
diff --git a/main/http.c b/main/http.c
index 0dee18faaac3c4c592f78cdb7c0fe5fbc87a2e2c..7d33fc9707334aa8fc31a5ed34b516987f67c331 100644
--- a/main/http.c
+++ b/main/http.c
@@ -403,7 +403,7 @@ static void post_raw(struct mm_mimepart *part, const char *post_dir, const char
 	body_len = mm_mimepart_getlength(part);
 
 	if (option_debug)
-		ast_log(LOG_DEBUG, "Body length is %ld\n", body_len);
+		ast_log(LOG_DEBUG, "Body length is %ld\n", (long int)body_len);
 
 	fwrite(body, 1, body_len, f);