Changeset 911c22f for python/ext


Ignore:
Timestamp:
May 12, 2016, 1:28:23 AM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
a138975
Parents:
bb4af3a
git-author:
Paul Brossier <piem@piem.org> (05/11/16 14:49:47)
git-committer:
Paul Brossier <piem@piem.org> (05/12/16 01:28:23)
Message:

ext/aubioproxy.c: fix windows c89 compilation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/aubioproxy.c

    rbb4af3a r911c22f  
    2222int
    2323PyAubio_IsValidVector (PyObject * input) {
     24  npy_intp length;
    2425  if (input == NULL) {
    2526    PyErr_SetString (PyExc_ValueError, "input array is not a python object");
     
    4748    }
    4849
    49     npy_intp length = PyArray_SIZE ((PyArrayObject *)input);
     50    length = PyArray_SIZE ((PyArrayObject *)input);
    5051    if (length <= 0) {
    5152      PyErr_SetString (PyExc_ValueError, "input array size should be greater than 0");
     
    9495int
    9596PyAubio_ArrayToCFmat (PyObject *input, fmat_t *mat) {
    96   uint_t i;
     97  uint_t i, new_height;
     98  npy_intp length, height;
    9799  if (input == NULL) {
    98100    PyErr_SetString (PyExc_ValueError, "input array is not a python object");
     
    121123
    122124    // no need to really allocate fvec, just its struct member
    123     npy_intp length = PyArray_DIM ((PyArrayObject *)input, 1);
     125    length = PyArray_DIM ((PyArrayObject *)input, 1);
    124126    if (length <= 0) {
    125127      PyErr_SetString (PyExc_ValueError, "input array dimension 1 should be greater than 0");
    126128      return 0;
    127129    }
    128     npy_intp height = PyArray_DIM ((PyArrayObject *)input, 0);
     130    height = PyArray_DIM ((PyArrayObject *)input, 0);
    129131    if (height <= 0) {
    130132      PyErr_SetString (PyExc_ValueError, "input array dimension 0 should be greater than 0");
     
    140142  }
    141143
    142   uint_t new_height = (uint_t)PyArray_DIM ((PyArrayObject *)input, 0);
     144  new_height = (uint_t)PyArray_DIM ((PyArrayObject *)input, 0);
    143145  if (mat->height != new_height) {
    144146    if (mat->data) {
Note: See TracChangeset for help on using the changeset viewer.