Stefan Dösinger wrote:
Hello,
I just read the "constify data" todo, and I thought it would be good to make
the VTables in my ddraw implementation const. The old ddraw implementation
also declares them static. Is there any advantage in it?
My C book just says that they can only be referenced from the local module,
which is correct. But are there any other effects?
No, that is the only direct effect. However, as it can only be
referenced from the one module then the compiler will warn if it is not
used, leading to less dead code. Also, it doesn't put a symbol in the
ELF name table, which means loading the DLL will be slightly faster.
--
Rob Shearman