Skip to content

Commit a75fc18

Browse files
authored
fix: merge bugs
1 parent e41ba24 commit a75fc18

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

fitsio/fitsio_pywrap.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,7 +2333,7 @@ columns"); return NULL;
23332333
if (fits_dtype == TSTRING) {
23342334
23352335
// this is my wrapper for strings
2336-
if (NOGIL(write_string_column(self->fits, colnum, firstrow, firstelem,
2336+
if (NOGIL(write_string_column(self, self->fits, colnum, firstrow, firstelem,
23372337
nelem, data, &status))) { set_ioerr_string_from_status(status, self); return
23382338
NULL;
23392339
}
@@ -2570,7 +2570,7 @@ static int write_var_string_column(
25702570
fitsfile *fits, /* I - FITS file pointer */
25712571
int colnum, /* I - number of column to write (1 = 1st col) */
25722572
LONGLONG firstrow, /* I - first row to write (1 = 1st row) */
2573-
PyObject *array, int *status) { /* IO - error status */
2573+
PyArrayObject *array, int *status) { /* IO - error status */
25742574
ALLOW_NOGIL
25752575

25762576
LONGLONG firstelem = 1; // ignored
@@ -2615,10 +2615,10 @@ static int write_var_string_column(
26152615
* No error checking performed here
26162616
*/
26172617
static int write_var_num_column(
2618-
fitsfile *fits, /* I - FITS file pointer */
2618+
struct PyFITSObject *self, fitsfile *fits, /* I - FITS file pointer */
26192619
int colnum, /* I - number of column to write (1 = 1st col) */
26202620
LONGLONG firstrow, /* I - first row to write (1 = 1st row) */
2621-
int fits_dtype, PyObject *array, int *status) { /* IO - error status */
2621+
int fits_dtype, PyArrayObject *array, int *status) { /* IO - error status */
26222622
ALLOW_NOGIL
26232623

26242624
LONGLONG firstelem = 1;
@@ -2655,7 +2655,7 @@ static int write_var_num_column(
26552655
return 1;
26562656
}
26572657

2658-
nelem = PyArray_SIZE(el);
2658+
nelem = PyArray_SIZE(el_array);
26592659
data = PyArray_DATA(el_array);
26602660
res = NOGIL(fits_write_col(fits, abs(fits_dtype), colnum, firstrow + i,
26612661
firstelem, (LONGLONG)nelem, data, status));
@@ -3723,10 +3723,10 @@ static PyObject *read_var_nums(fitsfile *fits, int colnum, LONGLONG row,
37233723
nelem);
37243724
return NULL;
37253725
}
3726-
data = PyArray_DATA(arrayObj);
3726+
data = PyArray_DATA(array);
37273727
if (NOGIL(fits_read_col(fits, abs(fits_dtype), colnum, row, firstelem,
37283728
nelem, nulval, data, anynul, status)) > 0) {
3729-
Py_XDECREF(arrayObj);
3729+
Py_XDECREF(array);
37303730
return NULL;
37313731
}
37323732

@@ -4157,7 +4157,7 @@ PyFITSObject_read_columns_as_rec_byoffset(struct PyFITSObject *self,
41574157
data = PyArray_DATA(array);
41584158
recsize = PyArray_ITEMSIZE(array);
41594159
if (NOGIL(read_columns_as_rec_byoffset(self->fits, ncols, colnums, offsets,
4160-
nrows, rows, (char *)data, recsize,
4160+
nrows, rows, sortind, (char *)data, recsize,
41614161
&status)) > 0) {
41624162
goto recread_columns_byoffset_cleanup;
41634163
}
@@ -5099,7 +5099,8 @@ static PyObject *PyFITSObject_where(struct PyFITSObject *self, PyObject *args) {
50995099
if (ngood > 0) {
51005100
data = PyArray_DATA((PyArrayObject *)indices_obj);
51015101

5102-
Py_BEGIN_ALLOW_THREADS for (i = 0; i < nrows; i++) {
5102+
Py_BEGIN_ALLOW_THREADS
5103+
for (i = 0; i < nrows; i++) {
51035104
if (row_status[i]) {
51045105
*data = (npy_intp)i;
51055106
data++;

0 commit comments

Comments
 (0)