[Files] New AmigaOne firmware available | ANN.lu |
Posted on 06-Oct-2004 12:44 GMT by Rik Sweeney | 226 comments View flat View list |
A news item on AmigaWorld.net states that Hyperion has released the update of U-Boot to 1.1.1
|
|
List of all comments to this article |
New AmigaOne firmware available : Comment 207 of 226 | ANN.lu |
Posted by Anonymous on 11-Oct-2004 17:54 GMT | In reply to Comment 206 (Mike Powell): Here's a typical fragment. Apparently people used to pay money for the program from which this extract is taken...
--------------------
Xlim=636;
Count=71;
while(Count<Xlim)
{
Temp=*(sampoint+Jum);
Tempw=Temp;
Tempw=Tempw >> 9;
Tempw=~Tempw;
Tempw=Tempw+78;
z[Count]=Tempw;
Jum=Jum+Jump;
Count++;
}
-------------------
What are Xlim and Count? Why the numbers 636, 71, and 78? Why a 9 bit right shift (and why not division by 512, if that's what is meant)? All undocumented. If we guess that Temp and Tempw are temporary values, not some magic which will be re-used much later in the rambling subroutine from which this extract was taken, why aren't they local to the block in which they are used?
Since Xlim is constant for the duration of the loop, why use a variable for this value 636 all? A named constant or pre-processor macro would also be a good place to explain the significane of the magic number.
The idiom is poor too. C has accumulator operators, so a competent native C programmer writes Jum += Jump; making the intention clear, rather than using the equivalent but less clear Jum = Jum + Jump. C includes a powerful for loop which is perfectly suited to the initialisation, stepping and conditional termination of a loop to be executed zero or more times, but this example uses a while loop instead. |
|
List of all comments to this article (continued) |
|
- User Menu
-
- About ANN archives
- The ANN archives is powered by #AmigaZeux. It was updated daily (news last: 22-Oct-2004; comments last: 18-May-2005).
ANN.lu was created, previously owned and maintained by Christian Kemp, www.ckemp.com.
- Contribute
- Not possible at this time!
- Search ANN archives
- Advanced search
- Hosting
- ANN.lu was hosted by Dreamhost. Sign up through this link, mention "ckemp" as referrer and he will get a 10% commission on any account you purchase.
Please show your appreciation for any past, present and future work on ANN.lu by making a contribution via PayPal.
|