Skip to content

Commit 4cbfe15

Browse files
committed
test: Fix missing call of function pointer
Also an unused variable warning was here.
1 parent 6e0f2f2 commit 4cbfe15

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/run-pass/variadic-ffi.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ pub fn main() {
4545
let x: unsafe extern fn(*mut c_char, *const c_char, ...) -> c_int = sprintf;
4646

4747
// A function that takes a function pointer
48-
unsafe fn call(p: unsafe extern fn(*mut c_char, *const c_char, ...) -> c_int) {
48+
unsafe fn call(fp: unsafe extern fn(*mut c_char, *const c_char, ...) -> c_int) {
4949
// Call with just the named parameter
5050
let c = CString::new(&b"Hello World\n"[..]).unwrap();
51-
check("Hello World\n", |s| sprintf(s, c.as_ptr()));
51+
check("Hello World\n", |s| fp(s, c.as_ptr()));
5252

5353
// Call with variable number of arguments
5454
let c = CString::new(&b"%d %f %c %s\n"[..]).unwrap();
5555
check("42 42.500000 a %d %f %c %s\n\n", |s| {
56-
sprintf(s, c.as_ptr(), 42, 42.5f64, 'a' as c_int, c.as_ptr());
56+
fp(s, c.as_ptr(), 42, 42.5f64, 'a' as c_int, c.as_ptr());
5757
});
5858
}
5959

0 commit comments

Comments
 (0)