On 05-Aug-97, Cameron Clark wrote to Javier Kohen about Re: C++ or ASM?.
JK>> v_screen = static_cast
JK>> (const_cast(MK_FP(0xA000, 0x0000)));
JK>> I think those C++ casts are purely cosmetic... ;-)
CC> It might seem that way, but using volatile is supposed to tell the
CC> compiler that the contents may change unexpectedly and it should
CC> avoid storing the value in registers.
Yeah, fine, I knew it. I was complaining about cast's cosmetics :-)
In C, I would have written just "scr = (volatile char *) 0xA0000000;",
about half the size.
CC> However, in the above statement, I've no idea what the compiler is
CC> going to thing of a volatile,static,constant pointer to video
CC> memory.
Actually I'm just casting from (void *) to (virtual char *), see how
confusing it is!?
const_cast can change const but volatile, too.
static_cast can change anything (mmm... not very sure about it :-), so
it's not very safe, that's why I used it to cast from (volatile void *) to
(volatile char *).
Javier Kohen [The_Crusher] http://jkohen.base.org
... It's starting to rain, .SQZ the animals into the .ARC!
-!- CrusherTag 0.3.2.
--- Terminate 5.00 UnReg
---------------
* Origin: The King of The Ring (4:900/748.3)
|