about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2011-03-22 17:25:40 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-03-22 17:31:27 -0700
commit23e23bd762a4b5a14ff2abcbabfd2349621a3dbe (patch)
treea0ff672d10f7a87a22d1eb047632f3b96dfe5317 /src/rt/rust_upcall.cpp
parentd56971d5b466dd2bcd2ed147fd1668f06c7dbca0 (diff)
downloadrust-23e23bd762a4b5a14ff2abcbabfd2349621a3dbe.tar.gz
rust-23e23bd762a4b5a14ff2abcbabfd2349621a3dbe.zip
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).
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 30306104859..19f1ec9070d 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);