I'm sure this is one of those lame mistakes, but...I'm trying to make a function call in main(), and the compiler is forming the access to the arguments all wrong. Here's a snippet of main():
#include <iostream>
#include <clock.h>
#include <SocReg.h>
#include <DemodShaperFilter.h>
usingnamespace std;
int main ()
{
int resetValue = 55; // just picked a number for testing.
DemodShaperFilter filter(resetValue);
bool clockEnable = HIGH;
/*
* arguments to drive the filter processing.
*/
int shaperCoeffI[NBR_CELLS];
int shaperCoeffQ[NBR_CELLS];
int combGainI, combGainQ;
int shaperOutI, shaperOutQ;
bool filterReset = LOW;
filter.cycle(combGainI,
shaperCoeffI,
combGainQ,
shaperCoeffQ,
&shaperOutI,
&shaperOutQ,
clockEnable,
filterReset);
return 0;
}
The function expects its parameters as: (int, int*, int, int*, int&, int&, bool, bool) and it appears that all is good on that end. But the compiler is giving me an error in main:
rror: no matching function for call to 'DemodShaperFilter::cycle(int&, int [32], int&, int [32], int*, int*, bool&, bool&)'
It's got all the parameters wrong from what I'm expecting. Any idea what I've done wrong here?
Axe the ampersands from lines 28 and 29. What you're basically going is fetching the addresses and making pointers out of them, and passing those to your function, hence the error. So...
Actually... it "malformed" only four: int&, int&, bool&, and bool&. If I had to guess I'd say it's either due to either an optimization or maybe because your function expects constant references instead of values?