Skip to content

Commit

Permalink
STY: special: clean up compiler warnings in faddeeva
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed Oct 6, 2012
1 parent 121f4f5 commit 6bfcfd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
13 changes: 6 additions & 7 deletions scipy/special/_faddeeva.cxx
@@ -1,12 +1,11 @@
#include <complex> #include <complex>
#include <Python.h>
#include <math.h>


extern std::complex<double> Faddeeva_w(std::complex<double> z, double relerr); extern std::complex<double> Faddeeva_w(std::complex<double> z, double relerr);


extern "C" { extern "C" {


#include <Python.h>
#include <math.h>

#include "numpy/npy_math.h" #include "numpy/npy_math.h"
#include "numpy/ndarraytypes.h" #include "numpy/ndarraytypes.h"
#include "numpy/ufuncobject.h" #include "numpy/ufuncobject.h"
Expand Down Expand Up @@ -56,11 +55,11 @@ static void _init_funcs(PyObject *m)
d = PyModule_GetDict(m); d = PyModule_GetDict(m);


f = PyUFunc_FromFuncAndData(wofz_funcs, data, types, 3, 1, 1, f = PyUFunc_FromFuncAndData(wofz_funcs, data, types, 3, 1, 1,
PyUFunc_None, "wofz", NULL , 0); PyUFunc_None, (char*)"wofz", NULL , 0);
PyDict_SetItemString(d, "wofz", f); PyDict_SetItemString(d, "wofz", f);
Py_DECREF(f); Py_DECREF(f);
} }

#if PY_VERSION_HEX >= 0x03000000 #if PY_VERSION_HEX >= 0x03000000


static PyModuleDef moduledef = { static PyModuleDef moduledef = {
Expand All @@ -78,7 +77,7 @@ static PyModuleDef moduledef = {
PyMODINIT_FUNC PyMODINIT_FUNC
PyInit__faddeeva() PyInit__faddeeva()
{ {
PyObject *m, *f, *d; PyObject *m;
m = PyModule_Create(&moduledef); m = PyModule_Create(&moduledef);
if (!m) { if (!m) {
return NULL; return NULL;
Expand All @@ -94,7 +93,7 @@ PyInit__faddeeva()
PyMODINIT_FUNC PyMODINIT_FUNC
init_faddeeva() init_faddeeva()
{ {
PyObject *m, *f, *d; PyObject *m;
m = Py_InitModule("_faddeeva", module_methods); m = Py_InitModule("_faddeeva", module_methods);
if (m == NULL) { if (m == NULL) {
return; return;
Expand Down
3 changes: 0 additions & 3 deletions scipy/special/faddeeva_w.cxx
Expand Up @@ -292,7 +292,6 @@ static double dcsevl_(double x, const double *cs, int n)
double b0, b1, b2; double b0, b1, b2;
int ni; int ni;
double twox; double twox;
double onepl;


/* DESCRIPTION */ /* DESCRIPTION */
/* Evaluate the N-term Chebyshev series CS at X. Adapted from */ /* Evaluate the N-term Chebyshev series CS at X. Adapted from */
Expand Down Expand Up @@ -327,8 +326,6 @@ static double dcsevl_(double x, const double *cs, int n)


/* Function Body */ /* Function Body */
/* FIRST EXECUTABLE STATEMENT DCSEVL */ /* FIRST EXECUTABLE STATEMENT DCSEVL */
onepl = 1. + DBL_EPSILON;

b1 = 0.; b1 = 0.;
b0 = 0.; b0 = 0.;
twox = x * 2.; twox = x * 2.;
Expand Down

0 comments on commit 6bfcfd0

Please sign in to comment.