#define XXXType const char* ----> #define XXXType char* ?

Barry Smith bsmith at mcs.anl.gov
Mon Jun 23 14:25:43 CDT 2008


   A while ago I made XXType (MatType, VecType etc) const char*

    I now think that was a mistake. I'd like to change them to just   
char* XXType and change the prototypes
    XXXSetType(XXXXX x,XXXType t) ------>   XXXSetType(XXXXXX x,const  
XXXType t)
    XXXGetType(XXXXX x,XXXType *t) ----->   XXXGetType(XXXXXX x,const  
XXTYPE* t)

   Can anyone suggest a technical reason why this is a bad idea before  
I push the code?

    I will warn before I push so that if you are in the middle of some  
delicate coding and are afraid this
will break things you can avoid pulling for a while.

     Thanks

      Barry

Note this means if you have code like

    VecType t = VECMPI;

you would need to change it to

    const VecType t = VECMPI;





More information about the petsc-dev mailing list