[xiph-commits] r19031 - trunk/vorbis/lib

tterribe at svn.xiph.org tterribe at svn.xiph.org
Tue Dec 3 11:20:50 PST 2013


Author: tterribe
Date: 2013-12-03 11:20:50 -0800 (Tue, 03 Dec 2013)
New Revision: 19031

Modified:
   trunk/vorbis/lib/block.c
   trunk/vorbis/lib/codebook.c
   trunk/vorbis/lib/floor0.c
   trunk/vorbis/lib/floor1.c
   trunk/vorbis/lib/os.h
   trunk/vorbis/lib/res0.c
   trunk/vorbis/lib/vorbisfile.c
Log:
Various warning fixes.

Some of these were introduced in r19028.
Others have been around much longer.


Modified: trunk/vorbis/lib/block.c
===================================================================
--- trunk/vorbis/lib/block.c	2013-12-03 18:54:01 UTC (rev 19030)
+++ trunk/vorbis/lib/block.c	2013-12-03 19:20:50 UTC (rev 19031)
@@ -771,14 +771,14 @@
       if(v->lW){
         if(v->W){
           /* large/large */
-          float *w=_vorbis_window_get(b->window[1]-hs);
+          const float *w=_vorbis_window_get(b->window[1]-hs);
           float *pcm=v->pcm[j]+prevCenter;
           float *p=vb->pcm[j];
           for(i=0;i<n1;i++)
             pcm[i]=pcm[i]*w[n1-i-1] + p[i]*w[i];
         }else{
           /* large/small */
-          float *w=_vorbis_window_get(b->window[0]-hs);
+          const float *w=_vorbis_window_get(b->window[0]-hs);
           float *pcm=v->pcm[j]+prevCenter+n1/2-n0/2;
           float *p=vb->pcm[j];
           for(i=0;i<n0;i++)
@@ -787,7 +787,7 @@
       }else{
         if(v->W){
           /* small/large */
-          float *w=_vorbis_window_get(b->window[0]-hs);
+          const float *w=_vorbis_window_get(b->window[0]-hs);
           float *pcm=v->pcm[j]+prevCenter;
           float *p=vb->pcm[j]+n1/2-n0/2;
           for(i=0;i<n0;i++)
@@ -796,7 +796,7 @@
             pcm[i]=p[i];
         }else{
           /* small/small */
-          float *w=_vorbis_window_get(b->window[0]-hs);
+          const float *w=_vorbis_window_get(b->window[0]-hs);
           float *pcm=v->pcm[j]+prevCenter;
           float *p=vb->pcm[j];
           for(i=0;i<n0;i++)
@@ -1035,7 +1035,7 @@
 
 }
 
-float *vorbis_window(vorbis_dsp_state *v,int W){
+const float *vorbis_window(vorbis_dsp_state *v,int W){
   vorbis_info *vi=v->vi;
   codec_setup_info *ci=vi->codec_setup;
   int hs=ci->halfrate_flag;

Modified: trunk/vorbis/lib/codebook.c
===================================================================
--- trunk/vorbis/lib/codebook.c	2013-12-03 18:54:01 UTC (rev 19030)
+++ trunk/vorbis/lib/codebook.c	2013-12-03 19:20:50 UTC (rev 19031)
@@ -450,7 +450,7 @@
       }
     }
   }else{
-    int i,j;
+    int i;
 
     for(i=0;i<n;){
       a[i++]=0.f;

Modified: trunk/vorbis/lib/floor0.c
===================================================================
--- trunk/vorbis/lib/floor0.c	2013-12-03 18:54:01 UTC (rev 19030)
+++ trunk/vorbis/lib/floor0.c	2013-12-03 19:20:50 UTC (rev 19031)
@@ -147,6 +147,9 @@
                                       vorbis_info_floor *i){
   vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
   vorbis_look_floor0 *look=_ogg_calloc(1,sizeof(*look));
+
+  (void)vd;
+
   look->m=info->order;
   look->ln=info->barkmap;
   look->vi=info;

Modified: trunk/vorbis/lib/floor1.c
===================================================================
--- trunk/vorbis/lib/floor1.c	2013-12-03 18:54:01 UTC (rev 19030)
+++ trunk/vorbis/lib/floor1.c	2013-12-03 19:20:50 UTC (rev 19031)
@@ -203,6 +203,8 @@
   vorbis_look_floor1 *look=_ogg_calloc(1,sizeof(*look));
   int i,j,n=0;
 
+  (void)vd;
+
   look->vi=info;
   look->n=info->postlist[1];
 

Modified: trunk/vorbis/lib/os.h
===================================================================
--- trunk/vorbis/lib/os.h	2013-12-03 18:54:01 UTC (rev 19030)
+++ trunk/vorbis/lib/os.h	2013-12-03 19:20:50 UTC (rev 19031)
@@ -135,9 +135,11 @@
 }
 
 static __inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){
+  (void)fpu;
 }
 
 static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
+  (void)fpu;
 }
 
 #endif /* Special MSVC 32 bit implementation */
@@ -156,9 +158,11 @@
 }
 
 static __inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){
+  (void)fpu;
 }
 
 static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
+  (void)fpu;
 }
 
 #endif /* Special MSVC x64 implementation */

