View Single Post
Old 23 November 2020, 22:28   #10
Ernst Blofeld
<optimized out>

Ernst Blofeld's Avatar
Join Date: Sep 2020
Location: <optimized out>
Posts: 304
Originally Posted by thomas View Post
Why do you say it does not exist? You make it exist kust by that line.

The line is just a short form of

Model *wibble;
wibble = (Model *)wibble;

What you really should do is to avoid all that casting. Use proper types for your variables.

For example in your first post instead of

ModelData *m = (ModelData *) b;

you should use

ModelData *m = &b->modelData;

This way the compiller can help you. If you use casting you tell the compiler that you know better than him. But obviously you don't.
Sure, but that doesn't work the other way, getting from a ModelData * to a BSPModelData *, so I'd end up with two approaches in the same code base.
Ernst Blofeld is offline  
Page generated in 0.05647 seconds with 11 queries