From d7222e4f0b773e52ff448f83ba057ec492471ea1 Mon Sep 17 00:00:00 2001 From: Darth Vader Date: Thu, 15 Aug 2024 17:09:44 +0000 Subject: [PATCH] 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 --- IPhreeqc.cpp | 2 +- IPhreeqc.h | 2 +- IPhreeqc.hpp | 2 +- IPhreeqcLib.cpp | 2 +- IPhreeqc_interface_F.cpp | 2 +- IPhreeqc_interface_F.h | 2 +- fimpl.h | 2 +- fwrap.cpp | 2 +- fwrap.h | 2 +- phreeqcpp/Phreeqc.h | 6 +++--- phreeqcpp/basicsubs.cpp | 6 +++--- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/IPhreeqc.cpp b/IPhreeqc.cpp index c71c42ac..20b967b4 100644 --- a/IPhreeqc.cpp +++ b/IPhreeqc.cpp @@ -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); } diff --git a/IPhreeqc.h b/IPhreeqc.h index 62d99029..6be24c24 100644 --- a/IPhreeqc.h +++ b/IPhreeqc.h @@ -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 diff --git a/IPhreeqc.hpp b/IPhreeqc.hpp index c79957b5..036b14ca 100644 --- a/IPhreeqc.hpp +++ b/IPhreeqc.hpp @@ -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 diff --git a/IPhreeqcLib.cpp b/IPhreeqcLib.cpp index b57755ab..d0a3f0ba 100644 --- a/IPhreeqcLib.cpp +++ b/IPhreeqcLib.cpp @@ -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) diff --git a/IPhreeqc_interface_F.cpp b/IPhreeqc_interface_F.cpp index e25590fb..4063d748 100644 --- a/IPhreeqc_interface_F.cpp +++ b/IPhreeqc_interface_F.cpp @@ -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); } diff --git a/IPhreeqc_interface_F.h b/IPhreeqc_interface_F.h index d3fe29ec..3e77604f 100644 --- a/IPhreeqc_interface_F.h +++ b/IPhreeqc_interface_F.h @@ -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 diff --git a/fimpl.h b/fimpl.h index de9eb214..eddf5a45 100644 --- a/fimpl.h +++ b/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); } diff --git a/fwrap.cpp b/fwrap.cpp index bdec8e5a..6903c4f8 100644 --- a/fwrap.cpp +++ b/fwrap.cpp @@ -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); } diff --git a/fwrap.h b/fwrap.h index c95758d0..b4449f30 100644 --- a/fwrap.h +++ b/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); diff --git a/phreeqcpp/Phreeqc.h b/phreeqcpp/Phreeqc.h index 5607f2bc..ddff8262 100644 --- a/phreeqcpp/Phreeqc.h +++ b/phreeqcpp/Phreeqc.h @@ -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 diff --git a/phreeqcpp/basicsubs.cpp b/phreeqcpp/basicsubs.cpp index d49141da..c92e8c30 100644 --- a/phreeqcpp/basicsubs.cpp +++ b/phreeqcpp/basicsubs.cpp @@ -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; }