mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-15 16:18:22 +01:00
50 apple clang 15 with c++11 or higher reports warnings wwritable strings in pbasiccpp (#57)
Change char* -> const char* for callbacks
This commit is contained in:
parent
d3b4b10b79
commit
7ad5a592a7
@ -931,7 +931,7 @@ void IPhreeqc::SetBasicCallback(double (*fcn)(double x1, double x2, const char *
|
||||
this->PhreeqcPtr->register_basic_callback(fcn, cookie1);
|
||||
}
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
void IPhreeqc::SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, char *str, size_t l))
|
||||
void IPhreeqc::SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, const char *str, size_t l))
|
||||
{
|
||||
this->PhreeqcPtr->register_fortran_basic_callback(fcn);
|
||||
}
|
||||
|
||||
@ -1711,7 +1711,7 @@ Headings
|
||||
* @include ic
|
||||
*/
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallback(int id, double (*fcn)(double *x1, double *x2, char *str, size_t l));
|
||||
IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallback(int id, double (*fcn)(double *x1, double *x2, const char *str, size_t l));
|
||||
#else
|
||||
IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallback(int id, double (*fcn)(double *x1, double *x2, const char *str, int l));
|
||||
#endif
|
||||
|
||||
@ -718,7 +718,7 @@ public:
|
||||
* @see SetBasicCallback
|
||||
*/
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
void SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, char *str, size_t l));
|
||||
void SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, const char *str, size_t l));
|
||||
#else
|
||||
void SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, const char *str, int l));
|
||||
#endif
|
||||
|
||||
@ -802,7 +802,7 @@ SetBasicCallback(int id, double (*fcn)(double x1, double x2, const char *str, vo
|
||||
#if !defined(R_SO)
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
IPQ_RESULT
|
||||
SetBasicFortranCallback(int id, double (*fcn)(double *x1, double *x2, char *str, size_t l))
|
||||
SetBasicFortranCallback(int id, double (*fcn)(double *x1, double *x2, const char *str, size_t l))
|
||||
{
|
||||
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||
if (IPhreeqcPtr)
|
||||
|
||||
@ -414,7 +414,7 @@ RunStringF(int *id, char* input)
|
||||
}
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
IPQ_RESULT
|
||||
SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, char *str, size_t l))
|
||||
SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, const char *str, size_t l))
|
||||
{
|
||||
return ::SetBasicFortranCallback(*id, fcn);
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ extern "C" {
|
||||
IPQ_DLL_EXPORT int RunFileF(int *id, char* filename);
|
||||
IPQ_DLL_EXPORT int RunStringF(int *id, char* input);
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, char *str, size_t l));
|
||||
IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, const char *str, size_t l));
|
||||
#else
|
||||
IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, const char *str, int l));
|
||||
#endif
|
||||
|
||||
2
fimpl.h
2
fimpl.h
@ -208,7 +208,7 @@ IPQ_DLL_EXPORT int IPQ_DECL IPQ_CASE_UND(runstring, RUNSTRING, runstring_, RUNS
|
||||
{
|
||||
return RunStringF(id, input, len);
|
||||
}
|
||||
IPQ_DLL_EXPORT int IPQ_DECL IPQ_CASE_UND(setbasicfortrancallback, SETBASICFORTRANCALLBACK, setbasicfortrancallback_, SETBASICFORTRANCALLBACK_)(int *id, double (*fcn)(double *x1, double *x2, char *str, size_t l))
|
||||
IPQ_DLL_EXPORT int IPQ_DECL IPQ_CASE_UND(setbasicfortrancallback, SETBASICFORTRANCALLBACK, setbasicfortrancallback_, SETBASICFORTRANCALLBACK_)(int *id, double (*fcn)(double *x1, double *x2, const char *str, size_t l))
|
||||
{
|
||||
return SetBasicFortranCallbackF(id, fcn);
|
||||
}
|
||||
|
||||
@ -482,7 +482,7 @@ RunStringF(int *id, char* input, size_t input_length)
|
||||
}
|
||||
|
||||
IPQ_RESULT
|
||||
SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, char *str, size_t l))
|
||||
SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, const char *str, size_t l))
|
||||
{
|
||||
return ::SetBasicFortranCallback(*id, fcn);
|
||||
}
|
||||
|
||||
2
fwrap.h
2
fwrap.h
@ -135,7 +135,7 @@ extern "C" {
|
||||
int RunAccumulatedF(int *id);
|
||||
int RunFileF(int *id, char* filename, size_t filename_length);
|
||||
int RunStringF(int *id, char* input, size_t input_length);
|
||||
IPQ_RESULT SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, char *str, size_t l));
|
||||
IPQ_RESULT SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, const char *str, size_t l));
|
||||
IPQ_RESULT SetCurrentSelectedOutputUserNumberF(int *id, int *n);
|
||||
IPQ_RESULT SetDumpFileNameF(int *id, char* fname, size_t fname_length);
|
||||
IPQ_RESULT SetDumpFileOnF(int *id, int* dump_on);
|
||||
|
||||
@ -93,13 +93,13 @@ public:
|
||||
int basic_run(char* commands, void* lnbase, void* vbase, void* lpbase);
|
||||
void basic_free(void);
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
double basic_callback(double x1, double x2, char* str);
|
||||
double basic_callback(double x1, double x2, const char* str);
|
||||
#else
|
||||
double basic_callback(double x1, double x2, const char* str);
|
||||
#endif
|
||||
void register_basic_callback(double (*fcn)(double x1, double x2, const char* str, void* cookie), void* cookie1);
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
void register_fortran_basic_callback(double (*fcn)(double* x1, double* x2, char* str, size_t l));
|
||||
void register_fortran_basic_callback(double (*fcn)(double* x1, double* x2, const char* str, size_t l));
|
||||
#else
|
||||
void register_fortran_basic_callback(double (*fcn)(double* x1, double* x2, const char* str, int l));
|
||||
#endif
|
||||
@ -1661,7 +1661,7 @@ protected:
|
||||
double (*basic_callback_ptr) (double x1, double x2, const char* str, void* cookie);
|
||||
void* basic_callback_cookie;
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
double (*basic_fortran_callback_ptr) (double* x1, double* x2, char* str, size_t l);
|
||||
double (*basic_fortran_callback_ptr) (double* x1, double* x2, const char* str, size_t l);
|
||||
#else
|
||||
double (*basic_fortran_callback_ptr) (double* x1, double* x2, const char* str, int l);
|
||||
#endif
|
||||
|
||||
@ -4242,7 +4242,7 @@ basic_callback(double x1, double x2, const char * str)
|
||||
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
double Phreeqc::
|
||||
basic_callback(double x1, double x2, char * str)
|
||||
basic_callback(double x1, double x2, const char * str)
|
||||
#else
|
||||
double Phreeqc::
|
||||
basic_callback(double x1, double x2, const char * str)
|
||||
@ -4253,7 +4253,7 @@ basic_callback(double x1, double x2, const char * str)
|
||||
|
||||
if (basic_callback_ptr != NULL)
|
||||
{
|
||||
return (*basic_callback_ptr) (x1, x2, (const char *) str, basic_callback_cookie);
|
||||
return (*basic_callback_ptr) (x1, x2, str, basic_callback_cookie);
|
||||
}
|
||||
if (basic_fortran_callback_ptr != NULL)
|
||||
{
|
||||
@ -4274,7 +4274,7 @@ Phreeqc::register_basic_callback(double (*fcn)(double x1, double x2, const char
|
||||
}
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
void
|
||||
Phreeqc::register_fortran_basic_callback(double ( *fcn)(double *x1, double *x2, char *str, size_t l))
|
||||
Phreeqc::register_fortran_basic_callback(double ( *fcn)(double *x1, double *x2, const char *str, size_t l))
|
||||
{
|
||||
this->basic_fortran_callback_ptr = fcn;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user