Merge branch 'fix/pyextwarnings'
authorPaul Brossier <piem@piem.org>
Wed, 21 Nov 2018 00:53:41 +0000 (01:53 +0100)
committerPaul Brossier <piem@piem.org>
Wed, 21 Nov 2018 00:53:41 +0000 (01:53 +0100)
python/ext/py-filterbank.c
python/ext/py-source.c

index 24f9f71..22f2a56 100644 (file)
@@ -122,8 +122,8 @@ Py_filterbank_set_triangle_bands (Py_filterbank * self, PyObject *args)
   uint_t err = 0;
 
   PyObject *input;
-  uint_t samplerate;
-  if (!PyArg_ParseTuple (args, "OI", &input, &samplerate)) {
+  smpl_t samplerate;
+  if (!PyArg_ParseTuple (args, "O" AUBIO_NPY_SMPL_CHR, &input, &samplerate)) {
     return NULL;
   }
 
@@ -268,9 +268,9 @@ Py_filterbank_get_coeffs (Py_filterbank * self, PyObject *unused)
 static PyObject *
 Py_filterbank_set_power(Py_filterbank *self, PyObject *args)
 {
-  uint_t power;
+  smpl_t power;
 
-  if (!PyArg_ParseTuple (args, "I", &power)) {
+  if (!PyArg_ParseTuple (args, AUBIO_NPY_SMPL_CHR, &power)) {
     return NULL;
   }
   if(aubio_filterbank_set_power (self->o, power)) {
@@ -291,12 +291,12 @@ Py_filterbank_set_power(Py_filterbank *self, PyObject *args)
 static PyObject *
 Py_filterbank_set_norm(Py_filterbank *self, PyObject *args)
 {
-  uint_t playing;
+  smpl_t norm;
 
-  if (!PyArg_ParseTuple (args, "I", &playing)) {
+  if (!PyArg_ParseTuple (args, AUBIO_NPY_SMPL_CHR, &norm)) {
     return NULL;
   }
-  if(aubio_filterbank_set_norm (self->o, playing)) {
+  if(aubio_filterbank_set_norm (self->o, norm)) {
     if (PyErr_Occurred() == NULL) {
       PyErr_SetString (PyExc_ValueError,
           "error running filterbank.set_power");
index ca525bf..7687fbd 100644 (file)
@@ -155,7 +155,7 @@ static char Py_source_doc[] = ""
 "...     for samples in source:\n"
 "...         n_frames += len(samples)\n"
 "...     print('read', n_frames, 'samples in', samples.shape[0], 'channels',\n"
-"...         'from file \"\%s\"' \% source.uri)\n"
+"...         'from file \"%%s\"' %% source.uri)\n"
 "...\n"
 "read 239334 samples in 2 channels from file \"audiotrack.wav\"\n"
 "\n"