Skip to content

Commit

Permalink
C99 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
a-ma72 committed Feb 24, 2022
1 parent 3012705 commit 42856a6
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 55 deletions.
18 changes: 9 additions & 9 deletions python/src/rainflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -3893,7 +3893,7 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
class_shift = 0;
rfc_value_t class_offset = rfc_ctx->class_offset;
void *ptr;

size_t i, j;

if( pt->value < rfc_ctx->class_offset )
{
Expand Down Expand Up @@ -3979,13 +3979,13 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
rfc_ctx->residue_cap = residue_cap;

/* Residuum */
for( size_t i = 0; i < rfc_ctx->residue_cnt; i++ )
for( i = 0; i < rfc_ctx->residue_cnt; i++ )
{
rfc_ctx->residue[i].cls = QUANTIZE( rfc_ctx, rfc_ctx->residue[i].value );
}
}

for( size_t i = 0; i < rfc_ctx->internal.residue_cap; i++ )
for( i = 0; i < rfc_ctx->internal.residue_cap; i++ )
{
rfc_ctx->internal.residue[i].cls = QUANTIZE( rfc_ctx, rfc_ctx->internal.residue[i].value );
}
Expand All @@ -4003,9 +4003,9 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
{
rfc_counts_t *rfm = (rfc_counts_t*)ptr;

for( size_t i = 0; i < class_count_old; i++ )
for( i = 0; i < class_count_old; i++ )
{
for( size_t j = 0; j < class_count_old; j++ )
for( j = 0; j < class_count_old; j++ )
{
rfm[ MAT_OFFS( i + class_shift, j + class_shift ) ] = rfc_ctx->rfm[ i * class_count_old + j ];
}
Expand All @@ -4031,7 +4031,7 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
{
rfc_counts_t* lc = (rfc_counts_t*)ptr;

for( size_t i = 0; i < class_count_old; i++ )
for( i = 0; i < class_count_old; i++ )
{
lc[i + class_shift] = rfc_ctx->lc[i];
}
Expand All @@ -4052,7 +4052,7 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
{
rfc_counts_t* rp = (rfc_counts_t*)ptr;

for( size_t i = 0; i < class_count_old; i++ )
for( i = 0; i < class_count_old; i++ )
{
rp[i] = rfc_ctx->rp[i];
}
Expand All @@ -4065,7 +4065,7 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
#endif /*!RFC_MINIMAL*/

#if RFC_TP_SUPPORT
for( size_t i = 0; i < rfc_ctx->tp_cnt + ( rfc_ctx->state == RFC_STATE_BUSY_INTERIM ); i++ )
for( i = 0; i < rfc_ctx->tp_cnt + ( rfc_ctx->state == RFC_STATE_BUSY_INTERIM ); i++ )
{
#if RFC_USE_DELEGATES
if( rfc_ctx->tp_get_fcn || rfc_ctx->tp_set_fcn )
Expand All @@ -4092,7 +4092,7 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
#endif /*RFC_GLOBAL_EXTREMA*/

#if RFC_HCM_SUPPORT
for( size_t i = 0; i < rfc_ctx->internal.hcm.stack_cap; i++ )
for( i = 0; i < rfc_ctx->internal.hcm.stack_cap; i++ )
{
rfc_ctx->internal.hcm.stack[i].cls = QUANTIZE( rfc_ctx, rfc_ctx->internal.hcm.stack[i].value );
}
Expand Down
74 changes: 37 additions & 37 deletions python/src/rfcnt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int parse_rfc_kwargs( PyObject* kwargs, Py_ssize_t len, Rainflow *rf, Rainflow::
int use_hcm = 0; // false
int use_astm = 0; // false
int lc_method = 0; // Count rising slopes only
int flags = Rainflow::RFC_FLAGS_DEFAULT;
int flags = Rainflow::RFC_FLAGS_DEFAULT;
int auto_resize = 0; // false
int spread_damage = Rainflow::RFC_SD_TRANSIENT_23c;
PyObject *wl = NULL;
Expand Down Expand Up @@ -426,42 +426,42 @@ static PyObject* rfc( PyObject *self, PyObject *args, PyObject *kwargs )
Rainflow rf;
Rainflow::rfc_res_method res_method;
Py_ssize_t len;
bool ok = false;

do
{
if( !parse_rfc_input_series( args, &arr_data, &data, &len ) )
{
break;
}

if( !parse_rfc_kwargs( kwargs, len, &rf, &res_method ) )
{
break;
}

if( !do_rainflow( &rf, data, len, res_method ) )
{
break;
}

if( !prepare_results( &rf, res_method, &ret ) )
{
break;
}
ok = true;
}
while(0);


if( !ok && ret )
{
Py_DECREF( ret );
ret = NULL;
}
rf.deinit();
bool ok = false;

do
{
if( !parse_rfc_input_series( args, &arr_data, &data, &len ) )
{
break;
}

if( !parse_rfc_kwargs( kwargs, len, &rf, &res_method ) )
{
break;
}

if( !do_rainflow( &rf, data, len, res_method ) )
{
break;
}

if( !prepare_results( &rf, res_method, &ret ) )
{
break;
}
ok = true;
}
while(0);


if( !ok && ret )
{
Py_DECREF( ret );
ret = NULL;
}
rf.deinit();

if( arr_data && data )
{
Expand Down
18 changes: 9 additions & 9 deletions src/rainflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -3893,7 +3893,7 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
class_shift = 0;
rfc_value_t class_offset = rfc_ctx->class_offset;
void *ptr;

size_t i, j;

if( pt->value < rfc_ctx->class_offset )
{
Expand Down Expand Up @@ -3979,13 +3979,13 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
rfc_ctx->residue_cap = residue_cap;

/* Residuum */
for( size_t i = 0; i < rfc_ctx->residue_cnt; i++ )
for( i = 0; i < rfc_ctx->residue_cnt; i++ )
{
rfc_ctx->residue[i].cls = QUANTIZE( rfc_ctx, rfc_ctx->residue[i].value );
}
}

for( size_t i = 0; i < rfc_ctx->internal.residue_cap; i++ )
for( i = 0; i < rfc_ctx->internal.residue_cap; i++ )
{
rfc_ctx->internal.residue[i].cls = QUANTIZE( rfc_ctx, rfc_ctx->internal.residue[i].value );
}
Expand All @@ -4003,9 +4003,9 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
{
rfc_counts_t *rfm = (rfc_counts_t*)ptr;

for( size_t i = 0; i < class_count_old; i++ )
for( i = 0; i < class_count_old; i++ )
{
for( size_t j = 0; j < class_count_old; j++ )
for( j = 0; j < class_count_old; j++ )
{
rfm[ MAT_OFFS( i + class_shift, j + class_shift ) ] = rfc_ctx->rfm[ i * class_count_old + j ];
}
Expand All @@ -4031,7 +4031,7 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
{
rfc_counts_t* lc = (rfc_counts_t*)ptr;

for( size_t i = 0; i < class_count_old; i++ )
for( i = 0; i < class_count_old; i++ )
{
lc[i + class_shift] = rfc_ctx->lc[i];
}
Expand All @@ -4052,7 +4052,7 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
{
rfc_counts_t* rp = (rfc_counts_t*)ptr;

for( size_t i = 0; i < class_count_old; i++ )
for( i = 0; i < class_count_old; i++ )
{
rp[i] = rfc_ctx->rp[i];
}
Expand All @@ -4065,7 +4065,7 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
#endif /*!RFC_MINIMAL*/

#if RFC_TP_SUPPORT
for( size_t i = 0; i < rfc_ctx->tp_cnt + ( rfc_ctx->state == RFC_STATE_BUSY_INTERIM ); i++ )
for( i = 0; i < rfc_ctx->tp_cnt + ( rfc_ctx->state == RFC_STATE_BUSY_INTERIM ); i++ )
{
#if RFC_USE_DELEGATES
if( rfc_ctx->tp_get_fcn || rfc_ctx->tp_set_fcn )
Expand All @@ -4092,7 +4092,7 @@ bool autoresize( rfc_ctx_s *rfc_ctx, rfc_value_tuple_s* pt )
#endif /*RFC_GLOBAL_EXTREMA*/

#if RFC_HCM_SUPPORT
for( size_t i = 0; i < rfc_ctx->internal.hcm.stack_cap; i++ )
for( i = 0; i < rfc_ctx->internal.hcm.stack_cap; i++ )
{
rfc_ctx->internal.hcm.stack[i].cls = QUANTIZE( rfc_ctx, rfc_ctx->internal.hcm.stack[i].value );
}
Expand Down

0 comments on commit 42856a6

Please sign in to comment.