diff --git a/inst/cta/pyext/GCTAEventList.i b/inst/cta/pyext/GCTAEventList.i index a9ae263..a6e64c1 100644 --- a/inst/cta/pyext/GCTAEventList.i +++ b/inst/cta/pyext/GCTAEventList.i @@ -110,11 +110,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GCTAEventList* list = new GCTAEventList; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/inst/cta/pyext/cta.i b/inst/cta/pyext/cta.i index 188e1d9..15728a3 100644 --- a/inst/cta/pyext/cta.i +++ b/inst/cta/pyext/cta.i @@ -1,7 +1,7 @@ /*************************************************************************** * cta.i - Cherenkov Telescope Array module * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2016 by Juergen Knoedlseder * + * copyright (C) 2011-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -41,6 +41,7 @@ /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i"; diff --git a/inst/lat/pyext/GLATEventList.i b/inst/lat/pyext/GLATEventList.i index 9143ce5..ab84787 100644 --- a/inst/lat/pyext/GLATEventList.i +++ b/inst/lat/pyext/GLATEventList.i @@ -88,11 +88,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GLATEventList* list = new GLATEventList; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/inst/lat/pyext/lat.i b/inst/lat/pyext/lat.i index 3b01b3c..e607886 100644 --- a/inst/lat/pyext/lat.i +++ b/inst/lat/pyext/lat.i @@ -1,7 +1,7 @@ /*************************************************************************** * lat.i - Fermi/LAT module * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2016 by Juergen Knoedlseder * + * copyright (C) 2011-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -41,6 +41,7 @@ /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i"; diff --git a/pyext/GApplicationPars.i b/pyext/GApplicationPars.i index 26f9987..4983d64 100644 --- a/pyext/GApplicationPars.i +++ b/pyext/GApplicationPars.i @@ -28,7 +28,6 @@ #include "GApplicationPars.hpp" #include "GException.hpp" #include "GFilename.hpp" -#include "Python.h" %} @@ -98,11 +97,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GApplicationPars* pars = new GApplicationPars; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GEbounds.i b/pyext/GEbounds.i index a3cf625..dc00923 100644 --- a/pyext/GEbounds.i +++ b/pyext/GEbounds.i @@ -99,11 +99,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GEbounds* ebounds = new GEbounds; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GEnergies.i b/pyext/GEnergies.i index ff3340a..2a90c37 100644 --- a/pyext/GEnergies.i +++ b/pyext/GEnergies.i @@ -97,11 +97,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GEnergies* energies = new GEnergies; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GFits.i b/pyext/GFits.i index f832534..4aac6cc 100644 --- a/pyext/GFits.i +++ b/pyext/GFits.i @@ -123,11 +123,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GFits* fits = new GFits; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GFitsHeader.i b/pyext/GFitsHeader.i index e6c11b4..6663cd0 100644 --- a/pyext/GFitsHeader.i +++ b/pyext/GFitsHeader.i @@ -98,11 +98,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GFitsHeader* header = new GFitsHeader; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GGti.i b/pyext/GGti.i index ba24a4d..1f02f0b 100644 --- a/pyext/GGti.i +++ b/pyext/GGti.i @@ -91,11 +91,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GGti* gti = new GGti; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GModels.i b/pyext/GModels.i index 25183bc..c28c7e8 100644 --- a/pyext/GModels.i +++ b/pyext/GModels.i @@ -101,11 +101,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GModels* models = new GModels; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GNodeArray.i b/pyext/GNodeArray.i index e0e665a..2e1db1a 100644 --- a/pyext/GNodeArray.i +++ b/pyext/GNodeArray.i @@ -104,11 +104,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GNodeArray* nodes = new GNodeArray; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GObservations.i b/pyext/GObservations.i index 7a80ce9..41b8cd4 100644 --- a/pyext/GObservations.i +++ b/pyext/GObservations.i @@ -126,11 +126,7 @@ typedef GObservations::likelihood likelihood; Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GObservations* obs = new GObservations; obs->models(self->models()); // Copy over model container if (step > 0) { diff --git a/pyext/GOptimizerPars.i b/pyext/GOptimizerPars.i index 4aeb692..5ca7c0a 100644 --- a/pyext/GOptimizerPars.i +++ b/pyext/GOptimizerPars.i @@ -93,11 +93,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GOptimizerPars* pars = new GOptimizerPars; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GPhases.i b/pyext/GPhases.i index d7d3a07..4924c6b 100644 --- a/pyext/GPhases.i +++ b/pyext/GPhases.i @@ -69,11 +69,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GPhases* phases = new GPhases; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GPhotons.i b/pyext/GPhotons.i index 8dc9c6f..75387e1 100644 --- a/pyext/GPhotons.i +++ b/pyext/GPhotons.i @@ -78,11 +78,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GPhotons* photons = new GPhotons; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GSkyRegions.i b/pyext/GSkyRegions.i index daf9c7f..13d8fd2 100644 --- a/pyext/GSkyRegions.i +++ b/pyext/GSkyRegions.i @@ -86,11 +86,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GSkyRegions* regions = new GSkyRegions; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GTestSuites.i b/pyext/GTestSuites.i index add21d1..5a46d84 100644 --- a/pyext/GTestSuites.i +++ b/pyext/GTestSuites.i @@ -91,11 +91,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GTestSuites* tests = new GTestSuites(self->name()); if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GTimes.i b/pyext/GTimes.i index bfc3d1a..590b33d 100644 --- a/pyext/GTimes.i +++ b/pyext/GTimes.i @@ -80,11 +80,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GTimes* times = new GTimes; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GXml.i b/pyext/GXml.i index f16f1c7..3761a38 100644 --- a/pyext/GXml.i +++ b/pyext/GXml.i @@ -92,11 +92,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GXml* xml = new GXml; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/GXmlElement.i b/pyext/GXmlElement.i index e169380..6ef3e2a 100644 --- a/pyext/GXmlElement.i +++ b/pyext/GXmlElement.i @@ -93,11 +93,7 @@ public: Py_ssize_t stop = 0; Py_ssize_t step = 0; Py_ssize_t len = self->size(); - #if PY_VERSION_HEX >= 0x03020000 - if (PySlice_GetIndices(param, len, &start, &stop, &step) == 0) { - #else - if (PySlice_GetIndices((PySliceObject*)param, len, &start, &stop, &step) == 0) { - #endif + if (PythonSlice_GetIndices(param, len, &start, &stop, &step) == 0) { GXmlElement* element = new GXmlElement; if (step > 0) { for (int i = (int)start; i < (int)stop; i += (int)step) { diff --git a/pyext/gammalib/app.i b/pyext/gammalib/app.i index 4cba5fd..90f8b42 100644 --- a/pyext/gammalib/app.i +++ b/pyext/gammalib/app.i @@ -1,7 +1,7 @@ /*************************************************************************** * app.i - Application module * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2016 by Juergen Knoedlseder * + * copyright (C) 2011-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -41,6 +41,7 @@ /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i"; diff --git a/pyext/gammalib/fits.i b/pyext/gammalib/fits.i index b015a45..a4203c2 100644 --- a/pyext/gammalib/fits.i +++ b/pyext/gammalib/fits.i @@ -1,7 +1,7 @@ /*************************************************************************** * fits.i - FITS module * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2016 by Juergen Knoedlseder * + * copyright (C) 2011-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -46,6 +46,7 @@ namespace std { /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i"; diff --git a/pyext/gammalib/model.i b/pyext/gammalib/model.i index adeaaa6..02f2d05 100644 --- a/pyext/gammalib/model.i +++ b/pyext/gammalib/model.i @@ -41,6 +41,7 @@ /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i"; diff --git a/pyext/gammalib/obs.i b/pyext/gammalib/obs.i index 6b47bc2..4f36c30 100644 --- a/pyext/gammalib/obs.i +++ b/pyext/gammalib/obs.i @@ -41,6 +41,7 @@ /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i"; diff --git a/pyext/gammalib/opt.i b/pyext/gammalib/opt.i index f480010..72d24f2 100644 --- a/pyext/gammalib/opt.i +++ b/pyext/gammalib/opt.i @@ -1,7 +1,7 @@ /*************************************************************************** * opt.i - Optimization module * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2016 by Juergen Knoedlseder * + * copyright (C) 2011-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -41,6 +41,7 @@ /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i"; diff --git a/pyext/gammalib/sky.i b/pyext/gammalib/sky.i index 4376d52..a935fb6 100644 --- a/pyext/gammalib/sky.i +++ b/pyext/gammalib/sky.i @@ -1,7 +1,7 @@ /*************************************************************************** * sky.i - Sky module * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2016 by Jurgen Knodlseder * + * copyright (C) 2011-2017 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -48,6 +48,7 @@ namespace std { /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i"; diff --git a/pyext/gammalib/support.i b/pyext/gammalib/support.i index 2f84a43..da0822e 100644 --- a/pyext/gammalib/support.i +++ b/pyext/gammalib/support.i @@ -1,7 +1,7 @@ /*************************************************************************** * support.i - Support module * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2016 by Jurgen Knodlseder * + * copyright (C) 2011-2017 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,6 +45,7 @@ /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i"; diff --git a/pyext/gammalib/test.i b/pyext/gammalib/test.i index 2c202ff..f11d89b 100644 --- a/pyext/gammalib/test.i +++ b/pyext/gammalib/test.i @@ -1,7 +1,7 @@ /*************************************************************************** * test.i - Test module * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2016 by Jean-Baptiste Cayrou * + * copyright (C) 2012-2017 by Jean-Baptiste Cayrou * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -41,6 +41,7 @@ /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i"; diff --git a/pyext/gammalib/xml.i b/pyext/gammalib/xml.i index 8fcc6d4..b290874 100644 --- a/pyext/gammalib/xml.i +++ b/pyext/gammalib/xml.i @@ -1,7 +1,7 @@ /*************************************************************************** * xml.i - XML module * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2016 by Juergen Knoedlseder * + * copyright (C) 2011-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -41,6 +41,7 @@ /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i +%include typemap_slices.i /* __ Include interface classes __________________________________________ */ %import(module="gammalib.base") "GBase.i";