From 23e23bd762a4b5a14ff2abcbabfd2349621a3dbe Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Tue, 22 Mar 2011 17:25:40 -0700 Subject: Further support for floating-point. Literals with exponents work and literals with the 'f32' or 'f64' suffixes work as well. In addition, logging things with the f32 or f64 type works. (float is still assumed to be a synonym for f64). --- src/rt/rust_upcall.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/rt/rust_upcall.cpp') diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 30306104..19f1ec90 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -40,7 +40,14 @@ void upcall_log_int(rust_task *task, int32_t i) { } extern "C" CDECL -void upcall_log_float(rust_task *task, double *f) { +void upcall_log_float(rust_task *task, float f) { + LOG_UPCALL_ENTRY(task); + task->log(rust_log::UPCALL | rust_log::ULOG, + "rust: %12.12f", f); +} + +extern "C" CDECL +void upcall_log_double(rust_task *task, double *f) { LOG_UPCALL_ENTRY(task); task->log(rust_log::UPCALL | rust_log::ULOG, "rust: %12.12f", *f); -- cgit v1.2.3