libdbi-drivers/badcode.diff

33 lines
1.4 KiB
Diff

From: Jan Engelhardt <jengelh@inai.de>
Date: 2013-09-07 22:51:05.518210575 +0200
build: resolve rpmlint aborting due to bad code
gcc:
src/constraint.c:167:32: warning: initialization makes pointer from integer without a cast [enabled by default]
src/constraint.c:168:5: warning: passing argument 1 of 'matches' makes pointer from integer without a cast [enabled by default]
src/constraint.c:168:5: note: expected 'const void *' but argument is of type 'intptr_t'
rpmlint:
E: libdbi-drivers 64bit-portability-issue src/constraint.c:167, 168
---
tests/cgreen/src/constraint.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: libdbi-drivers-0.9.0/tests/cgreen/src/constraint.c
===================================================================
--- libdbi-drivers-0.9.0.orig/tests/cgreen/src/constraint.c
+++ libdbi-drivers-0.9.0/tests/cgreen/src/constraint.c
@@ -164,8 +164,8 @@ static void test_want_double(Constraint
}
static int compare_using_matcher(Constraint *constraint, intptr_t actual) {
- int (*matches)(const void*) = constraint->expected;
- return matches(actual);
+ int (*matches)(const void*) = (void *)(intptr_t)constraint->expected;
+ return matches((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) {