Mail Archives: djgpp/1997/06/19/20:55:54
Jeff Weeks wrote:
> I have three pointers to functions and a structure for the protected
> mode interface:
> VesaProtected *pm_info;
> void (*_pm_vesa_switcher)();
> void (*_pm_vesa_scroller)();
> void (*_pm_vesa_pallete)();
> ANSI C++ forbids pointer conversion from void *
>
> Atleast I think that's it. Now, I'm pretty sure these lines work fine
Pretty spot on.
> in C. It's in C++ where they have trouble, so what's wrong? What has
> changed in C++ to make these non ANSI? And how can I fix it?
In C++, anything can be assigned to a void* but void* can not be
assigned to anything at all without a cast. Just change your code to
(eg):
_pm_vesa_pallete = (void (*)())((char *)pm_info + pm_info->setPalette);
BTW, unless you chopped out the parameters for bandwidth reasons, you'll
have to put them in otherwise the compiler will treat the functions as
void foo(void).
Sorry, can't help with the other question.
Bill
--
Leave others their otherness.
- Raw text -