Index: issm/trunk-jpl/src/c/io/Disk/diskio.h
===================================================================
--- issm/trunk-jpl/src/c/io/Disk/diskio.h	(revision 11201)
+++ issm/trunk-jpl/src/c/io/Disk/diskio.h	(revision 11202)
@@ -13,5 +13,5 @@
 class Parameters;
 
-FILE* pfopen(char* filename,char* format);
+FILE* pfopen(char* filename,const char* format);
 void  pfclose(FILE* fid,char* filename);
 
Index: issm/trunk-jpl/src/c/io/Disk/pfopen.cpp
===================================================================
--- issm/trunk-jpl/src/c/io/Disk/pfopen.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/io/Disk/pfopen.cpp	(revision 11202)
@@ -13,5 +13,5 @@
 #include "../../include/include.h"
 
-FILE* pfopen(char* filename,char* format){
+FILE* pfopen(char* filename,const char* format){
 
 	FILE* fid=NULL;
Index: issm/trunk-jpl/src/c/io/Matlab/WriteMatlabData.cpp
===================================================================
--- issm/trunk-jpl/src/c/io/Matlab/WriteMatlabData.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/io/Matlab/WriteMatlabData.cpp	(revision 11202)
@@ -177,9 +177,9 @@
 
 	/*output: */
-	mxArray* dataref=NULL;
-	mwSize nfields;
-	const	char**	fnames=NULL;
-	mwSize		onebyone[2] = {1,1};
-	mwSize		ndim=2;
+	mxArray  *dataref     = NULL;
+	mwSize    nfields;
+	char    **fnames      = NULL;
+	mwSize    onebyone[2] = {1,1};
+	mwSize    ndim        = 2;
 
 	/*intermediary: */
@@ -188,13 +188,13 @@
 	/*Recover data from the parameters dataset: */
 	nfields=(mwSize)parameters->Size();
-	fnames=(const char**)xmalloc(nfields*sizeof(char*));
+	fnames=(char**)xmalloc(nfields*sizeof(char*));
 	
 	/*Build structure in matlab workspace with all the parameter fields: */
 	for(i=0;i<nfields;i++){
 		param=(Param*)parameters->GetObjectByOffset(i);
-		fnames[i]=param->GetParameterName();
+		param->GetParameterName(&fnames[i]);
 	}
 	/*Initialize structure: */
-	dataref=mxCreateStructArray( ndim,onebyone,nfields,fnames);
+	dataref=mxCreateStructArray( ndim,onebyone,nfields,(const char**)fnames);
 
 	/*Fill each field: */
Index: issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 11202)
@@ -12,5 +12,5 @@
 #include "./EnumToStringx.h"
 
-char* EnumToStringx(int en){
+const char* EnumToStringx(int en){
 
 	switch(en){
@@ -438,2 +438,13 @@
 	}
 }
+void EnumToStringx(char** pstring,int enum_in){
+	char *string = NULL;
+	int   len = 0;
+
+	len=strlen(EnumToStringx(enum_in));
+	string=(char*)xmalloc((len+1)*sizeof(char));
+	memcpy(string,EnumToStringx(enum_in),(len+1)*sizeof(char));
+
+	/*Assign output pointer*/
+	*pstring=string;
+}
Index: issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.h
===================================================================
--- issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.h	(revision 11201)
+++ issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.h	(revision 11202)
@@ -6,5 +6,6 @@
 #ifndef _ENUM_TO_STRINGX_
 
-char *EnumToStringx(int enum_in);
+const char* EnumToStringx(int enum_in);
+void EnumToStringx(char** string,int enum_in);
 
 #endif
Index: issm/trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 11202)
@@ -28,4 +28,5 @@
 	bool        io_gather;
 	int         solutiontype;
+	char*       solutiontypestring      = NULL;
 	Results    *results                 = NULL;
 	bool        dakota_analysis         = false;
@@ -62,5 +63,7 @@
 	if(my_rank==0){
 		parameters->FindParam(&solutiontype,SolutionTypeEnum);
-		results->AddObject(new StringExternalResult(results->Size()+1,SolutionTypeEnum,EnumToStringx(solutiontype),1,0));
+		EnumToStringx(&solutiontypestring,solutiontype);
+		results->AddObject(new StringExternalResult(results->Size()+1,SolutionTypeEnum,solutiontypestring,1,0));
+		xfree((void**)&solutiontypestring);
 	}
 
Index: issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/modules/Responsex/Responsex.cpp	(revision 11202)
@@ -16,5 +16,5 @@
 #include "../modules.h"
 
-void Responsex(double* responses,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,char* response_descriptor,bool process_units,int weight_index){
+void Responsex(double* responses,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,const char* response_descriptor,bool process_units,int weight_index){
 
 	switch (StringToEnumx(response_descriptor)){
Index: issm/trunk-jpl/src/c/modules/Responsex/Responsex.h
===================================================================
--- issm/trunk-jpl/src/c/modules/Responsex/Responsex.h	(revision 11201)
+++ issm/trunk-jpl/src/c/modules/Responsex/Responsex.h	(revision 11202)
@@ -9,5 +9,5 @@
 #include "../../Container/Container.h"
 
-void Responsex(double* presponse,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,char* response_descriptor,bool process_units,int weight_index);
+void Responsex(double* presponse,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,const char* response_descriptor,bool process_units,int weight_index);
 
 #endif  /* _RESPONSESXX_H */
Index: issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 11202)
@@ -12,5 +12,5 @@
 #include "./StringToEnumx.h"
 
-int  StringToEnumx(char* name){
+int  StringToEnumx(const char* name){
 
 	if (strcmp(name,"AutodiffForward")==0) return AutodiffForwardEnum;
Index: issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.h
===================================================================
--- issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.h	(revision 11201)
+++ issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.h	(revision 11202)
@@ -6,5 +6,5 @@
 #ifndef _STRING_TO_ENUMX_
 
-int StringToEnumx(char* string_in);
+int StringToEnumx(const char* string_in);
 
 #endif
Index: issm/trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.cpp	(revision 11202)
@@ -150,7 +150,7 @@
 	int     type;
 	int     size;
-	char   *name    = NULL;
 	double  boolean;
 	extern  int my_rank;
+	char*   name = NULL;
 
 	/*return if now on cpu 0: */
@@ -158,5 +158,5 @@
 
 	/*First write enum: */
-	name=EnumToStringx(this->enum_type);
+	EnumToStringx(&name,this->enum_type);
 	length=(strlen(name)+1)*sizeof(char);
 	fwrite(&length,sizeof(int),1,fid);
@@ -180,6 +180,6 @@
 /*}}}1*/
 /*FUNCTION BoolExternalResult::GetResultName{{{1*/
-char* BoolExternalResult::GetResultName(void){
-	return  EnumToStringx(this->enum_type);
+void BoolExternalResult::GetResultName(char** pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -189,5 +189,5 @@
 
 	char* name=NULL;
-	name=this->GetResultName();
+	this->GetResultName(&name);
 	
 	mxSetField( dataref, this->step-1, name,mxCreateDoubleScalar((double)value));
Index: issm/trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.h
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.h	(revision 11202)
@@ -58,5 +58,5 @@
 		int   InstanceEnum(){return enum_type;}
 		void  WriteData(FILE* fid,bool io_gather);
-		char* GetResultName(void);
+		void  GetResultName(char**);
 	    #ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.cpp	(revision 11202)
@@ -157,5 +157,5 @@
 
 	/*First write enum: */
-	name=EnumToStringx(this->enum_type);
+	EnumToStringx(&name,this->enum_type);
 	length=(strlen(name)+1)*sizeof(char);
 	fwrite(&length,sizeof(int),1,fid);
@@ -176,6 +176,6 @@
 /*}}}1*/
 /*FUNCTION DoubleExternalResult::GetResultName{{{1*/
-char* DoubleExternalResult::GetResultName(void){
-	return  EnumToStringx(this->enum_type);
+void DoubleExternalResult::GetResultName(char** pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -185,5 +185,5 @@
 
 	char* name=NULL;
-	name=this->GetResultName();
+	this->GetResultName(&name);
 	mxSetField( dataref,this->step-1, name,mxCreateDoubleScalar(value));
 	mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time)); 
Index: issm/trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.h
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.h	(revision 11202)
@@ -59,5 +59,5 @@
 		int   InstanceEnum(){return enum_type;}
 		void  WriteData(FILE* fid,bool io_gather);
-		char* GetResultName(void);
+		void  GetResultName(char**);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 11202)
@@ -196,5 +196,5 @@
 
 	/*First write enum: */
-	name=EnumToStringx(this->enum_type);
+	EnumToStringx(&name,this->enum_type);
 	length=(strlen(name)+1)*sizeof(char);
 	fwrite(&length,sizeof(int),1,fid);
@@ -217,6 +217,6 @@
 /*}}}1*/
 /*FUNCTION DoubleMatExternalResult::GetResultName{{{1*/
-char* DoubleMatExternalResult::GetResultName(void){
-	return  EnumToStringx(this->enum_type);
+void DoubleMatExternalResult::GetResultName(char** pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -235,5 +235,5 @@
 
 	/*recover name: */
-	name=this->GetResultName();
+	this->GetResultName(&name);
 				
 	/*create matlab matrix: */
Index: issm/trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.h
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.h	(revision 11202)
@@ -60,5 +60,5 @@
 		int   InstanceEnum(){return enum_type;}
 		void  WriteData(FILE* fid,bool io_gather);
-		char* GetResultName(void);
+		void  GetResultName(char**);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 11202)
@@ -182,5 +182,5 @@
 
 	/*First write enum: */
-	name=EnumToStringx(this->enum_type);
+	EnumToStringx(&name,this->enum_type);
 	length=(strlen(name)+1)*sizeof(char);
 	fwrite(&length,sizeof(int),1,fid);
@@ -201,6 +201,6 @@
 /*}}}1*/
 /*FUNCTION DoubleVecExternalResult::GetResultName{{{1*/
-char* DoubleVecExternalResult::GetResultName(void){
-	return  EnumToStringx(this->enum_type);
+void DoubleVecExternalResult::GetResultName(char** pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -219,5 +219,5 @@
 
 	/*recover name: */
-	name=this->GetResultName();
+	this->GetResultName(&name);
 				
 	/*create matlab matrix: */
Index: issm/trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.h
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.h	(revision 11202)
@@ -59,5 +59,5 @@
 		int   InstanceEnum(){return enum_type;}
 		void  WriteData(FILE* fid,bool io_gather);
-		char* GetResultName(void);
+		void  GetResultName(char**);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/ExternalResults/ExternalResult.h
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/ExternalResult.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/ExternalResult.h	(revision 11202)
@@ -32,5 +32,5 @@
 		virtual int   InstanceEnum()=0;
 		virtual void  WriteData(FILE* fid,bool io_gather)=0;
-		virtual char* GetResultName(void)=0;
+		virtual void  GetResultName(char**)=0;
 		#ifdef _SERIAL_
 		virtual void  SetMatlabField(mxArray* dataref)=0;
Index: issm/trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.cpp	(revision 11202)
@@ -158,5 +158,5 @@
 
 	/*First write enum: */
-	name=EnumToStringx(this->enum_type);
+	EnumToStringx(&name,this->enum_type);
 	length=(strlen(name)+1)*sizeof(char);
 	fwrite(&length,sizeof(int),1,fid);
@@ -180,6 +180,6 @@
 /*}}}1*/
 /*FUNCTION IntExternalResult::GetResultName{{{1*/
-char* IntExternalResult::GetResultName(void){
-	return  EnumToStringx(this->enum_type);
+void IntExternalResult::GetResultName(char** pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -189,5 +189,5 @@
 
 	char* name=NULL;
-	name=this->GetResultName();
+	this->GetResultName(&name);
 
 	mxSetField( dataref, this->step-1, name,mxCreateDoubleScalar(value));
Index: issm/trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.h
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.h	(revision 11202)
@@ -57,5 +57,5 @@
 		int   InstanceEnum(){return enum_type;}
 		void  WriteData(FILE* fid,bool io_gather);
-		char* GetResultName(void);
+		void  GetResultName(char**);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 11202)
@@ -218,5 +218,5 @@
 
 	/*First write enum: */
-	name=EnumToStringx(this->enum_type);
+	EnumToStringx(&name,this->enum_type);
 	length=(strlen(name)+1)*sizeof(char);
 	fwrite(&length,sizeof(int),1,fid);
@@ -239,6 +239,6 @@
 /*}}}1*/
 /*FUNCTION PetscVecExternalResult::GetResultName{{{1*/
-char* PetscVecExternalResult::GetResultName(void){
-	return  EnumToStringx(this->enum_type);
+void PetscVecExternalResult::GetResultName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -254,5 +254,5 @@
 	VecToMPISerial(&doublevec,value);
 	VecGetSize(value,&M);
-	name=this->GetResultName();
+	this->GetResultName(&name);
 	
 	pfield=mxCreateDoubleMatrix(0,0,mxREAL);
Index: issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.h
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.h	(revision 11202)
@@ -59,5 +59,5 @@
 		int   InstanceEnum(){return enum_type;}
 		void  WriteData(FILE* fid,bool io_gather);
-		char* GetResultName(void);
+		void  GetResultName(char**);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 11202)
@@ -172,5 +172,5 @@
 
 	/*First write enum: */
-	name=EnumToStringx(this->enum_type);
+	EnumToStringx(&name,this->enum_type);
 	length=(strlen(name)+1)*sizeof(char);
 	fwrite(&length,sizeof(int),1,fid);
@@ -192,6 +192,6 @@
 /*}}}1*/
 /*FUNCTION StringExternalResult::GetResultName{{{1*/
-char* StringExternalResult::GetResultName(void){
-	return  EnumToStringx(this->enum_type);
+void StringExternalResult::GetResultName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -202,5 +202,5 @@
 	char* name=NULL;
 
-	name=this->GetResultName();
+	this->GetResultName(&name);
 
 	mxSetField( dataref, this->step-1, name, mxCreateString(value));
Index: issm/trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.h
===================================================================
--- issm/trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.h	(revision 11202)
@@ -57,5 +57,5 @@
 		int   InstanceEnum(){return enum_type;}
 		void  WriteData(FILE* fid,bool io_gather);
-		char* GetResultName(void);
+		void  GetResultName(char**);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Attribute.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Attribute.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Attribute.cpp	(revision 11202)
@@ -78,5 +78,5 @@
 /*}}}*/
 /*FUNCTION KML_Attribute::Write {{{1*/
-void  KML_Attribute::Write(FILE* filout,char* indent){
+void  KML_Attribute::Write(FILE* filout,const char* indent){
 
 //  attributes always written in keyword line of kml_object
Index: issm/trunk-jpl/src/c/objects/KML/KML_Attribute.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Attribute.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Attribute.h	(revision 11202)
@@ -40,5 +40,5 @@
 
 		/*virtual functions: */
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		void  Alloc(const char* namei,const char* valuei);
Index: issm/trunk-jpl/src/c/objects/KML/KML_ColorStyle.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_ColorStyle.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_ColorStyle.cpp	(revision 11202)
@@ -75,5 +75,5 @@
 /*}}}*/
 /*FUNCTION KML_ColorStyle::Write {{{1*/
-void  KML_ColorStyle::Write(FILE* filout,char* indent){
+void  KML_ColorStyle::Write(FILE* filout,const char* indent){
 
 	KML_SubStyle::Write(filout,indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_ColorStyle.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_ColorStyle.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_ColorStyle.h	(revision 11202)
@@ -33,5 +33,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_Comment.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Comment.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Comment.cpp	(revision 11202)
@@ -70,5 +70,5 @@
 /*}}}*/
 /*FUNCTION KML_Comment::Write {{{1*/
-void  KML_Comment::Write(FILE* filout,char* indent){
+void  KML_Comment::Write(FILE* filout,const char* indent){
 
 	if (strncmp(&value[0]              ,"<!--",4))
Index: issm/trunk-jpl/src/c/objects/KML/KML_Comment.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Comment.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Comment.h	(revision 11202)
@@ -40,5 +40,5 @@
 
 		/*virtual functions: */
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		void  Alloc(const char* valuei);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Container.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Container.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Container.cpp	(revision 11202)
@@ -90,5 +90,5 @@
 /*}}}*/
 /*FUNCTION KML_Container::Write {{{1*/
-void  KML_Container::Write(FILE* filout,char* indent){
+void  KML_Container::Write(FILE* filout,const char* indent){
 
 	int   i;
Index: issm/trunk-jpl/src/c/objects/KML/KML_Container.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Container.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Container.h	(revision 11202)
@@ -30,5 +30,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Document.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Document.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Document.cpp	(revision 11202)
@@ -73,5 +73,5 @@
 
 /*FUNCTION KML_Document::Write {{{1*/
-void  KML_Document::Write(FILE* filout,char* indent){
+void  KML_Document::Write(FILE* filout,const char* indent){
 
 	fprintf(filout,"%s<Document",indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Document.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Document.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Document.h	(revision 11202)
@@ -28,5 +28,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_Feature.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Feature.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Feature.cpp	(revision 11202)
@@ -113,5 +113,5 @@
 
 /*FUNCTION KML_Feature::Write {{{1*/
-void  KML_Feature::Write(FILE* filout,char* indent){
+void  KML_Feature::Write(FILE* filout,const char* indent){
 
 	int   i;
Index: issm/trunk-jpl/src/c/objects/KML/KML_Feature.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Feature.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Feature.h	(revision 11202)
@@ -42,5 +42,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_File.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_File.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_File.cpp	(revision 11202)
@@ -92,5 +92,5 @@
 /*}}}*/
 /*FUNCTION KML_File::Write {{{1*/
-void  KML_File::Write(FILE* filout,char* indent){
+void  KML_File::Write(FILE* filout,const char* indent){
 
 	int   i;
Index: issm/trunk-jpl/src/c/objects/KML/KML_File.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_File.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_File.h	(revision 11202)
@@ -30,5 +30,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Folder.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Folder.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Folder.cpp	(revision 11202)
@@ -73,5 +73,5 @@
 
 /*FUNCTION KML_Folder::Write {{{1*/
-void  KML_Folder::Write(FILE* filout,char* indent){
+void  KML_Folder::Write(FILE* filout,const char* indent){
 
 	fprintf(filout,"%s<Folder",indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Folder.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Folder.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Folder.h	(revision 11202)
@@ -28,5 +28,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_Geometry.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Geometry.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Geometry.cpp	(revision 11202)
@@ -66,5 +66,5 @@
 
 /*FUNCTION KML_Geometry::Write {{{1*/
-void  KML_Geometry::Write(FILE* filout,char* indent){
+void  KML_Geometry::Write(FILE* filout,const char* indent){
 
 	KML_Object::Write(filout,indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Geometry.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Geometry.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Geometry.h	(revision 11202)
@@ -27,5 +27,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.cpp	(revision 11202)
@@ -95,5 +95,5 @@
 
 /*FUNCTION KML_GroundOverlay::Write {{{1*/
-void  KML_GroundOverlay::Write(FILE* filout,char* indent){
+void  KML_GroundOverlay::Write(FILE* filout,const char* indent){
 
 	char  indent2[81];
Index: issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_GroundOverlay.h	(revision 11202)
@@ -34,5 +34,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_Icon.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Icon.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Icon.cpp	(revision 11202)
@@ -98,5 +98,5 @@
 
 /*FUNCTION KML_Icon::Write {{{1*/
-void  KML_Icon::Write(FILE* filout,char* indent){
+void  KML_Icon::Write(FILE* filout,const char* indent){
 
 	fprintf(filout,"%s<Icon",indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Icon.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Icon.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Icon.h	(revision 11202)
@@ -42,5 +42,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.cpp	(revision 11202)
@@ -89,5 +89,5 @@
 
 /*FUNCTION KML_LatLonBox::Write {{{1*/
-void  KML_LatLonBox::Write(FILE* filout,char* indent){
+void  KML_LatLonBox::Write(FILE* filout,const char* indent){
 
 	fprintf(filout,"%s<LatLonBox",indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_LatLonBox.h	(revision 11202)
@@ -33,5 +33,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_LineString.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_LineString.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_LineString.cpp	(revision 11202)
@@ -93,5 +93,5 @@
 /*}}}*/
 /*FUNCTION KML_LineString::Write {{{1*/
-void  KML_LineString::Write(FILE* filout,char* indent){
+void  KML_LineString::Write(FILE* filout,const char* indent){
 
 	int   i;
Index: issm/trunk-jpl/src/c/objects/KML/KML_LineString.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_LineString.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_LineString.h	(revision 11202)
@@ -35,5 +35,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
Index: issm/trunk-jpl/src/c/objects/KML/KML_LineStyle.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_LineStyle.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_LineStyle.cpp	(revision 11202)
@@ -78,5 +78,5 @@
 
 /*FUNCTION KML_LineStyle::Write {{{1*/
-void  KML_LineStyle::Write(FILE* filout,char* indent){
+void  KML_LineStyle::Write(FILE* filout,const char* indent){
 
 	fprintf(filout,"%s<LineStyle",indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_LineStyle.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_LineStyle.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_LineStyle.h	(revision 11202)
@@ -29,5 +29,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_LinearRing.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_LinearRing.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_LinearRing.cpp	(revision 11202)
@@ -96,5 +96,5 @@
 
 /*FUNCTION KML_LinearRing::Write {{{1*/
-void  KML_LinearRing::Write(FILE* filout,char* indent){
+void  KML_LinearRing::Write(FILE* filout,const char* indent){
 
 	int   i;
Index: issm/trunk-jpl/src/c/objects/KML/KML_LinearRing.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_LinearRing.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_LinearRing.h	(revision 11202)
@@ -35,5 +35,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
Index: issm/trunk-jpl/src/c/objects/KML/KML_MultiGeometry.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_MultiGeometry.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_MultiGeometry.cpp	(revision 11202)
@@ -95,5 +95,5 @@
 
 /*FUNCTION KML_MultiGeometry::Write {{{1*/
-void  KML_MultiGeometry::Write(FILE* filout,char* indent){
+void  KML_MultiGeometry::Write(FILE* filout,const char* indent){
 
 	int   i;
Index: issm/trunk-jpl/src/c/objects/KML/KML_MultiGeometry.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_MultiGeometry.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_MultiGeometry.h	(revision 11202)
@@ -31,5 +31,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Object.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Object.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Object.cpp	(revision 11202)
@@ -94,5 +94,5 @@
 /*}}}*/
 /*FUNCTION KML_Object::Write {{{1*/
-void  KML_Object::Write(FILE* filout,char* indent){
+void  KML_Object::Write(FILE* filout,const char* indent){
 
 //  attributes always written in keyword line of derived classes
@@ -173,7 +173,5 @@
 /*}}}*/
 /*FUNCTION KML_Object::WriteAttrib {{{1*/
-void  KML_Object::WriteAttrib(FILE* filout,char* indent){
-
-	int   i;
+void  KML_Object::WriteAttrib(FILE* filout,const char* indent){
 
 //  attributes always written in keyword line of kml_object
@@ -182,5 +180,5 @@
 
 	if (attrib->Size())
-		for (i=0; i<attrib->Size(); i++)
+		for (int i=0; i<attrib->Size(); i++)
 			((KML_Attribute *)attrib->GetObjectByOffset(i))->Write(filout,indent);
 
@@ -234,5 +232,5 @@
 /*}}}*/
 /*FUNCTION KML_Object::WriteCommnt {{{1*/
-void  KML_Object::WriteCommnt(FILE* filout,char* indent){
+void  KML_Object::WriteCommnt(FILE* filout,const char* indent){
 
 	int   i;
Index: issm/trunk-jpl/src/c/objects/KML/KML_Object.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Object.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Object.h	(revision 11202)
@@ -40,14 +40,14 @@
 
 		/*virtual functions: */
-		virtual void  Write(FILE* fid,char* indent)=0;
+		virtual void  Write(FILE* fid,const char* indent)=0;
 		virtual void  Read(FILE* fid,char* kstr)=0;
 		virtual void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
 		virtual void  AddAttrib(const char* name,const char* value);
 		virtual void  FindAttrib(char** pvalue,char* name,char* deflt);
-		virtual void  WriteAttrib(FILE* fid,char* indent);
+		virtual void  WriteAttrib(FILE* fid,const char* indent);
 		virtual void  AddCommnt(int ncom,char** pcom);
 		virtual void  AddCommnt(char* value);
 		virtual void  FindCommnt(char** pvalue,int inum);
-		virtual void  WriteCommnt(FILE* fid,char* indent);
+		virtual void  WriteCommnt(FILE* fid,const char* indent);
 
 };
Index: issm/trunk-jpl/src/c/objects/KML/KML_Overlay.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Overlay.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Overlay.cpp	(revision 11202)
@@ -94,5 +94,5 @@
 
 /*FUNCTION KML_Overlay::Write {{{1*/
-void  KML_Overlay::Write(FILE* filout,char* indent){
+void  KML_Overlay::Write(FILE* filout,const char* indent){
 
 	char  indent2[81];
Index: issm/trunk-jpl/src/c/objects/KML/KML_Overlay.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Overlay.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Overlay.h	(revision 11202)
@@ -34,5 +34,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_Placemark.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Placemark.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Placemark.cpp	(revision 11202)
@@ -92,5 +92,5 @@
 /*}}}*/
 /*FUNCTION KML_Placemark::Write {{{1*/
-void  KML_Placemark::Write(FILE* filout,char* indent){
+void  KML_Placemark::Write(FILE* filout,const char* indent){
 
 	int   i;
Index: issm/trunk-jpl/src/c/objects/KML/KML_Placemark.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Placemark.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Placemark.h	(revision 11202)
@@ -31,5 +31,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Point.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Point.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Point.cpp	(revision 11202)
@@ -84,5 +84,5 @@
 /*}}}*/
 /*FUNCTION KML_Point::Write {{{1*/
-void  KML_Point::Write(FILE* filout,char* indent){
+void  KML_Point::Write(FILE* filout,const char* indent){
 
 	fprintf(filout,"%s<Point",indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Point.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Point.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Point.h	(revision 11202)
@@ -33,5 +33,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
Index: issm/trunk-jpl/src/c/objects/KML/KML_PolyStyle.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_PolyStyle.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_PolyStyle.cpp	(revision 11202)
@@ -81,5 +81,5 @@
 
 /*FUNCTION KML_PolyStyle::Write {{{1*/
-void  KML_PolyStyle::Write(FILE* filout,char* indent){
+void  KML_PolyStyle::Write(FILE* filout,const char* indent){
 
 	fprintf(filout,"%s<PolyStyle",indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_PolyStyle.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_PolyStyle.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_PolyStyle.h	(revision 11202)
@@ -30,5 +30,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_Polygon.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Polygon.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Polygon.cpp	(revision 11202)
@@ -117,5 +117,5 @@
 /*}}}*/
 /*FUNCTION KML_Polygon::Write {{{1*/
-void  KML_Polygon::Write(FILE* filout,char* indent){
+void  KML_Polygon::Write(FILE* filout,const char* indent){
 
 	int   i;
Index: issm/trunk-jpl/src/c/objects/KML/KML_Polygon.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Polygon.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Polygon.h	(revision 11202)
@@ -37,5 +37,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		void  WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp);
Index: issm/trunk-jpl/src/c/objects/KML/KML_Style.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Style.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Style.cpp	(revision 11202)
@@ -142,5 +142,5 @@
 
 /*FUNCTION KML_Style::Write {{{1*/
-void  KML_Style::Write(FILE* filout,char* indent){
+void  KML_Style::Write(FILE* filout,const char* indent){
 
 	char  indent2[81];
Index: issm/trunk-jpl/src/c/objects/KML/KML_Style.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_Style.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_Style.h	(revision 11202)
@@ -36,5 +36,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_StyleSelector.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_StyleSelector.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_StyleSelector.cpp	(revision 11202)
@@ -66,5 +66,5 @@
 
 /*FUNCTION KML_StyleSelector::Write {{{1*/
-void  KML_StyleSelector::Write(FILE* filout,char* indent){
+void  KML_StyleSelector::Write(FILE* filout,const char* indent){
 
 	KML_Object::Write(filout,indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_StyleSelector.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_StyleSelector.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_StyleSelector.h	(revision 11202)
@@ -27,5 +27,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/KML/KML_SubStyle.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_SubStyle.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_SubStyle.cpp	(revision 11202)
@@ -66,5 +66,5 @@
 
 /*FUNCTION KML_SubStyle::Write {{{1*/
-void  KML_SubStyle::Write(FILE* filout,char* indent){
+void  KML_SubStyle::Write(FILE* filout,const char* indent){
 
 	KML_Object::Write(filout,indent);
Index: issm/trunk-jpl/src/c/objects/KML/KML_SubStyle.h
===================================================================
--- issm/trunk-jpl/src/c/objects/KML/KML_SubStyle.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/KML/KML_SubStyle.h	(revision 11202)
@@ -27,5 +27,5 @@
 		void  DeepEcho();
 		void  DeepEcho(const char* indent);
-		void  Write(FILE* fid,char* indent);
+		void  Write(FILE* fid,const char* indent);
 		void  Read(FILE* fid,char* kstr);
 		int   Id(){_error_("Not implemented yet.");};
Index: issm/trunk-jpl/src/c/objects/Params/BoolParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/BoolParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/BoolParam.cpp	(revision 11202)
@@ -130,6 +130,6 @@
 /*BoolParam virtual functions definitions: */
 /*FUNCTION BoolParam::GetParameterName{{{1*/
-char* BoolParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void BoolParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -138,5 +138,5 @@
 void  BoolParam::SetMatlabField(mxArray* dataref){
 	char* name=NULL;
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 	mxSetField( dataref, 0, name,mxCreateDoubleScalar((double)value));
 }
Index: issm/trunk-jpl/src/c/objects/Params/BoolParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/BoolParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/BoolParam.h	(revision 11202)
@@ -80,5 +80,5 @@
 		void  UnitConversion(int direction_enum);
 		
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.cpp	(revision 11202)
@@ -304,6 +304,6 @@
 /*}}}*/
 /*FUNCTION DoubleMatArrayParam::GetParameterName{{{1*/
-char* DoubleMatArrayParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void DoubleMatArrayParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -321,5 +321,5 @@
 	mxArray* pfield3=NULL;
 	
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 	dims[0]=this->M;
 	dims[1]=1;
Index: issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h	(revision 11202)
@@ -83,5 +83,5 @@
 		void  UnitConversion(int direction_enum);
 
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp	(revision 11202)
@@ -186,6 +186,6 @@
 /*}}}*/
 /*FUNCTION DoubleMatParam::GetParameterName{{{1*/
-char* DoubleMatParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void DoubleMatParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -199,5 +199,5 @@
 	char* name=NULL;
 	
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 	this->GetParameterValue(&doublemat,NULL,NULL);
 				
Index: issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.h	(revision 11202)
@@ -83,5 +83,5 @@
 		double* GetPointer(void);
 
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/DoubleParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/DoubleParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/DoubleParam.cpp	(revision 11202)
@@ -127,6 +127,6 @@
 /*DoubleParam virtual functions definitions: */
 /*FUNCTION DoubleParam::GetParameterName{{{1*/
-char* DoubleParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void DoubleParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -224,5 +224,5 @@
 
 	char* name=NULL;
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 	mxSetField( dataref, 0, name,mxCreateDoubleScalar(value));
 }
Index: issm/trunk-jpl/src/c/objects/Params/DoubleParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/DoubleParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/DoubleParam.h	(revision 11202)
@@ -81,5 +81,5 @@
 		void  UnitConversion(int direction_enum);
 
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp	(revision 11202)
@@ -198,6 +198,6 @@
 /*}}}*/
 /*FUNCTION DoubleVecParam::GetParameterName{{{1*/
-char* DoubleVecParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void DoubleVecParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -211,5 +211,5 @@
 
 	this->GetParameterValue(&doublevec,NULL);
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 				
 	pfield=mxCreateDoubleMatrix(0,0,mxREAL);
Index: issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.h	(revision 11202)
@@ -81,5 +81,5 @@
 		void  UnitConversion(int direction_enum);
 		
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/FileParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/FileParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/FileParam.cpp	(revision 11202)
@@ -97,6 +97,6 @@
 /*FileParam virtual functions definitions: */
 /*FUNCTION FileParam::GetParameterName{{{1*/
-char* FileParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void FileParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
Index: issm/trunk-jpl/src/c/objects/Params/FileParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/FileParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/FileParam.h	(revision 11202)
@@ -80,5 +80,5 @@
 		void  UnitConversion(int direction_enum);
 
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/IntMatParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/IntMatParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/IntMatParam.cpp	(revision 11202)
@@ -168,6 +168,6 @@
 /*}}}*/
 /*FUNCTION IntMatParam::GetParameterName{{{1*/
-char* IntMatParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void IntMatParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -183,5 +183,5 @@
 
 	this->GetParameterValue(&intarray,NULL,NULL);
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 
 	/*cast intarray into doublearray for Matlab*/
Index: issm/trunk-jpl/src/c/objects/Params/IntMatParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/IntMatParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/IntMatParam.h	(revision 11202)
@@ -82,5 +82,5 @@
 		void  UnitConversion(int direction_enum);
 
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/IntParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/IntParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/IntParam.cpp	(revision 11202)
@@ -130,6 +130,6 @@
 /*IntParam virtual functions definitions: */
 /*FUNCTION IntParam::GetParameterName{{{1*/
-char* IntParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void IntParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -139,5 +139,5 @@
 	
 	char* name=NULL;
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 	mxSetField( dataref, 0, name,mxCreateDoubleScalar((double)value));
 }
Index: issm/trunk-jpl/src/c/objects/Params/IntParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/IntParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/IntParam.h	(revision 11202)
@@ -81,5 +81,5 @@
 		void  UnitConversion(int direction_enum);
 
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/IntVecParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/IntVecParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/IntVecParam.cpp	(revision 11202)
@@ -181,6 +181,6 @@
 /*}}}*/
 /*FUNCTION IntVecParam::GetParameterName{{{1*/
-char* IntVecParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void IntVecParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -195,5 +195,5 @@
 
 	this->GetParameterValue(&intvec,NULL);
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 
 	/*cast intvec into doublevec for Matlab*/
Index: issm/trunk-jpl/src/c/objects/Params/IntVecParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/IntVecParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/IntVecParam.h	(revision 11202)
@@ -82,5 +82,5 @@
 		void  UnitConversion(int direction_enum);
 		
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/Param.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/Param.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/Param.h	(revision 11202)
@@ -59,6 +59,5 @@
 		virtual void  SetValue(double** array, int M, int* mdim_array, int* ndim_array)=0;
 		virtual void  UnitConversion(int direction_enum)=0;
-
-		virtual char* GetParameterName(void)=0;
+		virtual void  GetParameterName(char**pname)=0;
 		#ifdef _SERIAL_
 		virtual void  SetMatlabField(mxArray* dataref)=0;
Index: issm/trunk-jpl/src/c/objects/Params/PetscMatParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/PetscMatParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/PetscMatParam.cpp	(revision 11202)
@@ -201,6 +201,6 @@
 /*}}}*/
 /*FUNCTION PetscMatParam::GetParameterName{{{1*/
-char* PetscMatParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void PetscMatParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -216,5 +216,5 @@
 	MatToSerial(&doublemat,value);
 	MatGetSize(value,&M,&N);
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 				
 	pfield=mxCreateDoubleMatrix(0,0,mxREAL);
Index: issm/trunk-jpl/src/c/objects/Params/PetscMatParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/PetscMatParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/PetscMatParam.h	(revision 11202)
@@ -81,5 +81,5 @@
 		void  UnitConversion(int direction_enum);
 
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/PetscVecParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/PetscVecParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/PetscVecParam.cpp	(revision 11202)
@@ -194,6 +194,6 @@
 /*}}}*/
 /*FUNCTION PetscVecParam::GetParameterName{{{1*/
-char* PetscVecParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void PetscVecParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -209,5 +209,5 @@
 	VecToMPISerial(&doublevec,value);
 	VecGetSize(value,&M);
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 	
 	pfield=mxCreateDoubleMatrix(0,0,mxREAL);
Index: issm/trunk-jpl/src/c/objects/Params/PetscVecParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/PetscVecParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/PetscVecParam.h	(revision 11202)
@@ -81,5 +81,5 @@
 		void  UnitConversion(int direction_enum);
 
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/StringArrayParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/StringArrayParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/StringArrayParam.cpp	(revision 11202)
@@ -232,6 +232,6 @@
 /*}}}*/
 /*FUNCTION StringArrayParam::GetParameterName{{{1*/
-char* StringArrayParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void StringArrayParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -245,5 +245,5 @@
 	mxArray* pfield=NULL;
 	
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 
 	dims[0]=this->numstrings;
Index: issm/trunk-jpl/src/c/objects/Params/StringArrayParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/StringArrayParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/StringArrayParam.h	(revision 11202)
@@ -83,5 +83,5 @@
 		void  UnitConversion(int direction_enum);
 
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/objects/Params/StringParam.cpp
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/StringParam.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/StringParam.cpp	(revision 11202)
@@ -160,6 +160,6 @@
 /*}}}*/
 /*FUNCTION StringParam::GetParameterName{{{1*/
-char* StringParam::GetParameterName(void){
-	return  EnumToStringx(this->enum_type);
+void StringParam::GetParameterName(char**pname){
+	EnumToStringx(pname,this->enum_type);
 }
 /*}}}*/
@@ -170,5 +170,5 @@
 	char* name=NULL;
 
-	name=this->GetParameterName();
+	this->GetParameterName(&name);
 	mxSetField( dataref, 0, name, mxCreateString(value));
 }
Index: issm/trunk-jpl/src/c/objects/Params/StringParam.h
===================================================================
--- issm/trunk-jpl/src/c/objects/Params/StringParam.h	(revision 11201)
+++ issm/trunk-jpl/src/c/objects/Params/StringParam.h	(revision 11202)
@@ -81,5 +81,5 @@
 		void  UnitConversion(int direction_enum);
 
-		char* GetParameterName(void);
+		void GetParameterName(char**pname);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
Index: issm/trunk-jpl/src/c/shared/TriMesh/OrderSegments.cpp
===================================================================
--- issm/trunk-jpl/src/c/shared/TriMesh/OrderSegments.cpp	(revision 11201)
+++ issm/trunk-jpl/src/c/shared/TriMesh/OrderSegments.cpp	(revision 11202)
@@ -24,24 +24,24 @@
 
 	for (i=0;i<nseg;i++){
-		A=*(segments+3*i+0);
-		B=*(segments+3*i+1);
-		el=*(segments+3*i+2)-1; //after AssociateSegmentToElement, el was a matlab index, we need the c index now.
+		A=segments[3*i+0];
+		B=segments[3*i+1];
+		el=(int)segments[3*i+2]-1; //after AssociateSegmentToElement, el was a matlab index, we need the c index now.
 
-		if (*(index+3*el+0)==A){
-			if (*(index+3*el+2)==B){
-				*(segments+3*i+0)=B;
-				*(segments+3*i+1)=A;
+		if (index[3*el+0]==A){
+			if (index[3*el+2]==B){
+				segments[3*i+0]=B;
+				segments[3*i+1]=A;
 			}
 		}
-		else if (*(index+3*el+1)==A){
-			if (*(index+3*el+0)==B){
-				*(segments+3*i+0)=B;
-				*(segments+3*i+1)=A;
+		else if (index[3*el+1]==A){
+			if (index[3*el+0]==B){
+				segments[3*i+0]=B;
+				segments[3*i+1]=A;
 			}
 		}
 		else{
-			if (*(index+3*el+1)==B){
-				*(segments+3*i+0)=B;
-				*(segments+3*i+1)=A;
+			if (index[3*el+1]==B){
+				segments[3*i+0]=B;
+				segments[3*i+1]=A;
 			}
 		}
