modlfo / teensy-vult-example

An example of generating Vult code compatible with the Teensy Audio Library
22 stars 0 forks source link

Declaration of 'fix16_t time' shadows a parameter #1

Closed DatanoiseTV closed 8 years ago

DatanoiseTV commented 8 years ago

When using blit.vult from the examples, the Arduino IDE compilation process fails with:

SynthTest.cpp: In function 'fix16_t Phasedist_delay(Phasedist__ctx_type_12&, fix16_t, fix16_t, fix16_t)':
SynthTest.cpp:234: error: declaration of 'fix16_t time' shadows a parameter
    fix16_t time = fix_clip(time,0x0 /* 0.000000 */,0x10000 /* 1.000000 */);
            ^
SynthTest.cpp:235: error: declaration of 'fix16_t feedback' shadows a parameter
    fix16_t feedback = fix_clip(feedback,0x0 /* 0.000000 */,0x10000 /* 1.000000 */);
            ^
declaration of 'fix16_t time' shadows a parameter
modlfo commented 8 years ago

I could not reproduce it. But seems that maybe there's a double declaration of the variables time and feedback. Maybe something like:

val time;
.....
val time = clip(...);

I will add a check in Vult for those cases. Send me the code if you can and I'll check it.

modlfo commented 8 years ago

Now Vult check for duplicated variables. Update and let me know if that was the problem.

modlfo commented 8 years ago

I found the problem some time ago and I fixed it. The problem was some code like this:

fun(time,...){
   val time = ...
}

Time was an argument and was being declared later.