From 5ee4cc76fb277d63c9a77e15bdd65fcbb81ea02a Mon Sep 17 00:00:00 2001 From: Ansgar Wehrhahn <31626864+AWehrhahn@users.noreply.github.com> Date: Mon, 4 Apr 2022 16:12:32 +0200 Subject: [PATCH] Fix some constants in the pymodule interface --- pymodule/_smelib.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/pymodule/_smelib.cpp b/pymodule/_smelib.cpp index 51ceb2a..8ebb688 100644 --- a/pymodule/_smelib.cpp +++ b/pymodule/_smelib.cpp @@ -86,7 +86,7 @@ static PyObject * smelib_SetLibraryPath(PyObject * self, PyObject *args) static char smelib_InputWaveRange_docstring[] = "Read in Wavelength range"; static PyObject * smelib_InputWaveRange(PyObject * self, PyObject *args) { - int n = 2; + const int n = 2; const char * result = NULL; void * args_c[n]; double wmin, wmax; @@ -111,7 +111,7 @@ static PyObject * smelib_InputWaveRange(PyObject * self, PyObject *args) static char smelib_SetVWscale_docstring[] = "Set van der Waals scaling factor"; static PyObject * smelib_SetVWscale(PyObject * self, PyObject *args) { - int n = 1; + const int n = 1; const char * result = NULL; void * args_c[n]; double vwscale; @@ -134,7 +134,7 @@ static PyObject * smelib_SetVWscale(PyObject * self, PyObject *args) static char smelib_SetH2broad_docstring[] = "Set flag for H2 molecule"; static PyObject * smelib_SetH2broad(PyObject * self, PyObject *args) { - int n = 0; + const int n = 0; const char * result = NULL; void ** args_c = NULL; @@ -152,7 +152,7 @@ static PyObject * smelib_SetH2broad(PyObject * self, PyObject *args) static char smelib_ClearH2broad_docstring[] = "Clear flag for H2 molecule"; static PyObject * smelib_ClearH2broad(PyObject * self, PyObject *args) { - int n = 0; + const int n = 0; const char * result = NULL; void ** args_c = NULL; @@ -583,7 +583,7 @@ static PyObject * smelib_InputModel(PyObject * self, PyObject *args, PyObject *k static char smelib_InputDepartureCoefficients_docstring[] = "Input Departure coefficients"; static PyObject * smelib_InputDepartureCoefficients(PyObject * self, PyObject *args) { - int n = 2; + const int n = 2; void * args_c[n]; const char * result = NULL; int linenumber; @@ -672,7 +672,7 @@ static char smelib_ResetDepartureCoefficients_docstring[] = "Reset to LTE"; static PyObject * smelib_ResetDepartureCoefficients(PyObject * self, PyObject *args) { const int n = 0; - void * args_c[n]; + void ** args_c = NULL; const char * result = NULL; result = ResetDepartureCoefficients(n, args_c); @@ -734,7 +734,7 @@ static char smelib_Opacity_docstring[] = "Calculate opacities"; static PyObject * smelib_Opacity(PyObject * self, PyObject *args) { const int n = 0; - void * args_c[n]; + void ** args_c = NULL; const char * result = NULL; result = Opacity(n, args_c); @@ -751,7 +751,7 @@ static char smelib_GetOpacity_docstring[] = "Returns specific cont. opacity"; static PyObject * smelib_GetOpacity(PyObject * self, PyObject *args, PyObject * kwds) { int n = 5; - void * args_c[n]; + void * args_c[5]; const char * result = NULL; char * choice = NULL, * species=NULL, * key=NULL; short number = -100; @@ -839,7 +839,7 @@ static PyObject * smelib_GetOpacity(PyObject * self, PyObject *args, PyObject * static char smelib_Ionization_docstring[] = "Perform EOS calculations"; static PyObject * smelib_Ionization(PyObject * self, PyObject *args) { - int n = 1; + const int n = 1; void * args_c[n]; const char * result = NULL; short flag = 0; @@ -860,7 +860,7 @@ static PyObject * smelib_Ionization(PyObject * self, PyObject *args) static char smelib_GetDensity_docstring[] = "Returns density in g/cm^3"; static PyObject * smelib_GetDensity(PyObject * self, PyObject *args) { - int n = 2; + const int n = 2; void * args_c[n]; const char * result = NULL; @@ -887,7 +887,7 @@ static PyObject * smelib_GetDensity(PyObject * self, PyObject *args) static char smelib_GetNatom_docstring[] = "Returns atomic number density"; static PyObject * smelib_GetNatom(PyObject * self, PyObject *args) { - int n = 2; + const int n = 2; void * args_c[n]; const char * result = NULL; @@ -914,7 +914,7 @@ static PyObject * smelib_GetNatom(PyObject * self, PyObject *args) static char smelib_GetNelec_docstring[] = "Returns electron number density"; static PyObject * smelib_GetNelec(PyObject * self, PyObject *args) { - int n = 2; + const int n = 2; void * args_c[n]; const char * result = NULL; @@ -941,7 +941,7 @@ static PyObject * smelib_GetNelec(PyObject * self, PyObject *args) static char smelib_Transf_docstring[] = "Computes spectral synthesis"; static PyObject * smelib_Transf(PyObject * self, PyObject *args, PyObject * kwds) { - int n = 12; + const int n = 12; void * args_c[n]; const char * result = NULL; @@ -1040,7 +1040,7 @@ static PyObject * smelib_Transf(PyObject * self, PyObject *args, PyObject * kwds static char smelib_CentralDepth_docstring[] = "Computes line central depths"; static PyObject * smelib_CentralDepth(PyObject * self, PyObject *args, PyObject * kwds) { - int n = 5; + const int n = 5; void * args_c[n]; const char * result = NULL; npy_intp dims[1]; @@ -1092,7 +1092,7 @@ static PyObject * smelib_CentralDepth(PyObject * self, PyObject *args, PyObject static char smelib_GetLineOpacity_docstring[] = "Returns specific line opacity"; static PyObject * smelib_GetLineOpacity(PyObject * self, PyObject *args) { - int n = 7; + const int n = 7; void * args_c[n]; const char * result = NULL; npy_intp dims[1]; @@ -1141,7 +1141,7 @@ static PyObject * smelib_GetLineOpacity(PyObject * self, PyObject *args) static char smelib_GetLineRange_docstring[] = "Get validity range for every line"; static PyObject * smelib_GetLineRange(PyObject * self, PyObject *args) { - int n = 2; + const int n = 2; void * args_c[n]; const char * result = NULL; npy_intp dims[2]; @@ -1171,7 +1171,7 @@ static PyObject * smelib_GetLineRange(PyObject * self, PyObject *args) static char smelib_GetNLTEflags_docstring[] = "Get line list NLTE flags"; static PyObject * smelib_GetNLTEflags(PyObject * self, PyObject *args) { - int n = 2; + const int n = 2; void * args_c[n]; const char * result = NULL; npy_intp dims[2];