[vtk-developers] const correctness

David Gobbi david.gobbi at gmail.com
Wed Feb 9 18:15:10 EST 2011


> On Wed, 9 Feb 2011 15:38:55 -0700, tom fogal said:
>
>The python wrappers, in particular, casted strings to char* all over
>the place.  I made that into a separate patch.
>
>Other ideas / feedback?  Can I make another appeal for help with
>Tcl/Java? :)

A quick comment: changes like this are a little odd:
- arglist = Py_BuildValue((char*)"(Ns)",obj2,eventname);
+ arglist = Py_BuildValue((const char*)"(Ns)",obj2,eventname);
You are casting a "const char *" to a "const char *".

But for the Python wrappers, I recommend that you leave those casts as
they are.  They are needed to allow VTK to compile with older versions
of Python (Python was slow to adopt const-safeness).

There are dashboard machines with versions of python as old as Python
2.3, but I've been trying to keep compatibility as far back as Python
2.0.  Old versions of Tcl also have const issues, and are perhaps even
more common in the wild than old versions of python.

 - David



More information about the vtk-developers mailing list