From 5c78b78108bca6fc0ff883eb178fa5c15d226039 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 22 Apr 2011 16:41:39 +0200 Subject: [PATCH] Move statements after declarations. 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 | 10 +++++++--- ogg_afh.c | 2 +- spx_common.c | 2 +- vss.c | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/fec.c b/fec.c index e5c2a3b8..2301cc8d 100644 --- 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]]; diff --git a/ogg_afh.c b/ogg_afh.c index 144a2690..46c7b084 100644 --- 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); diff --git a/spx_common.c b/spx_common.c index f9f1eb7e..3e7736a5 100644 --- a/spx_common.c +++ b/spx_common.c @@ -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 dfd80ebc..2068563c 100644 --- 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, -- 2.39.2