I use this code to get the interface of a ClassLibrary and I have a warning during compiling time.. I'd like to know why, so I can fix it and learn how to proceed..
Here is the code I use:
that's the error:
struct ClassLibrary *ListBrowserBase = NULL; Class *ListBrowserClass; struct ListBrowserIFace *IListBrowser = NULL; ListBrowserBase = (struct ClassLibrary *)IIntuition->OpenClass("gadgets/listbrowser.gadget", 52, &ListBrowserClass); if(ListBrowserBase == NULL){ IDOS->Printf("Impossibile ottenere ListBrowserBase!\n"); }else{ IDOS->Printf("ListBrowserBase ottenuto correttamente!\n"); } IListBrowser = (struct ListBrowserIFace *)IExec->GetInterface(ListBrowserBase, "main", 1, NULL); if(IListBrowser == NULL){ IDOS->Printf("Impossibile ottenere IListBrowser\n"); }else{ IDOS->Printf("IListBrowser ottenuto correttamente!\n"); }
esempio.c: In function 'main': esempio.c:109: warning: passing argument 2 of 'IExec->GetInterface' from incompatible pointer typeWhat am I doing wrong?
IListBrowser = (struct ListBrowserIFace *) IExec->GetInterface((struct Library *) ListBrowserBase, "main", 1, NULL);