Removing dead code found by LLVM's static analysis
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Sun, 17 Oct 2010 20:25:56 +0000 (16:25 -0400)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Sun, 17 Oct 2010 20:25:56 +0000 (16:25 -0400)
libcelt/celt.c
libcelt/entdec.c
libcelt/mdct.c

index fc67db5..fcd4293 100644 (file)
@@ -704,7 +704,6 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, c
    transient_time = -1;
    transient_time_quant = -1;
    transient_shift = 0;
-   isTransient = 0;
 
    resynth = optional_resynthesis!=NULL;
 
@@ -743,7 +742,6 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, c
                in[C*i+c] *= gain_1;
 #endif
       }
-      has_fold = 1;
    }
 
    if (isTransient)
@@ -1352,7 +1350,6 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
    celt_sig *decode_mem[2];
    celt_sig *overlap_mem[2];
    celt_word16 *lpc;
-   celt_word16 *oldBandE;
    SAVE_STACK;
    
    for (c=0;c<C;c++)
@@ -1362,7 +1359,6 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
       overlap_mem[c] = decode_mem[c]+DECODE_BUFFER_SIZE;
    }
    lpc = (celt_word16*)(st->_decode_mem+(DECODE_BUFFER_SIZE+st->overlap)*C);
-   oldBandE = lpc+C*LPC_ORDER;
 
    len = N+st->mode->overlap;
    
index c57eee3..d7f4aa7 100644 (file)
@@ -61,21 +61,20 @@ int ec_byte_read1(ec_byte_buffer *_b){
 }
 
 ec_uint32 ec_dec_uint(ec_dec *_this,ec_uint32 _ft){
-  ec_uint32 t;
   unsigned  ft;
   unsigned  s;
   int       ftb;
-  t=0;
   /*In order to optimize EC_ILOG(), it is undefined for the value 0.*/
   celt_assert(_ft>1);
   _ft--;
   ftb=EC_ILOG(_ft);
   if(ftb>EC_UNIT_BITS){
+    ec_uint32 t;
     ftb-=EC_UNIT_BITS;
     ft=(unsigned)(_ft>>ftb)+1;
     s=ec_decode(_this,ft);
     ec_dec_update(_this,s,s+1,ft);
-    t=t<<EC_UNIT_BITS|s;
+    t=s;
     t = t<<ftb|ec_dec_bits(_this,ftb&(1<<ftb)-1);
     if (t>_ft)
     {
@@ -87,8 +86,7 @@ ec_uint32 ec_dec_uint(ec_dec *_this,ec_uint32 _ft){
     _ft++;
     s=ec_decode(_this,(unsigned)_ft);
     ec_dec_update(_this,s,s+1,(unsigned)_ft);
-    t=t<<ftb|s;
-    return t;
+    return s;
   }
 }
 
index 428a980..f7fd58b 100644 (file)
 void clt_mdct_init(mdct_lookup *l,int N, int maxshift)
 {
    int i;
-   int N2, N4;
+   int N4;
    kiss_twiddle_scalar *trig;
    l->n = N;
-   N2 = N>>1;
    N4 = N>>2;
    l->maxshift = maxshift;
    for (i=0;i<=maxshift;i++)