@ -51,14 +51,14 @@ void print_plan () {
# define CHECKUNDERFLOW(SPACE_P, NAME) \
if ( ( ( SPACE_P ) - > NAME # # _stackp ) > = MAXRESULT ) { \
fprintf ( stderr , " stackoverflow in " # SPACE_P " -> " # NAME " _stack at lineno=%i, only %i results could be stored, increase MAXRESULT \n " , parser_state . lineno , MAXRESULT ) ; \
fprintf ( stderr , " stackoverflow in " # SPACE_P " -> " # NAME " _stack at lineno=%i, only %u results could be stored, increase MAXRESULT \n " , parser_state . lineno , MAXRESULT ) ; \
exit ( EXIT_FAILURE ) ; \
}
/ / endmacro CHECKUNDERFLOW
# define CHECKOVERFLOW(SPACE_P, NAME) \
if ( ( ( SPACE_P ) - > NAME # # _stackp ) > = MAXRESULT ) { \
fprintf ( stderr , " stackoverflow in " # SPACE_P " -> " # NAME " _stack at lineno=%i, only %i results could be stored, increase MAXRESULT \n " , parser_state . lineno , MAXRESULT ) ; \
fprintf ( stderr , " stackoverflow in " # SPACE_P " -> " # NAME " _stack at lineno=%i, only %u results could be stored, increase MAXRESULT \n " , parser_state . lineno , MAXRESULT ) ; \
exit ( EXIT_FAILURE ) ; \
}
/ / endmacro CHECKOVERFLOW
@ -76,13 +76,13 @@ void print_plan () {
# define PRINT(SPACE_P, TYPESIG, NAME) \
CHECKOVERFLOW ( SPACE_P , NAME ) \
CHECKUNDERFLOW ( SPACE_P , NAME ) \
for ( int j = 0 ; j < ( SPACE_P ) - > NAME # # _stackp ; j + + ) \
for ( unsigned int j = 0 ; j < ( SPACE_P ) - > NAME # # _stackp ; j + + ) \
printf ( " " # SPACE_P " -> " # NAME " -stack value[ %i ] --> " # TYPESIG " \n " , j , ( SPACE_P ) - > NAME # # _stack [ j ] ) ; \
/ / endmacro PRINT
# define PRINTV(SPACE_P, VSTRINGARRAY, NAME) \
CHECKOVERFLOW ( SPACE_P , NAME ) \
CHECKUNDERFLOW ( SPACE_P , NAME ) \
for ( int j = 0 ; j < ( SPACE_P ) - > NAME # # _stackp ; j + + ) \
for ( unsigned int j = 0 ; j < ( SPACE_P ) - > NAME # # _stackp ; j + + ) \
printf ( " " # SPACE_P " -> " # NAME " -stack value[ %i ] --> %s \n " , j , ( VSTRINGARRAY ) [ ( SPACE_P ) - > NAME # # _stack [ j ] ] ) ; \
/ / endmacro PRINTV
@ -314,12 +314,12 @@ static ret_t call_exec_function(ctiff_t * ctif, ret_t * retp, internal_entry_t
char * strp = expected_value ;
for ( unsigned int j = 0 ; j < count ; j + + ) values [ j ] = exe_i_pop ( & exe ) ;
int all_printed = 0 ;
int printed = snprintf ( strp , VALUESTRLEN , " count=%i , values " , count ) ;
int printed = snprintf ( strp , VALUESTRLEN , " count=%u , values " , count ) ;
strp + = printed ;
all_printed + = printed ;
for ( unsigned int j = 0 ; j < count ; j + + ) {
/* reduce VALUESTRLEN with n*printed */
printed = snprintf ( strp , ( size_t ) ( VALUESTRLEN - all_printed ) , " [%i ]=%u " , j , values [ j ] ) ;
printed = snprintf ( strp , ( size_t ) ( VALUESTRLEN - all_printed ) , " [%u ]=%u " , j , values [ j ] ) ;
strp + = printed ;
all_printed + = printed ;
}
@ -332,12 +332,12 @@ static ret_t call_exec_function(ctiff_t * ctif, ret_t * retp, internal_entry_t
char * strp = expected_value ;
for ( unsigned int j = 0 ; j < count ; j + + ) values [ j ] = exe_i_pop ( & exe ) ;
int all_printed = 0 ;
int printed = snprintf ( expected_value , VALUESTRLEN , " count=%i , values " , count ) ;
int printed = snprintf ( expected_value , VALUESTRLEN , " count=%u , values " , count ) ;
strp + = printed ;
all_printed + = printed ;
for ( unsigned int j = 0 ; j < count ; j + + ) {
/* reduce VALUESTRLEN with n*printed */
printed = snprintf ( strp , VALUESTRLEN , " [%i ]=%u " , j , values [ j ] ) ;
printed = snprintf ( strp , VALUESTRLEN , " [%u ]=%u " , j , values [ j ] ) ;
strp + = printed ;
all_printed + = printed ;
}
@ -347,19 +347,19 @@ static ret_t call_exec_function(ctiff_t * ctif, ret_t * retp, internal_entry_t
case fc_tag_has_value_in_range : { unsigned int a = exe_i_pop ( & exe ) ;
unsigned int b = exe_i_pop ( & exe ) ;
expected_value = __ch_malloc ( expected_value ) ;
snprintf ( expected_value , VALUESTRLEN , " %i -- %i " , a , b ) ;
snprintf ( expected_value , VALUESTRLEN , " %u -- %u " , a , b ) ;
ret = check_tag_has_value_in_range ( ctif , exe . tag , a , b ) ;
break ;
}
case fc_tag_has_value : { unsigned int a = exe_i_pop ( & exe ) ;
expected_value = __ch_malloc ( expected_value ) ;
snprintf ( expected_value , VALUESTRLEN , " %i " , a ) ;
snprintf ( expected_value , VALUESTRLEN , " %u " , a ) ;
ret = check_tag_has_value ( ctif , exe . tag , a ) ;
break ;
}
case fc_tag_has_value_quiet : { unsigned int a = exe_i_pop ( & exe ) ;
expected_value = __ch_malloc ( expected_value ) ;
snprintf ( expected_value , VALUESTRLEN , " %i " , a ) ;
snprintf ( expected_value , VALUESTRLEN , " %u " , a ) ;
ret = check_tag_has_value_quiet ( ctif , exe . tag , a ) ;
break ;
}
@ -596,7 +596,7 @@ void execute_plan (ctiff_t * ctif) {
ret_t res = check_notag ( ctif , ( tag_t ) i ) ;
if ( res . returncode = = tag_exist ) {
# ifdef EXE_DEBUG
printf ( " checking %i -> res=%s (%i) \n " , i , get_parser_error_description ( res . returncode ) , res . returncode ) ;
printf ( " checking %u -> res=%s (%i) \n " , i , get_parser_error_description ( res . returncode ) , res . returncode ) ;
# endif
full_res_t full ;
full . tag = ( tag_t ) i ;