Modified: trunk/vorbis/lib/res0.c
===================================================================
--- trunk/vorbis/lib/res0.c	2013-12-03 18:54:01 UTC (rev 19030)
+++ trunk/vorbis/lib/res0.c	2013-12-03 19:20:50 UTC (rev 19031)
@@ -390,8 +390,13 @@
   return(index);
 }
 
+#ifdef TRAIN_RES
 static int _encodepart(oggpack_buffer *opb,int *vec, int n,
                        codebook *book,long *acc){
+#else
+static int _encodepart(oggpack_buffer *opb,int *vec, int n,
+                       codebook *book){
+#endif
   int i,bits=0;
   int dim=book->dim;
   int step=n/dim;
@@ -534,12 +539,18 @@
 }
 
 static int _01forward(oggpack_buffer *opb,
-                      vorbis_block *vb,vorbis_look_residue *vl,
+                      vorbis_look_residue *vl,
                       int **in,int ch,
                       long **partword,
+#ifdef TRAIN_RES
                       int (*encode)(oggpack_buffer *,int *,int,
                                     codebook *,long *),
-                      int submap){
+                      int submap
+#else
+                      int (*encode)(oggpack_buffer *,int *,int,
+                                    codebook *)
+#endif
+){
   long i,j,k,s;
   vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
   vorbis_info_residue0 *info=look->info;
@@ -609,9 +620,8 @@
             codebook *statebook=look->partbooks[partword[j][i]][s];
             if(statebook){
               int ret;
+#ifdef TRAIN_RES
               long *accumulator=NULL;
-
-#ifdef TRAIN_RES
               accumulator=look->training_data[s][partword[j][i]];
               {
                 int l;
@@ -623,10 +633,12 @@
                     look->training_max[s][partword[j][i]]=samples[l];
                 }
               }
-#endif
-
               ret=encode(opb,in[j]+offset,samples_per_partition,
                          statebook,accumulator);
+#else
+              ret=encode(opb,in[j]+offset,samples_per_partition,
+                         statebook);
+#endif
 
               look->postbits+=ret;
               resbits[partword[j][i]]+=ret;
@@ -637,19 +649,6 @@
     }
   }
 
-  /*{
-    long total=0;
-    long totalbits=0;
-    fprintf(stderr,"%d :: ",vb->mode);
-    for(k=0;k<possible_partitions;k++){
-    fprintf(stderr,"%ld/%1.2g, ",resvals[k],(float)resbits[k]/resvals[k]);
-    total+=resvals[k];
-    totalbits+=resbits[k];
-    }
-
-    fprintf(stderr,":: %ld:%1.2g\n",total,(double)totalbits/total);
-    }*/
-
   return(0);
 }
 
@@ -729,12 +728,18 @@
 int res1_forward(oggpack_buffer *opb,vorbis_block *vb,vorbis_look_residue *vl,
                  int **in,int *nonzero,int ch, long **partword, int submap){
   int i,used=0;
+  (void)vb;
   for(i=0;i<ch;i++)
     if(nonzero[i])
       in[used++]=in[i];
 
   if(used){
-    return _01forward(opb,vb,vl,in,used,partword,_encodepart,submap);
+#ifdef TRAIN_RES
+    return _01forward(opb,vl,in,used,partword,_encodepart,submap);
+#else
+    (void)submap;
+    return _01forward(opb,vl,in,used,partword,_encodepart);
+#endif
   }else{
     return(0);
   }
@@ -795,7 +800,12 @@
   }
 
   if(used){
-    return _01forward(opb,vb,vl,&work,1,partword,_encodepart,submap);
+#ifdef TRAIN_RES
+    return _01forward(opb,vl,&work,1,partword,_encodepart,submap);
+#else
+    (void)submap;
+    return _01forward(opb,vl,&work,1,partword,_encodepart);
+#endif
   }else{
     return(0);
   }

Modified: trunk/vorbis/lib/vorbisfile.c
===================================================================
--- trunk/vorbis/lib/vorbisfile.c	2013-12-03 18:54:01 UTC (rev 19030)
+++ trunk/vorbis/lib/vorbisfile.c	2013-12-03 19:20:50 UTC (rev 19031)
@@ -2058,14 +2058,14 @@
   }
 }
 
-extern float *vorbis_window(vorbis_dsp_state *v,int W);
+extern const float *vorbis_window(vorbis_dsp_state *v,int W);
 
 static void _ov_splice(float **pcm,float **lappcm,
                        int n1, int n2,
                        int ch1, int ch2,
-                       float *w1, float *w2){
+                       const float *w1, const float *w2){
   int i,j;
-  float *w=w1;
+  const float *w=w1;
   int n=n1;
 
   if(n1>n2){
@@ -2173,7 +2173,7 @@
   vorbis_info *vi1,*vi2;
   float **lappcm;
   float **pcm;
-  float *w1,*w2;
+  const float *w1,*w2;
   int n1,n2,i,ret,hs1,hs2;
 
   if(vf1==vf2)return(0); /* degenerate case */
@@ -2227,7 +2227,7 @@
   vorbis_info *vi;
   float **lappcm;
   float **pcm;
-  float *w1,*w2;
+  const float *w1,*w2;
   int n1,n2,ch1,ch2,hs;
   int i,ret;
 
@@ -2288,7 +2288,7 @@
   vorbis_info *vi;
   float **lappcm;
   float **pcm;
-  float *w1,*w2;
+  const float *w1,*w2;
   int n1,n2,ch1,ch2,hs;
   int i,ret;
 



More information about the commits mailing list