]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
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 e5c2a3b83e005c8596e6bcf951702bc3cb2cf5e1..2301cc8d2d4653b8bc82a8bcc46b5867b5d7af14 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 144a2690bf80da24d298ab2bb56c5403835157dc..46c7b084c0ba7b8aaf22683ba5897f94532f9db2 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 f9f1eb7e0958465d02e5f7bccbb6fa50eb10c379..3e7736a506ba6423afad4817a64e747f354e468d 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 dfd80ebcb817526c6e0c5c4f62eeb07ae6fc9375..2068563cf557d9531b84f508cb869d16120e584c 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,