Move statements after declarations.
authorAndre Noll <maan@systemlinux.org>
Fri, 22 Apr 2011 14:41:39 +0000 (16:41 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 15 May 2011 08:43:02 +0000 (10:43 +0200)
This gets rid of gcc warnings of the form

warning: ISO C90 forbids mixed declarations and code

when compiled with -Wdeclaration-after-statement.

fec.c
ogg_afh.c
spx_common.c
vss.c

diff --git a/fec.c b/fec.c
index e5c2a3b..2301cc8 100644 (file)
--- a/fec.c
+++ b/fec.c
@@ -182,11 +182,15 @@ static void generate_gf(void)
 static void addmul(unsigned char *dst1, const unsigned char *src1,
        unsigned char c, int sz)
 {
+       unsigned char *dst, *lim, *col;
+       const unsigned char *src = src1;
+
        if (c == 0)
                return;
-       unsigned char *dst = dst1, *lim = &dst[sz - UNROLL + 1],
-               *col = gf_mul_table[c];
-       const unsigned char *src = src1;
+
+       dst = dst1;
+       lim = &dst[sz - UNROLL + 1];
+       col = gf_mul_table[c];
 
        for (; dst < lim; dst += UNROLL, src += UNROLL) {
                dst[0] ^= col[src[0]];
index 144a269..46c7b08 100644 (file)
--- a/ogg_afh.c
+++ b/ogg_afh.c
@@ -116,8 +116,8 @@ static int vorbis_get_header_callback(ogg_packet *packet, int packet_num,
                return 1;
        }
        if (packet_num == 1) {
-               PARA_INFO_LOG("replacing metadata packet\n");
                ogg_packet replacement = *packet;
+               PARA_INFO_LOG("replacing metadata packet\n");
                replacement.packet = dummy_packet;
                replacement.bytes = sizeof(dummy_packet);
                ret = ogg_stream_packetin(&vghd->os, &replacement);
index f9f1eb7..3e7736a 100644 (file)
@@ -120,12 +120,12 @@ int spx_process_header(unsigned char *packet, long bytes,
        shi->nframes = h->frames_per_packet;
        shi->channels = h->nb_channels;
        if (shi->channels != 1) {
-               shi->stereo = (SpeexStereoState)SPEEX_STEREO_STATE_INIT;
                SpeexCallback callback = {
                        .callback_id = SPEEX_INBAND_STEREO,
                        .func = speex_std_stereo_request_handler,
                        .data = &shi->stereo,
                };
+               shi->stereo = (SpeexStereoState)SPEEX_STEREO_STATE_INIT;
                ret = spx_ctl(shi->state, SPEEX_SET_HANDLER, &callback);
                if (ret < 0)
                        goto out;
diff --git a/vss.c b/vss.c
index dfd80eb..2068563 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -541,6 +541,7 @@ static int setup_next_fec_group(struct fec_client *fc, struct vss_task *vsst)
        /* setup header slices */
        buf = vsst->header_buf;
        for (i = 0; i < g->num_header_slices; i++) {
+               uint32_t payload_size;
                if (buf + g->slice_bytes <= vsst->header_buf + vsst->header_len) {
                        fc->src_data[i] = (const unsigned char *)buf;
                        buf += g->slice_bytes;
@@ -551,8 +552,7 @@ static int setup_next_fec_group(struct fec_client *fc, struct vss_task *vsst)
                 * goes beyond the buffer. This slice will not be fully
                 * used.
                 */
-               uint32_t payload_size = vsst->header_buf
-                       + vsst->header_len - buf;
+               payload_size = vsst->header_buf + vsst->header_len - buf;
                memcpy(fc->extra_header_buf, buf, payload_size);
                if (payload_size < g->slice_bytes)
                        memset(fc->extra_header_buf + payload_size, 0,