diff --git a/libavutil/md5.c b/libavutil/md5.c
index 2b5708100b91faf3e71c6a54cb5cd8870942a86b..330f318998290a3f255be9c9ac6acfe97e85dc29 100644
--- a/libavutil/md5.c
+++ b/libavutil/md5.c
@@ -62,15 +62,15 @@ static const uint32_t T[64] = {
         a += T[i];\
 \
         switch(i>>4){\
-        case 0: a += (d ^ b&(c^d)) + X[      i &15 ]; break;\
-        case 1: a += (c ^ d&(c^b)) + X[ (1+5*i)&15 ]; break;\
-        case 2: a += (b^c^d)       + X[ (5+3*i)&15 ]; break;\
-        case 3: a += (c^(b|~d))    + X[ (  7*i)&15 ]; break;\
+        case 0: a += (d ^ (b&(c^d))) + X[      i &15 ]; break;\
+        case 1: a += (c ^ (d&(c^b))) + X[ (1+5*i)&15 ]; break;\
+        case 2: a += (b^c^d)         + X[ (5+3*i)&15 ]; break;\
+        case 3: a += (c^(b|~d))      + X[ (  7*i)&15 ]; break;\
         }\
         a = b + (( a << t ) | ( a >> (32 - t) ));
 
 static void body(uint32_t ABCD[4], const uint32_t X[16]){
-    int i, t;
+    int t;
     unsigned int a= ABCD[3];
     unsigned int b= ABCD[2];
     unsigned int c= ABCD[1];
diff --git a/libavutil/md5.h b/libavutil/md5.h
index 72a92bd1d545a5cc8b665a6fcb73d03f5c4329e4..c8144b4ccefc5d4bbbe52a1d1ae5a5f79bb6ee87 100644
--- a/libavutil/md5.h
+++ b/libavutil/md5.h
@@ -1,7 +1,7 @@
 #ifndef MD5_H
 #define MD5_H
 
-extern const av_md5_size;
+extern const int av_md5_size;
 
 struct AVMD5;