shithub: opus

Download patch

ref: 9656ca00900e6c7fce47a48fbe20dfe944c33170
parent: 766257109e7f3d85d85104d5a451403b629e4398
author: Jean-Marc Valin <[email protected]>
date: Fri Apr 11 13:23:01 EDT 2008

fixed three declaration-after-statement issues

--- a/libcelt/dump_modes.c
+++ b/libcelt/dump_modes.c
@@ -217,6 +217,7 @@
 {
    int i, nb;
    FILE *file;
+   CELTMode **m;
    if (argc%4 != 1)
    {
       fprintf (stderr, "must have a multiple of 4 arguments\n");
@@ -223,7 +224,6 @@
       return 1;
    }
    nb = (argc-1)/4;
-   CELTMode **m;
    m = malloc(nb*sizeof(CELTMode*));
    for (i=0;i<nb;i++)
    {
--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -321,7 +321,6 @@
 
 void EXPORT celt_mode_destroy(CELTMode *mode)
 {
-   mdct_clear(&mode->mdct);
 #ifndef STATIC_MODES
    int i;
    const celt_int16_t *prevPtr = NULL;
@@ -346,6 +345,7 @@
    mode->marker_end = MODEFREED;
    psydecay_clear(&mode->psy);
 #endif
+   mdct_clear(&mode->mdct);
    celt_free((CELTMode *)mode);
 }
 
--- a/libcelt/rate.c
+++ b/libcelt/rate.c
@@ -112,10 +112,10 @@
       {
          bits[i] = bits[i-1];
       } else {
+         int j;
          VARDECL(celt_uint64_t, u);
          SAVE_STACK;
          ALLOC(u, N, celt_uint64_t);
-         int j;
          /* FIXME: We could save memory here */
          bits[i] = celt_alloc(MAX_PULSES*sizeof(celt_int16_t));
          for (j=0;j<MAX_PULSES;j++)