]> git.proxmox.com Git - rustc.git/blobdiff - src/test/run-pass/variadic-ffi.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / test / run-pass / variadic-ffi.rs
index 6351cc76a2e4c9f3e5cdc25f6d66705228cb15c1..abd1709825c974b605f03b011c5113f0bb3afc25 100644 (file)
@@ -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());
             });
         }