Compiler Syntax Error (Newbie Question)
I have written my first, and what I thought was a legal, C function. This is what it looks like:
Code:
int __fastcall testFunc(int *a1)
{
int result;
int v2;
result = *a1;
if ( !*(_BYTE *)(*a1 + 37) )
{
v2 = *(_DWORD *)(result + 8);
if ( *(_BYTE *)(v2 + 37) )
{
for ( result = *(_DWORD *)(result + 4); !*(_BYTE *)(result + 37); result = *(_DWORD *)(result + 4) )
{
if ( *a1 != *(_DWORD *)(result + 8) )
break;
*a1 = result;
}
*a1 = result;
}
else
{
for ( result = *(_DWORD *)v2; !*(_BYTE *)(result + 37); result = *(_DWORD *)result )
v2 = result;
*a1 = v2;
}
}
return result;
}
I try to compile this, and I receive the following errors:
Line 1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'testFunc'
I think there might be some other errors in the code as well, however I guess getting the first line to work would be a start :)
I am having trouble understanding the first line, since I thought that the required decorations were on the method. Can someone help me with getting this to work?
Thanks!