Hi all, I'd like to suggest the following: use GNU getopt() for the command line options (--optionArgument is just greatly confusing: --option Argument is so much nicer, and you get rid of all the else if() in chuck_main. (plus I can offer my help in converting chuck_main to getopt(), if you want me to go ahead) Your next_power_2() function seems to waste loads of cycles, although this doesn't really matter, as it is only used at startup, but wouldn't that be a nice feature for the language anyway? Try: /* Thanks to music-dsp mailing-list */ inline unsigned nextPowerOfTwo (unsigned n) { unsigned prevN; for (prevN = n; n &= n-1; prevN = n) ; return (prevN * 2); } much faster... Cheers, Niklas -- Computer Music PhD-student University of Waikato Hamilton New Zealand
On Jul 26, 2004, at 7:29 PM, Niklas Werner wrote:
I'd like to suggest the following:
use GNU getopt() for the command line options (--optionArgument is just greatly confusing: --option Argument is so much nicer, and you get rid of all the else if() in chuck_main.
good idea - how standard is getopt()? --option Argument is certainly better. if it is very standard (or we can contain getopt in distribution), then we should look into use it.
Your next_power_2() function seems to waste loads of cycles, although this doesn't really matter, as it is only used at startup, but wouldn't that be a nice feature for the language anyway?
you are right. the code that you posted is integrated - also added to ulib_math. Thanks Niklas. Ge!
On Jul 26, 2004, at 7:29 PM, Niklas Werner wrote:
I'd like to suggest the following:
use GNU getopt() for the command line options (--optionArgument is just greatly confusing: --option Argument is so much nicer, and you get rid of all the else if() in chuck_main.
good idea - how standard is getopt()? --option Argument is certainly better. if it is very standard (or we can contain getopt in distribution), then we should look into use it. Linux: always there included in glibc, everybody uses it. OSX: you need to ship getopt.h(6.4kB) with your code to be sure it's
On Tue, 27 Jul 2004 13:29, Ge Wang wrote: there, otherwise it just works, doesn't need linking an additional library. Windoze: Who knows? Who cares? (certainly not me... ;-) ) Cheers, Niklas -- Computer Music PhD-student University of Waikato Hamilton New Zealand
participants (2)
-
Ge Wang
-
Niklas Werner