[FFmpeg-cvslog] Fix "mixed declarations and code" warnings.

Carl Eugen Hoyos git at videolan.org
Wed Jun 8 16:38:52 CEST 2011


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Wed Jun  8 16:38:37 2011 +0200| [9e4cb03a93593f8ddb8b4ea3c7ee3bf8acb7ea21] | committer: Carl Eugen Hoyos

Fix "mixed declarations and code" warnings.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e4cb03a93593f8ddb8b4ea3c7ee3bf8acb7ea21
---

 libavcodec/j2kdec.c   |    5 ++---
 libavcodec/qtrleenc.c |    6 ++++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c
index 2497a2e..73af6a7 100644
--- a/libavcodec/j2kdec.c
+++ b/libavcodec/j2kdec.c
@@ -692,6 +692,8 @@ static int decode_cblk(J2kDecoderContext *s, J2kCodingStyle *codsty, J2kT1Contex
                        int width, int height, int bandpos)
 {
     int passno = cblk->npasses, pass_t = 2, bpno = cblk->nonzerobits - 1, y, clnpass_cnt = 0;
+    int bpass_csty_symbol = J2K_CBLK_BYPASS & codsty->cblk_style;
+    int vert_causal_ctx_csty_symbol = J2K_CBLK_VSC & codsty->cblk_style;
 
     for (y = 0; y < height+2; y++)
         memset(t1->flags[y], 0, (width+2)*sizeof(int));
@@ -703,9 +705,6 @@ static int decode_cblk(J2kDecoderContext *s, J2kCodingStyle *codsty, J2kT1Contex
     cblk->data[cblk->length] = 0xff;
     cblk->data[cblk->length+1] = 0xff;
 
-    int bpass_csty_symbol = J2K_CBLK_BYPASS & codsty->cblk_style;
-    int vert_causal_ctx_csty_symbol = J2K_CBLK_VSC & codsty->cblk_style;
-
     while(passno--){
         switch(pass_t){
             case 0: decode_sigpass(t1, width, height, bpno+1, bandpos,
diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c
index d43ff7b..6258b14 100644
--- a/libavcodec/qtrleenc.c
+++ b/libavcodec/qtrleenc.c
@@ -231,10 +231,11 @@ static void qtrle_encode_line(QtrleEncContext *s, AVFrame *p, int line, uint8_t
         else if (rlecode > 0) {
             /* bulk copy */
             if (s->avctx->pix_fmt == PIX_FMT_GRAY8) {
+                int j;
                 // QT grayscale colorspace has 0=white and 255=black, we will
                 // ignore the palette that is included in the AVFrame because
                 // PIX_FMT_GRAY8 has defined color mapping
-                for (int j = 0; j < rlecode*s->pixel_size; ++j)
+                for (j = 0; j < rlecode*s->pixel_size; ++j)
                     bytestream_put_byte(buf, *(this_line + i*s->pixel_size + j) ^ 0xff);
             } else {
                 bytestream_put_buffer(buf, this_line + i*s->pixel_size, rlecode*s->pixel_size);
@@ -244,8 +245,9 @@ static void qtrle_encode_line(QtrleEncContext *s, AVFrame *p, int line, uint8_t
         else {
             /* repeat the bits */
             if (s->avctx->pix_fmt == PIX_FMT_GRAY8) {
+                int j;
                 // QT grayscale colorspace has 0=white and 255=black, ...
-                for (int j = 0; j < s->pixel_size; ++j)
+                for (j = 0; j < s->pixel_size; ++j)
                     bytestream_put_byte(buf, *(this_line + i*s->pixel_size + j) ^ 0xff);
             } else {
                 bytestream_put_buffer(buf, this_line + i*s->pixel_size, s->pixel_size);



More information about the ffmpeg-cvslog mailing list