commit: d306c830e97ab2bd9dc4e305010103a76e073263 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Wed Dec 20 15:17:22 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Dec 20 15:18:40 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d306c830
dev-db/libdbi-drivers: use fedora's modern C patch Less void* casting. Closes: https://bugs.gentoo.org/894750 Closes: https://bugs.gentoo.org/873997 Closes: https://bugs.gentoo.org/870961 Signed-off-by: Sam James <sam <AT> gentoo.org> .../libdbi-drivers-0.9.0-clang16-build-fix.patch | 44 ++++++++++++++++------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/dev-db/libdbi-drivers/files/libdbi-drivers-0.9.0-clang16-build-fix.patch b/dev-db/libdbi-drivers/files/libdbi-drivers-0.9.0-clang16-build-fix.patch index 243c912a00c7..42fb7cb6eabc 100644 --- a/dev-db/libdbi-drivers/files/libdbi-drivers-0.9.0-clang16-build-fix.patch +++ b/dev-db/libdbi-drivers/files/libdbi-drivers-0.9.0-clang16-build-fix.patch @@ -1,26 +1,46 @@ Bug: https://bugs.gentoo.org/894750 +https://sourceforge.net/p/libdbi-drivers/bugs/28/ + +Fix type errors in the cgreen with constraints facility. + +diff --git a/tests/cgreen/src/constraint.c b/tests/cgreen/src/constraint.c +index c19c0ddd41a7bfa7..95673dd3e222a3cf 100644 --- a/tests/cgreen/src/constraint.c +++ b/tests/cgreen/src/constraint.c -@@ -101,7 +101,7 @@ Constraint *with_(const char *parameter, const char* matcher_name, int (*matcher +@@ -22,8 +22,7 @@ static double unbox_double(intptr_t box); + static double as_double(intptr_t box); - constraint->parameter = parameter; - constraint->compare = &compare_using_matcher; -- constraint->test = &test_with_matcher; -+ constraint->test = (void *)&test_with_matcher; - constraint->name = matcher_name; - constraint->expected = (intptr_t)matcher_function; - return constraint; -@@ -164,8 +164,8 @@ static void test_want_double(Constraint *constraint, const char *function, intpt + static int compare_using_matcher(Constraint *constraint, intptr_t actual); +-static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t actual, const char *test_file, int test_line, TestReporter *reporter); +- ++static void test_with_matcher(Constraint *constraint, const char *function, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter); + + void destroy_constraint(void *abstract) { + Constraint *constraint = (Constraint *)abstract; +@@ -164,11 +163,11 @@ static void test_want_double(Constraint *constraint, const char *function, intpt } static int compare_using_matcher(Constraint *constraint, intptr_t actual) { - int (*matches)(const void*) = constraint->expected; - return matches(actual); -+ int (*matches)(const void*) = (void *)constraint->expected; -+ return matches((int *)actual); ++ int (*matches)(const void*) = (int (*)(const void*)) constraint->expected; ++ return matches((const void *)actual); + } + +-static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) { ++static void test_with_matcher(Constraint *constraint, const char *function, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) { + (*reporter->assert_true)( + reporter, + test_file, +@@ -176,7 +175,7 @@ static void test_with_matcher(Constraint *constraint, const char *function, cons + (*constraint->compare)(constraint, matcher_function), + "Wanted parameter [%s] to match [%s] in function [%s]", + constraint->parameter, +- matcher_name, ++ constraint->name, + function); } - static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) { --- a/tests/cgreen/src/unit.c +++ b/tests/cgreen/src/unit.c @@ -9,6 +9,7 @@
