[yoshimi] Re: More firefighting :(

  • From: Will Godfrey <willgodfrey@xxxxxxxxxxxxxxx>
  • To: yoshimi@xxxxxxxxxxxxx
  • Date: Thu, 11 Feb 2016 17:39:03 +0000

Hi Kristian

Nice to see you here again :)

On Thu, 11 Feb 2016 15:57:48 +0100
Kristian Amlie <kristian@xxxxxxxxxx> wrote:

On 09. feb. 2016 00:03, Will Godfrey wrote:
I appears that yoshimi will fail on the upcoming gcc 6 compiler.

...

Is anyone experimenting with this yet? If so can give it a run through 
please to
see if I've got it right?

--- a/src/Effects/Alienwah.cpp
+++ b/src/Effects/Alienwah.cpp
@@ -70,7 +70,7 @@ void Alienwah::out(float *smpsl, float *smpsr)
         tmp = clfol * x + oldclfol * x1;
 
         out = tmp * oldl[oldk];
-        out.real() += (1 - abs(fb)) * smpsl[i] * pangainL;
+        out += (1 - abs(fb)) * smpsl[i] * pangainL;
 
         oldl[oldk] = out;
         float l = out.real() * 10.0f * (fb + 0.1f);
@@ -79,7 +79,7 @@ void Alienwah::out(float *smpsl, float *smpsr)
         tmp = clfor * x + oldclfor * x1;
 
         out = tmp * oldr[oldk];
-        out.real() += (1 - abs(fb)) * smpsr[i] * pangainR;
+        out += (1 - abs(fb)) * smpsr[i] * pangainR;
 
         oldr[oldk] = out;
         float r = out.real() * 10.0f * (fb + 0.1f);

AFAICS, all values you add are real values, so this should be both
programmatically and mathematically correct!

This was historical code. I don't really understand the reason it only faulted
when out.real() was used on the LH side. I haven't come across the term
'complex' before, and generally try to avoid changing unknowns!

--- a/src/Misc/CmdInterface.cpp
+++ b/src/Misc/CmdInterface.cpp
@@ -228,7 +228,7 @@ void CmdInterface::helpLoop(list<string>& msg, string 
*commands, int indent)
     while (commands[word] != "end")
     {
         left = commands[word];
-        msg.push_back(dent.assign<int>(indent, ' ') + left + 
blanks.assign<int>(spaces - left.length(), ' ') + "- " + commands[word + 
1]);
+        msg.push_back(dent.assign(indent, ' ') + left + 
blanks.assign(spaces - left.length(), ' ') + "- " + commands[word + 1]);
         word += 2;
     }
 }

To tell you the truth I don't understand how the old version ever worked
(probably a side effect of how the STL library is implemented in gcc),
so the new one is definitely more correct!

This was taken from code given as an example for using 'assign'. I didn't
understand it myself, but it worked so I didn't investigate further - I
probably should have!

Thanks for looking at these :)

-- 
Will J Godfrey
http://www.musically.me.uk
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.
Yoshimi source code is available from either: 
http://sourceforge.net/projects/yoshimi
Or: https://github.com/Yoshimi/yoshimi
Our list archive is at: https://www.freelists.org/archive/yoshimi
To post, email to yoshimi@xxxxxxxxxxxxx

Other related posts: