From 4cbfe1582a91bb3899e878f0691f4fec2647e97e Mon Sep 17 00:00:00 2001 From: pravic Date: Thu, 17 Mar 2016 12:05:22 +0300 Subject: [PATCH] test: Fix missing call of function pointer Also an unused variable warning was here. --- src/test/run-pass/variadic-ffi.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/run-pass/variadic-ffi.rs b/src/test/run-pass/variadic-ffi.rs index 6351cc76a2e..abd1709825c 100644 --- a/src/test/run-pass/variadic-ffi.rs +++ b/src/test/run-pass/variadic-ffi.rs @@ -45,15 +45,15 @@ pub fn main() { let x: unsafe extern fn(*mut c_char, *const c_char, ...) -> c_int = sprintf; // A function that takes a function pointer - unsafe fn call(p: unsafe extern fn(*mut c_char, *const c_char, ...) -> c_int) { + unsafe fn call(fp: unsafe extern fn(*mut c_char, *const c_char, ...) -> c_int) { // Call with just the named parameter let c = CString::new(&b"Hello World\n"[..]).unwrap(); - check("Hello World\n", |s| sprintf(s, c.as_ptr())); + check("Hello World\n", |s| fp(s, c.as_ptr())); // Call with variable number of arguments let c = CString::new(&b"%d %f %c %s\n"[..]).unwrap(); check("42 42.500000 a %d %f %c %s\n\n", |s| { - sprintf(s, c.as_ptr(), 42, 42.5f64, 'a' as c_int, c.as_ptr()); + fp(s, c.as_ptr(), 42, 42.5f64, 'a' as c_int, c.as_ptr()); }); }