Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the plus_callback test. #774

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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