Commit 4299b83f authored by Keith Bennett's avatar Keith Bennett

Fixed code indentation

parent 1c27c2ce
......@@ -64,7 +64,7 @@
#ifndef PyArray_SetBaseObject
#define PyArray_SetBaseObject(array, base) \
PyArray_BASE(array) = base
PyArray_BASE(array) = base
#endif
#if PY_MAJOR_VERSION >= 3
......@@ -695,7 +695,7 @@ static PyObject *Block_getdata(Block *block, void *closure)
for (j = 0; j < block->adims[1]; j++) {
for (i = 0; i < block->adims[0]; i++) {
*ptr_out++ = 0.25 * (ptr_in[IJ(i,j)] + ptr_in[IJ(i+1,j)]
+ ptr_in[IJ(i,j+1)] + ptr_in[IJ(i+1,j+1)]);
+ ptr_in[IJ(i,j+1)] + ptr_in[IJ(i+1,j+1)]);
}}
} else if (double2d) {
double *ptr_in, *ptr_out;
......@@ -706,7 +706,7 @@ static PyObject *Block_getdata(Block *block, void *closure)
for (j = 0; j < block->adims[1]; j++) {
for (i = 0; i < block->adims[0]; i++) {
*ptr_out++ = 0.25 * (ptr_in[IJ(i,j)] + ptr_in[IJ(i+1,j)]
+ ptr_in[IJ(i,j+1)] + ptr_in[IJ(i+1,j+1)]);
+ ptr_in[IJ(i,j+1)] + ptr_in[IJ(i+1,j+1)]);
}}
}
......@@ -890,7 +890,7 @@ free_mem:
static void extract_station_time_histories(sdf_file_t *h, PyObject *stations,
PyObject *variables, double t0, double t1, PyObject *dict)
PyObject *variables, double t0, double t1, PyObject *dict)
{
Py_ssize_t nvars, i, nstat;
PyObject *sub;
......@@ -1270,10 +1270,10 @@ static Block *dict_find_mesh_id(PyObject *dict, char *id)
value = PyDict_GetItemString(dict, id);
if ( !value )
return NULL;
return NULL;
if ( !PyObject_TypeCheck(value, &BlockType) )
return NULL;
return NULL;
block = (Block*)value;
......@@ -1281,7 +1281,7 @@ static Block *dict_find_mesh_id(PyObject *dict, char *id)
case SDF_BLOCKTYPE_PLAIN_MESH:
case SDF_BLOCKTYPE_POINT_MESH:
case SDF_BLOCKTYPE_LAGRANGIAN_MESH:
return block;
return block;
}
return NULL;
......@@ -1559,7 +1559,7 @@ static PyMethodDef SDF_methods[] = {
" Starting time for station data.\n"
"t1 : double, optional\n"
" Ending time for station data.\n"
},
},
{NULL}
};
......@@ -1590,11 +1590,11 @@ MOD_INIT(sdf)
s = sdf_get_library_commit_id();
PyModule_AddStringConstant(m, "__library_commit_id__", s);
if (s)
free(s);
free(s);
s = sdf_get_library_commit_date();
PyModule_AddStringConstant(m, "__library_commit_date__", s);
if (s)
free(s);
free(s);
SDFType.tp_dealloc = SDF_dealloc;
SDFType.tp_flags = Py_TPFLAGS_DEFAULT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment