Re: Never executing loop in smallft.c

"Christophe Bouev" <[email protected]>
Newsgroups gmane.comp.multimedia.ogg.vorbis.devel
Message-ID <6F2ADDC93E224BDEB1BD955A0A6230D5@Workaholic>
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" <[email protected]>
To: <[email protected]>
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
> [email protected]
> http://lists.xiph.org/mailman/listinfo/vorbis-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.