change to petsc-dev

Barry Smith bsmith at mcs.anl.gov
Tue Jun 24 15:50:27 CDT 2008


   Absolutely NOT!

   It is perfectly reasonable to have the const in user code; WHENEVER  
a user uses
a static string they should/must make it const

    Barry

On Jun 24, 2008, at 3:19 PM, Satish Balay wrote:

> On Tue, 24 Jun 2008, Barry Smith wrote:
>
>>
>>  I have pushed the change to PETSc-dev that eliminates the const  
>> from the
>> definition of XXXType (for example VecType).
>> In theory this should have minimal affects on your codes. The only  
>> change I
>> think you may need are changing, for example,
>>
>>  VecType mt = MPIVEC;
>>
>> to
>>
>>  const VecType mt = MPIVEC.
>
> I think we can avoid this change to user-code - if we do the
> following:
>
> #define VECMPI         (char *)"mpi"
>
> [I guess the tradeoff is slightly less rigorous const check by the
> compiler]
>
>
> I tried this change with MatType - and looks like it requires a
> corresponding change of MatGetType() from:
>
> MatGetType(Mat mat,const MatType *type)
> to
> MatGetType(Mat mat,MatType *type)
>
> Satish
>




More information about the petsc-dev mailing list