From b51c1b8e4e687bb4f5d8615d7b3c9e3cb0dbeca6 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 14 Oct 2016 23:46:27 -0400 Subject: [PATCH] [clib] Fix const-ness of clib function arguments --- include/cantera/clib/ct.h | 32 ++++++++++++++--------------- include/cantera/clib/ctfunc.h | 2 +- include/cantera/clib/ctmultiphase.h | 10 ++++----- include/cantera/clib/ctonedim.h | 30 +++++++++++++-------------- include/cantera/clib/ctreactor.h | 4 ++-- include/cantera/clib/ctrpath.h | 18 ++++++++-------- include/cantera/clib/ctsurf.h | 6 +++--- src/clib/ct.cpp | 30 +++++++++++++-------------- src/clib/ctfunc.cpp | 2 +- src/clib/ctmultiphase.cpp | 12 +++++------ src/clib/ctonedim.cpp | 30 +++++++++++++-------------- src/clib/ctreactor.cpp | 4 ++-- src/clib/ctrpath.cpp | 18 ++++++++-------- src/clib/ctsurf.cpp | 6 +++--- 14 files changed, 102 insertions(+), 102 deletions(-) diff --git a/include/cantera/clib/ct.h b/include/cantera/clib/ct.h index 072f42a13..f57cfff51 100644 --- a/include/cantera/clib/ct.h +++ b/include/cantera/clib/ct.h @@ -32,23 +32,23 @@ extern "C" { double* x, int norm); CANTERA_CAPI int phase_setMassFractions(int n, size_t leny, double* y, int norm); - CANTERA_CAPI int phase_setMoleFractionsByName(int n, char* x); - CANTERA_CAPI int phase_setMassFractionsByName(int n, char* y); + CANTERA_CAPI int phase_setMoleFractionsByName(int n, const char* x); + CANTERA_CAPI int phase_setMassFractionsByName(int n, const char* y); CANTERA_CAPI int phase_getAtomicWeights(int n, size_t lenm, double* atw); CANTERA_CAPI int phase_getMolecularWeights(int n, size_t lenm, double* mw); CANTERA_CAPI int phase_getElementName(int n, size_t k, size_t lennm, char* nm); CANTERA_CAPI int phase_getSpeciesName(int n, size_t m, size_t lennm, char* nm); CANTERA_CAPI int phase_getName(int n, size_t lennm, char* nm); CANTERA_CAPI int phase_setName(int n, const char* nm); - CANTERA_CAPI size_t phase_elementIndex(int n, char* nm); - CANTERA_CAPI size_t phase_speciesIndex(int n, char* nm); + CANTERA_CAPI size_t phase_elementIndex(int n, const char* nm); + CANTERA_CAPI size_t phase_speciesIndex(int n, const char* nm); CANTERA_CAPI int phase_report(int nth, int ibuf, char* buf, int show_thermo); CANTERA_CAPI int write_phase(int nth, int show_thermo, double threshold); CANTERA_CAPI double phase_nAtoms(int n, size_t k, size_t m); - CANTERA_CAPI int phase_addElement(int n, char* name, double weight); + CANTERA_CAPI int phase_addElement(int n, const char* name, double weight); CANTERA_CAPI int newThermoFromXML(int mxml); CANTERA_CAPI size_t th_nSpecies(size_t n); @@ -91,7 +91,7 @@ extern "C" { CANTERA_CAPI int th_set_VH(int n, double* vals); CANTERA_CAPI int th_set_TH(int n, double* vals); CANTERA_CAPI int th_set_SH(int n, double* vals); - CANTERA_CAPI int th_equil(int n, char* XY, int solver, + CANTERA_CAPI int th_equil(int n, const char* XY, int solver, double rtol, int maxsteps, int maxiter, int loglevel); CANTERA_CAPI double th_critTemperature(int n); @@ -107,11 +107,11 @@ extern "C" { int neighbor1, int neighbor2, int neighbor3, int neighbor4); CANTERA_CAPI int installRxnArrays(int pxml, int ikin, - char* default_phase); + const char* default_phase); CANTERA_CAPI size_t kin_nSpecies(int n); CANTERA_CAPI size_t kin_nReactions(int n); CANTERA_CAPI size_t kin_nPhases(int n); - CANTERA_CAPI size_t kin_phaseIndex(int n, char* ph); + CANTERA_CAPI size_t kin_phaseIndex(int n, const char* ph); CANTERA_CAPI size_t kin_reactionPhaseIndex(int n); CANTERA_CAPI double kin_reactantStoichCoeff(int n, int i, int k); CANTERA_CAPI double kin_productStoichCoeff(int n, int i, int k); @@ -139,7 +139,7 @@ extern "C" { CANTERA_CAPI int kin_advanceCoverages(int n, double tstep); CANTERA_CAPI size_t kin_phase(int n, size_t i); - CANTERA_CAPI size_t newTransport(char* model, + CANTERA_CAPI size_t newTransport(const char* model, int th, int loglevel); CANTERA_CAPI double trans_viscosity(int n); CANTERA_CAPI double trans_electricalConductivity(int n); @@ -154,23 +154,23 @@ extern "C" { CANTERA_CAPI int trans_getMassFluxes(int n, const double* state1, const double* state2, double delta, double* fluxes); - CANTERA_CAPI int import_phase(int nth, int nxml, char* id); - CANTERA_CAPI int import_kinetics(int nxml, char* id, - int nphases, int* ith, int nkin); + CANTERA_CAPI int import_phase(int nth, int nxml, const char* id); + CANTERA_CAPI int import_kinetics(int nxml, const char* id, + int nphases, const int* ith, int nkin); CANTERA_CAPI int getCanteraError(int buflen, char* buf); CANTERA_CAPI int showCanteraErrors(); CANTERA_CAPI int setLogWriter(void* logger); - CANTERA_CAPI int addCanteraDirectory(size_t buflen, char* buf); + CANTERA_CAPI int addCanteraDirectory(size_t buflen, const char* buf); CANTERA_CAPI int clearStorage(); CANTERA_CAPI int delThermo(int n); CANTERA_CAPI int delKinetics(int n); CANTERA_CAPI int delTransport(int n); CANTERA_CAPI int readlog(int n, char* buf); - CANTERA_CAPI int buildSolutionFromXML(char* src, int ixml, char* id, + CANTERA_CAPI int buildSolutionFromXML(const char* src, int ixml, const char* id, int ith, int ikin); - CANTERA_CAPI int ck_to_cti(char* in_file, char* db_file, - char* tr_file, char* id_tag, int debug, int validate); + CANTERA_CAPI int ck_to_cti(const char* in_file, const char* db_file, + const char* tr_file, const char* id_tag, int debug, int validate); #ifdef __cplusplus } diff --git a/include/cantera/clib/ctfunc.h b/include/cantera/clib/ctfunc.h index 9fe8220f2..76eee2a63 100644 --- a/include/cantera/clib/ctfunc.h +++ b/include/cantera/clib/ctfunc.h @@ -14,7 +14,7 @@ extern "C" { #endif - CANTERA_CAPI int func_new(int type, size_t n, size_t lenp, double* p); + CANTERA_CAPI int func_new(int type, size_t n, size_t lenp, const double* p); CANTERA_CAPI int func_del(int i); CANTERA_CAPI int func_clear(); CANTERA_CAPI int func_copy(int i); diff --git a/include/cantera/clib/ctmultiphase.h b/include/cantera/clib/ctmultiphase.h index a8bd72120..43587c449 100644 --- a/include/cantera/clib/ctmultiphase.h +++ b/include/cantera/clib/ctmultiphase.h @@ -22,7 +22,7 @@ extern "C" { CANTERA_CAPI int mix_init(int i); CANTERA_CAPI int mix_updatePhases(int i); CANTERA_CAPI size_t mix_nElements(int i); - CANTERA_CAPI size_t mix_elementIndex(int i, char* name); + CANTERA_CAPI size_t mix_elementIndex(int i, const char* name); CANTERA_CAPI size_t mix_speciesIndex(int i, int k, int p); CANTERA_CAPI size_t mix_nSpecies(int i); CANTERA_CAPI int mix_setTemperature(int i, double t); @@ -37,13 +37,13 @@ extern "C" { CANTERA_CAPI size_t mix_nPhases(int i); CANTERA_CAPI double mix_phaseMoles(int i, int n); CANTERA_CAPI int mix_setPhaseMoles(int i, int n, double v); - CANTERA_CAPI int mix_setMoles(int i, size_t nlen, double* n); - CANTERA_CAPI int mix_setMolesByName(int i, char* n); + CANTERA_CAPI int mix_setMoles(int i, size_t nlen, const double* n); + CANTERA_CAPI int mix_setMolesByName(int i, const char* n); CANTERA_CAPI double mix_speciesMoles(int i, int k); CANTERA_CAPI double mix_elementMoles(int i, int m); - CANTERA_CAPI double mix_equilibrate(int i, char* XY, double err, + CANTERA_CAPI double mix_equilibrate(int i, const char* XY, double err, int maxsteps, int maxiter, int loglevel); - CANTERA_CAPI double mix_vcs_equilibrate(int i, char* XY, int estimateEquil, + CANTERA_CAPI double mix_vcs_equilibrate(int i, const char* XY, int estimateEquil, int printLvl, int solver, double rtol, int maxsteps, int maxiter, int loglevel); diff --git a/include/cantera/clib/ctonedim.h b/include/cantera/clib/ctonedim.h index b707f8163..83af12410 100644 --- a/include/cantera/clib/ctonedim.h +++ b/include/cantera/clib/ctonedim.h @@ -21,7 +21,7 @@ extern "C" { CANTERA_CAPI size_t domain_nComponents(int i); CANTERA_CAPI size_t domain_nPoints(int i); CANTERA_CAPI int domain_componentName(int i, int n, int sz, char* nameout); - CANTERA_CAPI size_t domain_componentIndex(int i, char* name); + CANTERA_CAPI size_t domain_componentIndex(int i, const char* name); CANTERA_CAPI int domain_setBounds(int i, int n, double lower, double upper); CANTERA_CAPI double domain_lowerBound(int i, int n); @@ -32,14 +32,14 @@ extern "C" { double atol); CANTERA_CAPI double domain_rtol(int i, int n); CANTERA_CAPI double domain_atol(int i, int n); - CANTERA_CAPI int domain_setupGrid(int i, size_t npts, double* grid); - CANTERA_CAPI int domain_setID(int i, char* id); - CANTERA_CAPI int domain_setDesc(int i, char* desc); + CANTERA_CAPI int domain_setupGrid(int i, size_t npts, const double* grid); + CANTERA_CAPI int domain_setID(int i, const char* id); + CANTERA_CAPI int domain_setDesc(int i, const char* desc); CANTERA_CAPI double domain_grid(int i, int n); CANTERA_CAPI int bdry_setMdot(int i, double mdot); CANTERA_CAPI int bdry_setTemperature(int i, double t); - CANTERA_CAPI int bdry_setMoleFractions(int i, char* x); + CANTERA_CAPI int bdry_setMoleFractions(int i, const char* x); CANTERA_CAPI double bdry_temperature(int i); CANTERA_CAPI double bdry_massFraction(int i, int k); CANTERA_CAPI double bdry_mdot(int i); @@ -61,30 +61,30 @@ extern "C" { CANTERA_CAPI int stflow_enableSoret(int i, int iSoret); CANTERA_CAPI int stflow_setPressure(int i, double p); CANTERA_CAPI double stflow_pressure(int i); - CANTERA_CAPI int stflow_setFixedTempProfile(int i, size_t n, double* pos, - size_t m, double* temp); + CANTERA_CAPI int stflow_setFixedTempProfile(int i, size_t n, const double* pos, + size_t m, const double* temp); CANTERA_CAPI int stflow_solveEnergyEqn(int i, int flag); CANTERA_CAPI int sim1D_clear(); - CANTERA_CAPI int sim1D_new(size_t nd, int* domains); + CANTERA_CAPI int sim1D_new(size_t nd, const int* domains); CANTERA_CAPI int sim1D_del(int i); CANTERA_CAPI int sim1D_setValue(int i, int dom, int comp, int localPoint, double value); CANTERA_CAPI int sim1D_setProfile(int i, int dom, int comp, - size_t np, double* pos, size_t nv, double* v); + size_t np, const double* pos, size_t nv, const double* v); CANTERA_CAPI int sim1D_setFlatProfile(int i, int dom, int comp, double v); - CANTERA_CAPI int sim1D_showSolution(int i, char* fname); - CANTERA_CAPI int sim1D_setTimeStep(int i, double stepsize, size_t ns, integer* nsteps); + CANTERA_CAPI int sim1D_showSolution(int i, const char* fname); + CANTERA_CAPI int sim1D_setTimeStep(int i, double stepsize, size_t ns, const int* nsteps); CANTERA_CAPI int sim1D_getInitialSoln(int i); CANTERA_CAPI int sim1D_solve(int i, int loglevel, int refine_grid); CANTERA_CAPI int sim1D_refine(int i, int loglevel); CANTERA_CAPI int sim1D_setRefineCriteria(int i, int dom, double ratio, double slope, double curve, double prune); CANTERA_CAPI int sim1D_setGridMin(int i, int dom, double gridmin); - CANTERA_CAPI int sim1D_save(int i, char* fname, char* id, - char* desc); - CANTERA_CAPI int sim1D_restore(int i, char* fname, char* id); + CANTERA_CAPI int sim1D_save(int i, const char* fname, const char* id, + const char* desc); + CANTERA_CAPI int sim1D_restore(int i, const char* fname, const char* id); CANTERA_CAPI int sim1D_writeStats(int i, int printTime); - CANTERA_CAPI int sim1D_domainIndex(int i, char* name); + CANTERA_CAPI int sim1D_domainIndex(int i, const char* name); CANTERA_CAPI double sim1D_value(int i, int idom, int icomp, int localPoint); CANTERA_CAPI double sim1D_workValue(int i, int idom, int icomp, int localPoint); diff --git a/include/cantera/clib/ctreactor.h b/include/cantera/clib/ctreactor.h index 48031c202..c13ebe0f4 100644 --- a/include/cantera/clib/ctreactor.h +++ b/include/cantera/clib/ctreactor.h @@ -47,7 +47,7 @@ extern "C" { CANTERA_CAPI double reactornet_time(int i); CANTERA_CAPI double reactornet_rtol(int i); CANTERA_CAPI double reactornet_atol(int i); - CANTERA_CAPI double reactornet_sensitivity(int i, char* v, int p, int r); + CANTERA_CAPI double reactornet_sensitivity(int i, const char* v, int p, int r); CANTERA_CAPI int flowdev_new(int type); CANTERA_CAPI int flowdev_del(int i); @@ -55,7 +55,7 @@ extern "C" { CANTERA_CAPI int flowdev_setMaster(int i, int n); CANTERA_CAPI double flowdev_massFlowRate(int i, double time); CANTERA_CAPI int flowdev_setMassFlowRate(int i, double mdot); - CANTERA_CAPI int flowdev_setParameters(int i, int n, double* v); + CANTERA_CAPI int flowdev_setParameters(int i, int n, const double* v); CANTERA_CAPI int flowdev_setFunction(int i, int n); CANTERA_CAPI int flowdev_ready(int i); diff --git a/include/cantera/clib/ctrpath.h b/include/cantera/clib/ctrpath.h index 1b263475e..8e44c664a 100644 --- a/include/cantera/clib/ctrpath.h +++ b/include/cantera/clib/ctrpath.h @@ -19,27 +19,27 @@ extern "C" { CANTERA_CAPI int rdiag_detailed(int i); CANTERA_CAPI int rdiag_brief(int i); CANTERA_CAPI int rdiag_setThreshold(int i, double v); - CANTERA_CAPI int rdiag_setBoldColor(int i, char* color); - CANTERA_CAPI int rdiag_setNormalColor(int i, char* color); - CANTERA_CAPI int rdiag_setDashedColor(int i, char* color); - CANTERA_CAPI int rdiag_setDotOptions(int i, char* opt); + CANTERA_CAPI int rdiag_setBoldColor(int i, const char* color); + CANTERA_CAPI int rdiag_setNormalColor(int i, const char* color); + CANTERA_CAPI int rdiag_setDashedColor(int i, const char* color); + CANTERA_CAPI int rdiag_setDotOptions(int i, const char* opt); CANTERA_CAPI int rdiag_setBoldThreshold(int i, double v); CANTERA_CAPI int rdiag_setNormalThreshold(int i, double v); CANTERA_CAPI int rdiag_setLabelThreshold(int i, double v); CANTERA_CAPI int rdiag_setScale(int i, double v); CANTERA_CAPI int rdiag_setFlowType(int i, int iflow); CANTERA_CAPI int rdiag_setArrowWidth(int i, double v); - CANTERA_CAPI int rdiag_setTitle(int i, char* title); - CANTERA_CAPI int rdiag_write(int i, int fmt, char* fname); + CANTERA_CAPI int rdiag_setTitle(int i, const char* title); + CANTERA_CAPI int rdiag_write(int i, int fmt, const char* fname); CANTERA_CAPI int rdiag_add(int i, int n); CANTERA_CAPI int rdiag_findMajor(int i, double threshold, size_t lda, double* a); - CANTERA_CAPI int rdiag_setFont(int i, char* font); + CANTERA_CAPI int rdiag_setFont(int i, const char* font); CANTERA_CAPI int rdiag_displayOnly(int i, int k); CANTERA_CAPI int rbuild_new(); CANTERA_CAPI int rbuild_del(int i); - CANTERA_CAPI int rbuild_init(int i, char* logfile, int k); - CANTERA_CAPI int rbuild_build(int i, int k, char* el, char* dotfile, + CANTERA_CAPI int rbuild_init(int i, const char* logfile, int k); + CANTERA_CAPI int rbuild_build(int i, int k, const char* el, const char* dotfile, int idiag, int iquiet); CANTERA_CAPI int clear_rxnpath(); diff --git a/include/cantera/clib/ctsurf.h b/include/cantera/clib/ctsurf.h index 94dec6e3f..895dd9bb8 100644 --- a/include/cantera/clib/ctsurf.h +++ b/include/cantera/clib/ctsurf.h @@ -14,13 +14,13 @@ extern "C" { #endif - CANTERA_CAPI int surf_setcoverages(int i, double* c, int norm); + CANTERA_CAPI int surf_setcoverages(int i, const double* c, int norm); CANTERA_CAPI int surf_getcoverages(int i, double* c); - CANTERA_CAPI int surf_setconcentrations(int i, double* c); + CANTERA_CAPI int surf_setconcentrations(int i, const double* c); CANTERA_CAPI int surf_getconcentrations(int i, double* c); CANTERA_CAPI int surf_setsitedensity(int i, double s0); CANTERA_CAPI double surf_sitedensity(int i); - CANTERA_CAPI int surf_setcoveragesbyname(int i, char* c); + CANTERA_CAPI int surf_setcoveragesbyname(int i, const char* c); #ifdef __cplusplus } diff --git a/src/clib/ct.cpp b/src/clib/ct.cpp index ddbc55e1a..35360711c 100644 --- a/src/clib/ct.cpp +++ b/src/clib/ct.cpp @@ -143,7 +143,7 @@ extern "C" { } } - size_t phase_elementIndex(int n, char* nm) + size_t phase_elementIndex(int n, const char* nm) { try { return ThermoCabinet::item(n).elementIndex(nm); @@ -152,7 +152,7 @@ extern "C" { } } - size_t phase_speciesIndex(int n, char* nm) + size_t phase_speciesIndex(int n, const char* nm) { try { return ThermoCabinet::item(n).speciesIndex(nm); @@ -219,7 +219,7 @@ extern "C" { } } - int phase_setMoleFractionsByName(int n, char* x) + int phase_setMoleFractionsByName(int n, const char* x) { try { ThermoPhase& p = ThermoCabinet::item(n); @@ -247,7 +247,7 @@ extern "C" { } } - int phase_setMassFractionsByName(int n, char* y) + int phase_setMassFractionsByName(int n, const char* y) { try { ThermoPhase& p = ThermoCabinet::item(n); @@ -334,7 +334,7 @@ extern "C" { } } - int phase_addElement(int n, char* name, doublereal weight) + int phase_addElement(int n, const char* name, doublereal weight) { try { ThermoCabinet::item(n).addElement(name, weight); @@ -674,7 +674,7 @@ extern "C" { } } - int th_equil(int n, char* XY, int solver, + int th_equil(int n, const char* XY, int solver, double rtol, int maxsteps, int maxiter, int loglevel) { try { @@ -913,7 +913,7 @@ extern "C" { } int installRxnArrays(int pxml, int ikin, - char* default_phase) + const char* default_phase) { try { XML_Node& p = XmlCabinet::item(pxml); @@ -982,7 +982,7 @@ extern "C" { } } - size_t kin_phaseIndex(int n, char* ph) + size_t kin_phaseIndex(int n, const char* ph) { try { return KineticsCabinet::item(n).phaseIndex(ph); @@ -1267,7 +1267,7 @@ extern "C" { //------------------- Transport --------------------------- - size_t newTransport(char* model, int ith, int loglevel) + size_t newTransport(const char* model, int ith, int loglevel) { try { Transport* tr = newTransportMgr(model, &ThermoCabinet::item(ith), @@ -1389,7 +1389,7 @@ extern "C" { //-------------------- Functions --------------------------- - int import_phase(int nth, int nxml, char* id) + int import_phase(int nth, int nxml, const char* id) { try { ThermoPhase& thrm = ThermoCabinet::item(nth); @@ -1401,7 +1401,7 @@ extern "C" { } } - int import_kinetics(int nxml, char* id, int nphases, integer* ith, int nkin) + int import_kinetics(int nxml, const char* id, int nphases, const int* ith, int nkin) { try { vector phases; @@ -1465,7 +1465,7 @@ extern "C" { } } - int addCanteraDirectory(size_t buflen, char* buf) + int addCanteraDirectory(size_t buflen, const char* buf) { try { addDirectory(buf); @@ -1547,7 +1547,7 @@ extern "C" { } } - int buildSolutionFromXML(char* src, int ixml, char* id, + int buildSolutionFromXML(const char* src, int ixml, const char* id, int ith, int ikin) { try { @@ -1584,8 +1584,8 @@ extern "C" { } } - int ck_to_cti(char* in_file, char* db_file, char* tr_file, - char* id_tag, int debug, int validate) + int ck_to_cti(const char* in_file, const char* db_file, const char* tr_file, + const char* id_tag, int debug, int validate) { try { ck2cti(in_file, db_file, tr_file, id_tag); diff --git a/src/clib/ctfunc.cpp b/src/clib/ctfunc.cpp index 319a1b8b9..307101313 100644 --- a/src/clib/ctfunc.cpp +++ b/src/clib/ctfunc.cpp @@ -26,7 +26,7 @@ extern "C" { // functions - int func_new(int type, size_t n, size_t lenp, double* params) + int func_new(int type, size_t n, size_t lenp, const double* params) { try { func_t* r=0; diff --git a/src/clib/ctmultiphase.cpp b/src/clib/ctmultiphase.cpp index 3e6040de0..5cde74a5d 100644 --- a/src/clib/ctmultiphase.cpp +++ b/src/clib/ctmultiphase.cpp @@ -98,7 +98,7 @@ extern "C" { } } - size_t mix_elementIndex(int i, char* name) + size_t mix_elementIndex(int i, const char* name) { try { return mixCabinet::item(i).elementIndex(name); @@ -176,7 +176,7 @@ extern "C" { } } - int mix_setMoles(int i, size_t nlen, double* n) + int mix_setMoles(int i, size_t nlen, const double* n) { try { MultiPhase& mix = mixCabinet::item(i); @@ -189,7 +189,7 @@ extern "C" { } - int mix_setMolesByName(int i, char* n) + int mix_setMolesByName(int i, const char* n) { try { mixCabinet::item(i).setMolesByName(n); @@ -305,8 +305,8 @@ extern "C" { } } - doublereal mix_equilibrate(int i, char* XY, doublereal rtol, int maxsteps, - int maxiter, int loglevel) + doublereal mix_equilibrate(int i, const char* XY, doublereal rtol, + int maxsteps, int maxiter, int loglevel) { try { mixCabinet::item(i).equilibrate(XY, "auto", rtol, maxsteps, maxiter, @@ -317,7 +317,7 @@ extern "C" { } } - doublereal mix_vcs_equilibrate(int i, char* XY, int estimateEquil, + doublereal mix_vcs_equilibrate(int i, const char* XY, int estimateEquil, int printLvl, int solver, doublereal rtol, int maxsteps, int maxiter, int loglevel) { diff --git a/src/clib/ctonedim.cpp b/src/clib/ctonedim.cpp index 56792278a..53d618586 100644 --- a/src/clib/ctonedim.cpp +++ b/src/clib/ctonedim.cpp @@ -100,7 +100,7 @@ extern "C" { } } - size_t domain_componentIndex(int i, char* name) + size_t domain_componentIndex(int i, const char* name) { try { return DomainCabinet::item(i).componentIndex(name); @@ -202,7 +202,7 @@ extern "C" { } } - int domain_setupGrid(int i, size_t npts, double* grid) + int domain_setupGrid(int i, size_t npts, const double* grid) { try { DomainCabinet::item(i).setupGrid(npts, grid); @@ -212,7 +212,7 @@ extern "C" { } } - int domain_setID(int i, char* id) + int domain_setID(int i, const char* id) { try { DomainCabinet::item(i).setID(id); @@ -223,7 +223,7 @@ extern "C" { } - int domain_setDesc(int i, char* desc) + int domain_setDesc(int i, const char* desc) { try { DomainCabinet::item(i).setDesc(desc); @@ -308,7 +308,7 @@ extern "C" { } } - int bdry_setMoleFractions(int i, char* x) + int bdry_setMoleFractions(int i, const char* x) { try { DomainCabinet::get(i).setMoleFractions(x); @@ -442,8 +442,8 @@ extern "C" { } } - int stflow_setFixedTempProfile(int i, size_t n, double* pos, - size_t m, double* temp) + int stflow_setFixedTempProfile(int i, size_t n, const double* pos, + size_t m, const double* temp) { try { vector_fp vpos(n), vtemp(n); @@ -474,7 +474,7 @@ extern "C" { //------------------- Sim1D -------------------------------------- - int sim1D_new(size_t nd, int* domains) + int sim1D_new(size_t nd, const int* domains) { try { vector d; @@ -517,8 +517,8 @@ extern "C" { } } - int sim1D_setProfile(int i, int dom, int comp, - size_t np, double* pos, size_t nv, double* v) + int sim1D_setProfile(int i, int dom, int comp, size_t np, const double* pos, + size_t nv, const double* v) { try { Sim1D& sim = SimCabinet::item(i); @@ -549,7 +549,7 @@ extern "C" { } } - int sim1D_showSolution(int i, char* fname) + int sim1D_showSolution(int i, const char* fname) { try { string fn = string(fname); @@ -565,7 +565,7 @@ extern "C" { } } - int sim1D_setTimeStep(int i, double stepsize, size_t ns, integer* nsteps) + int sim1D_setTimeStep(int i, double stepsize, size_t ns, const int* nsteps) { try { SimCabinet::item(i).setTimeStep(stepsize, ns, nsteps); @@ -627,7 +627,7 @@ extern "C" { } } - int sim1D_save(int i, char* fname, char* id, char* desc) + int sim1D_save(int i, const char* fname, const char* id, const char* desc) { try { SimCabinet::item(i).save(fname, id, desc); @@ -637,7 +637,7 @@ extern "C" { } } - int sim1D_restore(int i, char* fname, char* id) + int sim1D_restore(int i, const char* fname, const char* id) { try { SimCabinet::item(i).restore(fname, id); @@ -657,7 +657,7 @@ extern "C" { } } - int sim1D_domainIndex(int i, char* name) + int sim1D_domainIndex(int i, const char* name) { try { return (int) SimCabinet::item(i).domainIndex(name); diff --git a/src/clib/ctreactor.cpp b/src/clib/ctreactor.cpp index b9610e7ab..1d734123d 100644 --- a/src/clib/ctreactor.cpp +++ b/src/clib/ctreactor.cpp @@ -355,7 +355,7 @@ extern "C" { } } - double reactornet_sensitivity(int i, char* v, int p, int r) + double reactornet_sensitivity(int i, const char* v, int p, int r) { try { return NetworkCabinet::item(i).sensitivity(v, p, r); @@ -443,7 +443,7 @@ extern "C" { } } - int flowdev_setParameters(int i, int n, double* v) + int flowdev_setParameters(int i, int n, const double* v) { try { FlowDeviceCabinet::item(i).setParameters(n, v); diff --git a/src/clib/ctrpath.cpp b/src/clib/ctrpath.cpp index 93067ef2f..9a980828b 100644 --- a/src/clib/ctrpath.cpp +++ b/src/clib/ctrpath.cpp @@ -85,7 +85,7 @@ extern "C" { } } - int rdiag_setBoldColor(int i, char* color) + int rdiag_setBoldColor(int i, const char* color) { try { DiagramCabinet::item(i).bold_color = color; @@ -95,7 +95,7 @@ extern "C" { } } - int rdiag_setNormalColor(int i, char* color) + int rdiag_setNormalColor(int i, const char* color) { try { DiagramCabinet::item(i).normal_color = color; @@ -105,7 +105,7 @@ extern "C" { } } - int rdiag_setDashedColor(int i, char* color) + int rdiag_setDashedColor(int i, const char* color) { try { DiagramCabinet::item(i).dashed_color = color; @@ -115,7 +115,7 @@ extern "C" { } } - int rdiag_setDotOptions(int i, char* opt) + int rdiag_setDotOptions(int i, const char* opt) { try { DiagramCabinet::item(i).dot_options = opt; @@ -125,7 +125,7 @@ extern "C" { } } - int rdiag_setFont(int i, char* font) + int rdiag_setFont(int i, const char* font) { try { DiagramCabinet::item(i).setFont(font); @@ -199,7 +199,7 @@ extern "C" { } } - int rdiag_setTitle(int i, char* title) + int rdiag_setTitle(int i, const char* title) { try { DiagramCabinet::item(i).title = title; @@ -230,7 +230,7 @@ extern "C" { } } - int rdiag_write(int i, int fmt, char* fname) + int rdiag_write(int i, int fmt, const char* fname) { try { ofstream f(fname); @@ -275,7 +275,7 @@ extern "C" { } } - int rbuild_init(int i, char* logfile, int k) + int rbuild_init(int i, const char* logfile, int k) { try { ofstream flog(logfile); @@ -286,7 +286,7 @@ extern "C" { } } - int rbuild_build(int i, int k, char* el, char* dotfile, + int rbuild_build(int i, int k, const char* el, const char* dotfile, int idiag, int iquiet) { try { diff --git a/src/clib/ctsurf.cpp b/src/clib/ctsurf.cpp index 44275ecf3..6590c6e01 100644 --- a/src/clib/ctsurf.cpp +++ b/src/clib/ctsurf.cpp @@ -39,7 +39,7 @@ extern "C" { } } - int surf_setcoverages(int i, double* c, int norm) + int surf_setcoverages(int i, const double* c, int norm) { try { if(norm){ @@ -53,7 +53,7 @@ extern "C" { } } - int surf_setcoveragesbyname(int i, char* c) + int surf_setcoveragesbyname(int i, const char* c) { try { ThermoCabinet::get(i).setCoveragesByName(c); @@ -73,7 +73,7 @@ extern "C" { } } - int surf_setconcentrations(int i, double* c) + int surf_setconcentrations(int i, const double* c) { try { ThermoCabinet::get(i).setConcentrations(c);