Hi Guys,
I just started using Pelles C, I been using C for a while now to program my ARM processors with another IDE. Manlly I plan to use Pelles C to test some of the more complicated parts of the programs as a sort of test bed.
I transferred a bit of code from the other IDE which is Eclipse based and with GCC compiler, and i am having a few problems with the function prototypes.
So, I have a Header file called "bufferHandler.h", I added an include on the C file bufferHandler.c and in main.c i.e. #include "bufferHandler.h"
I have this protypes on the header file:
void setupBufferStore();
MultiBuffer *getMultiBuffer();
int GetBufferOnQueue(int, MultiBuffer pBuffer);
and I declared in bufferHandler.c the fuctions:
void setupBufferStore()
{
int i = 0;
for(i = 0; i < NUMBEROFBUFFERS;i++)
{
pFreeBuffers[i] = &bufferStore[i];
}
}
MultiBuffer *getMultiBuffer()
{
if (freeBuffersCount != 0)
{
freeBuffersCount--; // ---this may need checking.----
return *pFreeBuffers[freeBuffersCount]; // return the pointer to the available buffer
// that is stored at this array position
}
else
{
return null;
}
}
When I compile I get the errors:
C:\Personal\CProg\MyCode\Pointert150311\bufferHandler.c(61): warning #2027: Missing prototype for 'setupBufferStore'.
C:\Personal\CProg\MyCode\Pointert150311\bufferHandler.c(85): warning #2027: Missing prototype for 'getMultiBuffer'.
I know I have an error in getMultiBuffer() as I need to return a null pointer and I am actually returning NULL, but apart from that, I just can not see what the problem is.
Any help welcomed.
Best Regards
Luis