diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c
index 267f7c230377f2c742ebc7cdf8187e3763148d77..d1a6eabf2a7f9f8a491ede44d23204ecf885044d 100644
--- a/libavcodec/cyuv.c
+++ b/libavcodec/cyuv.c
@@ -37,7 +37,6 @@
 #include "avcodec.h"
 #include "dsputil.h"
 #include "mpegvideo.h"
-#include "bswap.h"
 
 
 typedef struct CyuvDecodeContext {
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 1d886c51fa99d2f35e03e8254347e719506f8371..a384b9ee14e6df1bab9db6eeec0a543192ba7f2e 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1484,7 +1484,7 @@ static void pred4x4_down_right_c(uint8_t *src, uint8_t *topright, int stride){
     src[2+0*stride]=
     src[3+1*stride]=(t0 + 2*t1 + t2 + 2)>>2;
     src[3+0*stride]=(t1 + 2*t2 + t3 + 2)>>2;
-};
+}
 
 static void pred4x4_down_left_c(uint8_t *src, uint8_t *topright, int stride){
     LOAD_TOP_EDGE    
@@ -1507,7 +1507,7 @@ static void pred4x4_down_left_c(uint8_t *src, uint8_t *topright, int stride){
     src[3+2*stride]=
     src[2+3*stride]=(t5 + t7 + 2*t6 + 2)>>2;
     src[3+3*stride]=(t6 + 3*t7 + 2)>>2;
-};
+}
 
 static void pred4x4_vertical_right_c(uint8_t *src, uint8_t *topright, int stride){
     const int lt= src[-1-1*stride];
@@ -1531,7 +1531,7 @@ static void pred4x4_vertical_right_c(uint8_t *src, uint8_t *topright, int stride
     src[3+1*stride]=(t1 + 2*t2 + t3 + 2)>>2;
     src[0+2*stride]=(lt + 2*l0 + l1 + 2)>>2;
     src[0+3*stride]=(l0 + 2*l1 + l2 + 2)>>2;
-};
+}
 
 static void pred4x4_vertical_left_c(uint8_t *src, uint8_t *topright, int stride){
     LOAD_TOP_EDGE    
@@ -1554,7 +1554,7 @@ static void pred4x4_vertical_left_c(uint8_t *src, uint8_t *topright, int stride)
     src[3+1*stride]=
     src[2+3*stride]=(t3 + 2*t4 + t5 + 2)>>2;
     src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
-};
+}
 
 static void pred4x4_horizontal_up_c(uint8_t *src, uint8_t *topright, int stride){
     LOAD_LEFT_EDGE    
@@ -1575,7 +1575,7 @@ static void pred4x4_horizontal_up_c(uint8_t *src, uint8_t *topright, int stride)
     src[2+2*stride]=
     src[2+3*stride]=
     src[3+3*stride]=l3;
-};
+}
     
 static void pred4x4_horizontal_down_c(uint8_t *src, uint8_t *topright, int stride){
     const int lt= src[-1-1*stride];
@@ -1599,7 +1599,7 @@ static void pred4x4_horizontal_down_c(uint8_t *src, uint8_t *topright, int strid
     src[3+3*stride]=(l0 + 2*l1 + l2 + 2)>>2;
     src[0+3*stride]=(l2 + l3 + 1)>>1;
     src[1+3*stride]=(l1 + 2*l2 + l3 + 2)>>2;
-};
+}
 
 static void pred16x16_vertical_c(uint8_t *src, int stride){
     int i;
diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c
index 7d41ef3b61155c2f4358e3ca13a3cffa5bfd3351..26058b19ee23ee0f95239379c205ed1410f6c092 100644
--- a/libavcodec/huffyuv.c
+++ b/libavcodec/huffyuv.c
@@ -1097,7 +1097,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
         char *p= avctx->stats_out;
         for(i=0; i<3; i++){
             for(j=0; j<256; j++){
-                sprintf(p, "%Ld ", s->stats[i][j]);
+                sprintf(p, "%llu ", s->stats[i][j]);
                 p+= strlen(p);
                 s->stats[i][j]= 0;
             }
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index a19f1d3ed0b8a1dcbe7d91ab735b82cee1ba7364..6a36c855899d4ce15038048c05bc7b96f3cddedb 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -747,14 +747,13 @@ static void yuv422p_to_yuv422(AVPicture *dst, AVPicture *src,
  cm[(((y) - 128) * FIX(127.0/112.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS]
 
 /* NOTE: the clamp is really necessary! */
-#define C_JPEG_TO_CCIR(y)\
-({\
-    int __y;\
-    __y = ((((y) - 128) * FIX(112.0/127.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS);\
-    if (__y < 16)\
-         __y = 16;\
-    __y;\
-})
+static inline int C_JPEG_TO_CCIR(int y) {
+    y = (((y - 128) * FIX(112.0/127.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS);
+    if (y < 16)
+	y = 16;
+    return y;
+}
+
 
 #define RGB_TO_Y(r, g, b) \
 ((FIX(0.29900) * (r) + FIX(0.58700) * (g) + \
@@ -1608,8 +1607,6 @@ static int avpicture_alloc(AVPicture *picture,
     void *ptr;
 
     size = avpicture_get_size(pix_fmt, width, height);
-    if (size < 0)
-        goto fail;
     ptr = av_malloc(size);
     if (!ptr)
         goto fail;
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index 327b24d0dad91d0c45e603786408a9b82fe4e715..0cf4118420694d1584077ff108b77d37e48233e7 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -26,7 +26,6 @@
 #include "avcodec.h"
 #include "dsputil.h"
 #include "mpegvideo.h"
-#include "bswap.h"
 
 #include "indeo3data.h"
 
diff --git a/libavcodec/libpostproc/postprocess.c b/libavcodec/libpostproc/postprocess.c
index 9d618d5285fe4219fe7e1bf58f0c1fb3cb57f4e1..a6c6645f693fe4462fdcec599a15bfefa2f23116 100644
--- a/libavcodec/libpostproc/postprocess.c
+++ b/libavcodec/libpostproc/postprocess.c
@@ -765,7 +765,7 @@ static void reallocBuffers(PPContext *c, int width, int height, int stride, int
 	reallocAlign((void **)&c->forcedQPTable, 8, mbWidth*sizeof(QP_STORE_T));
 }
 
-static void global_init(){
+static void global_init(void){
 	int i;
 	memset(clip_table, 0, 256);
 	for(i=256; i<512; i++)
diff --git a/libavcodec/svq1.c b/libavcodec/svq1.c
index dbebde0f7ddf6f339b374a2efbf3bd287c3760c3..507d7e2304d745c28dfd781b2c274d5c0cb8b3fa 100644
--- a/libavcodec/svq1.c
+++ b/libavcodec/svq1.c
@@ -37,7 +37,6 @@
 #include "avcodec.h"
 #include "dsputil.h"
 #include "mpegvideo.h"
-#include "bswap.h"
 #define bit_buffer_t GetBitContext
 
 static inline unsigned int get_bit_cache(GetBitContext *s){
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index e30fd72e8f28526daacc43614497f62f41471add..d15bb980346a7af0da752e7e193b96e6801a5ec7 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -199,7 +199,7 @@ static void pred4x4_down_left_svq3_c(uint8_t *src, uint8_t *topright, int stride
     src[3+2*stride]=
     src[2+3*stride]=
     src[3+3*stride]=(l3 + t3)>>1;
-};
+}
 
 static void pred16x16_plane_svq3_c(uint8_t *src, int stride){
     pred16x16_plane_compat_c(src, stride, 1);
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 227b4b5e4e2851731706793e968dbd356975ae09..8c529c53f107a5e336e7e2c7b11ad097b35128f8 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -84,7 +84,7 @@ void *__av_mallocz_static(void** location, unsigned int size)
     return ptr;
 }
 /* free all static arrays and reset pointers to 0 */
-void av_free_static()
+void av_free_static(void)
 {
     if (array_static)
     {
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 2039a40a4b4e67a64a52c787fe8dfb6bccafea03..91e6fbb111980b157c7daed1480f46a0a160ba4c 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -35,7 +35,6 @@
 #include "dsputil.h"
 #include "mpegvideo.h"
 #include "dsputil.h"
-#include "bswap.h"
 
 #include "vp3data.h"
 
diff --git a/libavformat/asf.c b/libavformat/asf.c
index e9826adb798d53be27855b47476bea330cf74b7d..602c3ef0f4212a585da6641b06d0e87c73592f06 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -993,7 +993,7 @@ static int asf_get_packet(AVFormatContext *s)
     int c = get_byte(pb);
     if (c != 0x82) {
         if (!url_feof(pb))
-	    printf("ff asf bad header %x  at:%Ld\n", c, url_ftell(pb));
+	    printf("ff asf bad header %x  at:%lld\n", c, url_ftell(pb));
 	return -EIO;
     }
     if ((c & 0x0f) == 2) { // always true for now
@@ -1220,7 +1220,7 @@ static int asf_read_close(AVFormatContext *s)
 
 static int asf_read_seek(AVFormatContext *s, int64_t pts)
 {
-    printf("SEEK TO %Ld", pts);
+    printf("SEEK TO %lld", pts);
     return -1;
 }
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 3d36225f618c1cdf5da61adbf344edfcd0261a0b..b2faff2f58e35ac98ac32fd27c29c6fa7842f75b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1369,7 +1369,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
     /* check MOV header */
     err = mov_read_default(mov, pb, atom);
     if (err<0 || (!mov->found_moov && !mov->found_mdat)) {
-	fprintf(stderr, "mov: header not found !!! (err:%d, moov:%d, mdat:%d) pos:%Ld\n",
+	fprintf(stderr, "mov: header not found !!! (err:%d, moov:%d, mdat:%d) pos:%lld\n",
 		err, mov->found_moov, mov->found_mdat, url_ftell(pb));
 	return -1;
     }