Mail Archives: djgpp/2003/07/23/09:40:00
Joel <jbs30000 AT aol DOT com> wrote:
> From here
> http://www.delorie.com/djgpp/doc/ug/graphics/vbe20.html
> I used code to get protected mode function offsets. And instead of
> using vesa_pm_info I just called it VESA_PM.
Please re-think that decision. By ancient tradition in both C and
C++, NAMES_IN_ALL_CAPS are reserved for #define'd macros and possibly
enum labels. You'll mislead anyone else who may get to read your code
later.
> I got the error:
> svga/VBESetup.cpp(12) Error: invalid conversion from `void*' to `
> Vesa_Protected_Mode_Info*'
That's a C++-specific thing, whereas the sample you looked at probably
was meant to be C code. Unlike C, C++ doesn't let you silently cast
points from and to void *.
> But of course that doesn't necessarily mean that I'm doing this right,
> so I'd like to know, is that correct, or else how am I supposed to fix
> the problem?
C++ purists may insist on using one of the more explicitly meaningful
types of cast, or tell you to use "new" instead of malloc(), but the
fix you found is essentially correct.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -