compiling with gcc -Wparentheses
Hi, This list doesn't show much traffic lately ... is it still active? I'd like to play around with chuck on my amd64 linux machine. The download page warned me that chuck isn't 64-bit clean at present and indeed, it coredumps. :-( I'd like to help make it 64-bit clean. As a first step, I'm trying to make it compile cleanly with "gcc -Wall". As a first pass to /that/, I looked at warnings generated by -Wparentheses. Below is my patch to avoid these warnings. Incidently: is this the right place to send patches? I'm working off the 1.2.1.3 sources. I'd prefer to work off the development stream if I could; is there any public access to it? Thanks, -Steve
Hi again, On Mon, Dec 28, 2009 at 03:56:55PM -0600, Steve M. Robbins wrote:
As a first pass to /that/, I looked at warnings generated by -Wparentheses. Below is my patch to avoid these warnings.
By the way, I'd /really/ appreciate it if a chuck developer would look at these three changes very carefully to make sure I've got the right semantics:
diff -u -r ../orig/chuck-1.2.1.3/src/chuck_shell.cpp src/chuck_shell.cpp --- ../orig/chuck-1.2.1.3/src/chuck_shell.cpp 2009-10-05 01:09:29.000000000 -0500 +++ src/chuck_shell.cpp 2009-12-28 15:07:20.000000000 -0600 @@ -1750,7 +1750,7 @@ for( ; i < len; i++ ) { vm_no = strtoul( argv[i].c_str(), NULL, 10 ); - if( vm_no == 0 && errno == EINVAL || caller->vms.size() <= vm_no || + if( (vm_no == 0 && errno == EINVAL) || caller->vms.size() <= vm_no || caller->vms[vm_no] == NULL ) { out += "error: invalid VM id: " + argv[i] + "\n";
diff -u -r ../orig/chuck-1.2.1.3/src/chuck_type.cpp src/chuck_type.cpp --- ../orig/chuck-1.2.1.3/src/chuck_type.cpp 2009-10-05 01:09:29.000000000 -0500 +++ src/chuck_type.cpp 2009-12-28 15:47:21.000000000 -0600 @@ -4201,9 +4201,8 @@ //----------------------------------------------------------------------------- t_CKBOOL type_engine_check_primitive( Chuck_Type * type ) { - return ( isa(type, &t_int) || isa(type, &t_float) || isa(type, &t_dur) || - isa(type, &t_time) ) || isa(type, &t_complex) || isa(type, &t_polar) - && ( type->array_depth == 0 ); + return ( isa(type, &t_int) || isa(type, &t_float) || isa(type, &t_dur) || isa(type, &t_time) ) + || ( ( isa(type, &t_complex) || isa(type, &t_polar) ) && ( type->array_depth == 0 ) ); } t_CKBOOL isprim( Chuck_Type * type ) { return type_engine_check_primitive( type ); }
diff -u -r ../orig/chuck-1.2.1.3/src/ugen_stk.cpp src/ugen_stk.cpp --- ../orig/chuck-1.2.1.3/src/ugen_stk.cpp 2009-10-05 01:09:29.000000000 -0500 +++ src/ugen_stk.cpp 2009-12-28 14:57:37.000000000 -0600 @@ -15461,8 +15461,9 @@ envelope.setTarget( norm * 2.0 ); else if (number == __SK_Breath_) // 2 blowFreqMod = norm * 0.5; - else if (number == __SK_Sustain_) // 64 + else if (number == __SK_Sustain_) { // 64 if (value < 1.0) subSample = 1; + } else std::cerr << "[chuck](via STK): Whistle: Undefined Control Number (" << number << ")!!" << std::endl;
Thanks, -Steve
On Mon, Dec 28, 2009 at 03:56:55PM -0600, Steve M. Robbins wrote:
I'd like to help make it 64-bit clean. As a first step, I'm trying to make it compile cleanly with "gcc -Wall".
I made some progress in this regard; the patches are here: http://www.sumost.ca/steve/software/chuck-1.2.1.3-patches.tar.gz Eventually, I came to the conclusion that the VM itself is storing pointers in integers, in which case it is not something I can do in an afternoon. So I'm switching to my 32bit machine for now ... Cheers, -Steve
participants (1)
-
Steve M. Robbins