Skip to content

Commit

Permalink
Merge pull request #774 from yallop/plus-callback-fix
Browse files Browse the repository at this point in the history
Fix the plus_callback test.
  • Loading branch information
yallop authored Jun 8, 2024
2 parents 9e6e028 + fd0cc17 commit c6cd8eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/clib/test_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,14 +544,14 @@ double *matrix_transpose(int rows, int cols, double *matrix)
return rv;
}

int (*plus_callback)(int) = NULL;
int (*plus_callback)(int, int) = NULL;

/* Sum the range [a, b] */
int sum_range_with_plus_callback(int a, int b)
{
int sum = 0, i = 0;
for (i = a; i <= b; i++) {
sum += i;
sum = plus_callback (sum, i);
}
return sum;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/clib/test_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ struct one_int { int i; };
struct one_int return_struct_by_value(void);
void matrix_mul(int, int, int, double *, double *, double *);
double *matrix_transpose(int, int, double *);
extern int (*plus_callback)(int);
extern int (*plus_callback)(int, int);
int sum_range_with_plus_callback(int, int);
typedef int callback_t(void);
void register_callback(callback_t *);
Expand Down

0 comments on commit c6cd8eb

Please sign in to comment.