Squashed 'src/' changes from 2bcb24a8..f627828f

f627828f Merge commit 'c1c1f286b61ca73ae3204c7fa4831bb2e3066070'
c1c1f286 Squashed 'phreeqcpp/' changes from b6a23a2..faf8144
d051e14c Merge remote-tracking branch 'usgs-coupled/master'
7ad5a592 50 apple clang 15 with c++11 or higher reports warnings wwritable strings in pbasiccpp (#57)

git-subtree-dir: src
git-subtree-split: f627828fb52a2880ff95d7c341dc335b856fd8c5
This commit is contained in:
Darth Vader 2024-08-15 17:09:44 +00:00
parent 2d96a18877
commit d7222e4f0b
11 changed files with 15 additions and 15 deletions

View File

@ -931,7 +931,7 @@ void IPhreeqc::SetBasicCallback(double (*fcn)(double x1, double x2, const char *
this->PhreeqcPtr->register_basic_callback(fcn, cookie1); this->PhreeqcPtr->register_basic_callback(fcn, cookie1);
} }
#ifdef IPHREEQC_NO_FORTRAN_MODULE #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); this->PhreeqcPtr->register_fortran_basic_callback(fcn);
} }

View File

@ -1711,7 +1711,7 @@ Headings
* @include ic * @include ic
*/ */
#ifdef IPHREEQC_NO_FORTRAN_MODULE #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 #else
IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallback(int id, double (*fcn)(double *x1, double *x2, const char *str, int l)); IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallback(int id, double (*fcn)(double *x1, double *x2, const char *str, int l));
#endif #endif

View File

@ -718,7 +718,7 @@ public:
* @see SetBasicCallback * @see SetBasicCallback
*/ */
#ifdef IPHREEQC_NO_FORTRAN_MODULE #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 #else
void SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, const char *str, int l)); void SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, const char *str, int l));
#endif #endif

View File

@ -802,7 +802,7 @@ SetBasicCallback(int id, double (*fcn)(double x1, double x2, const char *str, vo
#if !defined(R_SO) #if !defined(R_SO)
#ifdef IPHREEQC_NO_FORTRAN_MODULE #ifdef IPHREEQC_NO_FORTRAN_MODULE
IPQ_RESULT 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); IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
if (IPhreeqcPtr) if (IPhreeqcPtr)

View File

@ -414,7 +414,7 @@ RunStringF(int *id, char* input)
} }
#ifdef IPHREEQC_NO_FORTRAN_MODULE #ifdef IPHREEQC_NO_FORTRAN_MODULE
IPQ_RESULT 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); return ::SetBasicFortranCallback(*id, fcn);
} }

View File

@ -133,7 +133,7 @@ extern "C" {
IPQ_DLL_EXPORT int RunFileF(int *id, char* filename); IPQ_DLL_EXPORT int RunFileF(int *id, char* filename);
IPQ_DLL_EXPORT int RunStringF(int *id, char* input); IPQ_DLL_EXPORT int RunStringF(int *id, char* input);
#ifdef IPHREEQC_NO_FORTRAN_MODULE #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 #else
IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, const char *str, int l)); IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallbackF(int *id, double (*fcn)(double *x1, double *x2, const char *str, int l));
#endif #endif

View File

@ -208,7 +208,7 @@ IPQ_DLL_EXPORT int IPQ_DECL IPQ_CASE_UND(runstring, RUNSTRING, runstring_, RUNS
{ {
return RunStringF(id, input, len); 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); return SetBasicFortranCallbackF(id, fcn);
} }

View File

@ -482,7 +482,7 @@ RunStringF(int *id, char* input, size_t input_length)
} }
IPQ_RESULT 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); return ::SetBasicFortranCallback(*id, fcn);
} }

View File

@ -135,7 +135,7 @@ extern "C" {
int RunAccumulatedF(int *id); int RunAccumulatedF(int *id);
int RunFileF(int *id, char* filename, size_t filename_length); int RunFileF(int *id, char* filename, size_t filename_length);
int RunStringF(int *id, char* input, size_t input_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 SetCurrentSelectedOutputUserNumberF(int *id, int *n);
IPQ_RESULT SetDumpFileNameF(int *id, char* fname, size_t fname_length); IPQ_RESULT SetDumpFileNameF(int *id, char* fname, size_t fname_length);
IPQ_RESULT SetDumpFileOnF(int *id, int* dump_on); IPQ_RESULT SetDumpFileOnF(int *id, int* dump_on);

View File

@ -93,13 +93,13 @@ public:
int basic_run(char* commands, void* lnbase, void* vbase, void* lpbase); int basic_run(char* commands, void* lnbase, void* vbase, void* lpbase);
void basic_free(void); void basic_free(void);
#ifdef IPHREEQC_NO_FORTRAN_MODULE #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 #else
double basic_callback(double x1, double x2, const char* str); double basic_callback(double x1, double x2, const char* str);
#endif #endif
void register_basic_callback(double (*fcn)(double x1, double x2, const char* str, void* cookie), void* cookie1); void register_basic_callback(double (*fcn)(double x1, double x2, const char* str, void* cookie), void* cookie1);
#ifdef IPHREEQC_NO_FORTRAN_MODULE #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 #else
void register_fortran_basic_callback(double (*fcn)(double* x1, double* x2, const char* str, int l)); void register_fortran_basic_callback(double (*fcn)(double* x1, double* x2, const char* str, int l));
#endif #endif
@ -1661,7 +1661,7 @@ protected:
double (*basic_callback_ptr) (double x1, double x2, const char* str, void* cookie); double (*basic_callback_ptr) (double x1, double x2, const char* str, void* cookie);
void* basic_callback_cookie; void* basic_callback_cookie;
#ifdef IPHREEQC_NO_FORTRAN_MODULE #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 #else
double (*basic_fortran_callback_ptr) (double* x1, double* x2, const char* str, int l); double (*basic_fortran_callback_ptr) (double* x1, double* x2, const char* str, int l);
#endif #endif

View File

@ -4242,7 +4242,7 @@ basic_callback(double x1, double x2, const char * str)
#ifdef IPHREEQC_NO_FORTRAN_MODULE #ifdef IPHREEQC_NO_FORTRAN_MODULE
double Phreeqc:: double Phreeqc::
basic_callback(double x1, double x2, char * str) basic_callback(double x1, double x2, const char * str)
#else #else
double Phreeqc:: double Phreeqc::
basic_callback(double x1, double x2, const char * str) 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) 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) 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 #ifdef IPHREEQC_NO_FORTRAN_MODULE
void 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; this->basic_fortran_callback_ptr = fcn;
} }