I dont know how to typecast to "ULONG(*)()".. can someone help me out here?
const struct Hook ConstructLI_TextHook = { { NULL,NULL }, (ULONG*)ConstructLI_TextFunc, NULL,NULL };
8.dh0:MUI/Developer/C/Examples/a> g++ a.cpp
In file included from a.cpp:74:
NList-Demo2.c:109: initialization to `ULONG (*)()' from `ULONG *'
....
I dont know if this helps but heres the Hook function for the code above:
#ifdef __SASC
SAVEDS ASM APTR ConstructLI_TextFunc(REG(a0) struct Hook *hook, REG(a2) Object *obj, REG(a1) struct NList_ConstructMessage *ncm)
{
#endif
#ifdef __GNUC__
static APTR ConstructLI_TextFunc(void)
{ register Object *a2 __asm("a2"); Object *obj = a2;
register struct NList_ConstructMessage *a1 __asm("a1"); struct NList_ConstructMessage *ncm = a1;
register struct Hook *a0 __asm("a0"); struct Hook *hook = a0;
#endif
struct LITD *new_entry = (struct LITD *) AllocVec(sizeof(struct LITD),0);
if(new_entry)
{ int i = 0, j = 0;
new_entry->num = -1;
new_entry->str2 = (char *) ncm->entry;
while ((j < 3) && new_entry->str2)
{ if ((new_entry->str2 > 'A') && (new_entry->str2 < 'z'))
new_entry->str1[j++] = new_entry->str2;
if (new_entry->str2 == '\033')
i++;
i++;
}
new_entry->str1[j] = '\0';
return (new_entry);
}
return (NULL);
}
Thanks guys.