From 4ddf624e6e37252e6b71dabdea147d5feb353dac Mon Sep 17 00:00:00 2001
From: dsmudhar <ds.mudhar@gmail.com>
Date: Sat, 21 May 2016 19:27:13 +0530
Subject: [PATCH] fixed few compiler warnings

---
 libavcodec/cfhd.c           | 6 +++---
 libavcodec/dv_tablegen.c    | 2 +-
 libavfilter/af_hdcd.c       | 2 +-
 libavfilter/vf_hwdownload.c | 6 ++++--
 libavutil/opencl.c          | 2 +-
 5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index d82eab8..d15cd8d 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -343,7 +343,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
             }
             av_log(avctx, AV_LOG_DEBUG, "Transform-type? %"PRIu16"\n", data);
         } else if (abstag >= 0x4000 && abstag <= 0x40ff) {
-            av_log(avctx, AV_LOG_DEBUG, "Small chunk length %"PRIu16" %s\n", data * 4, tag < 0 ? "optional" : "required");
+            av_log(avctx, AV_LOG_DEBUG, "Small chunk length %d %s\n", data * 4, tag < 0 ? "optional" : "required");
             bytestream2_skipu(&gb, data * 4);
         } else if (tag == 23) {
             av_log(avctx, AV_LOG_DEBUG, "Skip frame\n");
@@ -469,7 +469,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
                 goto end;
             }
 
-            av_log(avctx, AV_LOG_DEBUG, "Start of lowpass coeffs component %"PRIu16" height:%d, width:%d\n", s->channel_num, lowpass_height, lowpass_width);
+            av_log(avctx, AV_LOG_DEBUG, "Start of lowpass coeffs component %d height:%d, width:%d\n", s->channel_num, lowpass_height, lowpass_width);
             for (i = 0; i < lowpass_height; i++) {
                 for (j = 0; j < lowpass_width; j++)
                     coeff_data[j] = bytestream2_get_be16u(&gb);
@@ -487,7 +487,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
                        lowpass_width * sizeof(*coeff_data));
             }
 
-            av_log(avctx, AV_LOG_DEBUG, "Lowpass coefficients %"PRIu16"\n", lowpass_width * lowpass_height);
+            av_log(avctx, AV_LOG_DEBUG, "Lowpass coefficients %d\n", lowpass_width * lowpass_height);
         }
 
         if (tag == 55 && s->subband_num_actual != 255 && s->a_width && s->a_height) {
diff --git a/libavcodec/dv_tablegen.c b/libavcodec/dv_tablegen.c
index 2579341..d032101 100644
--- a/libavcodec/dv_tablegen.c
+++ b/libavcodec/dv_tablegen.c
@@ -27,7 +27,7 @@
 #include <inttypes.h>
 
 WRITE_1D_FUNC_ARGV(dv_vlc_pair, 7,
-                   "{0x%"PRIx32", %"PRId8"}", data[i].vlc, data[i].size)
+                   "{0x%"PRIx32", %"PRIu32"}", data[i].vlc, data[i].size)
 WRITE_2D_FUNC(dv_vlc_pair)
 
 int main(void)
diff --git a/libavfilter/af_hdcd.c b/libavfilter/af_hdcd.c
index 041b89f..fbf0836 100644
--- a/libavfilter/af_hdcd.c
+++ b/libavfilter/af_hdcd.c
@@ -893,7 +893,7 @@ static int integrate(hdcd_state_t *state, int *flag, const int32_t *samples, int
         state->code_counterC++;
     } else {
         if (bits)
-            state->readahead = readaheadtab[bits & ~(-1 << 8)];
+            state->readahead = readaheadtab[bits & ~((unsigned) -1 << 8)];
         else
             state->readahead = 31; /* ffwd over digisilence */
     }
diff --git a/libavfilter/vf_hwdownload.c b/libavfilter/vf_hwdownload.c
index 2dcc9fa..79ea82d 100644
--- a/libavfilter/vf_hwdownload.c
+++ b/libavfilter/vf_hwdownload.c
@@ -56,8 +56,10 @@ static int hwdownload_query_formats(AVFilterContext *avctx)
         }
     }
 
-    ff_formats_ref(infmts,  &avctx->inputs[0]->out_formats);
-    ff_formats_ref(outfmts, &avctx->outputs[0]->in_formats);
+    if ((err = ff_formats_ref(infmts,  &avctx->inputs[0]->out_formats)) < 0 ||
+        (err = ff_formats_ref(outfmts, &avctx->outputs[0]->in_formats)) < 0)
+        return err;
+
     return 0;
 }
 
diff --git a/libavutil/opencl.c b/libavutil/opencl.c
index 08b5034..af35770 100644
--- a/libavutil/opencl.c
+++ b/libavutil/opencl.c
@@ -445,7 +445,7 @@ cl_program av_opencl_compile(const char *program_name, const char *build_opts)
     int i;
     cl_int status, build_status;
     int kernel_code_idx = 0;
-    const char *kernel_source;
+    const char *kernel_source = NULL;
     size_t kernel_code_len;
     char* ptr = NULL;
     cl_program program = NULL;
-- 
2.7.4 (Apple Git-66)

