[Vorbis-dev] Never executing loop in smallft.c

Christophe Bouev c.bouev at red.fr
Sun Apr 25 19:51:49 PDT 2010


I do not really know but I guess that because nq, among others, is an 
integer, you cannot say that nr will always be 0 (try it with n=5, nl=5, 
j=0, ntry=4 => nq=(int)5/4=1 => nr=5-4=1).

Good luck !

Chris


----- Original Message ----- 
From: "Fábio Furlanete" <ffurlanete at gmail.com>
To: <vorbis-dev at xiph.org>
Sent: Monday, April 26, 2010 4:14 AM
Subject: [Vorbis-dev] Never executing loop in smallft.c


> Hello list
>
> I've been studying libvorbis code and found a strange fragment in
> smallft.c:
>
> 38 static void drfti1(int n, float *wa, int *ifac){
> 39   static int ntryh[4] = { 4,2,3,5 };
> 40   static float tpi = 6.28318530717958648f;
> 41   float arg,argh,argld,fi;
> 42   int ntry=0,i,j=-1;
> 43   int k1, l1, l2, ib;
> 44   int ld, ii, ip, is, nq, nr;
> 45   int ido, ipm, nfm1;
> 46   int nl=n;
> 47   int nf=0;
> 48
> 49 L101:
> 50   j++;
> 51   if (j < 4)
> 52     ntry=ntryh[j];
> 53   else
> 54     ntry+=2;
> 55
> 56 L104:
> 57   nq=nl/ntry;
> 58   nr=nl-ntry*nq;
> 59   if (nr!=0) goto L101;
> ...
>
> As far as I can see, nr will always be 0, witch means that j will be
> also always 0 and ntry will have only the first value in ntryh.
>
> Is that correct?
>
> Best
>
>
>
> _______________________________________________
> Vorbis-dev mailing list
> Vorbis-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/vorbis-dev 





More information about the Vorbis-dev mailing list