]> git.lizzy.rs Git - rust.git/commitdiff
Fix `asm!` blocks
authorAndrea Canciani <ranma42@gmail.com>
Mon, 16 May 2016 13:41:45 +0000 (15:41 +0200)
committerAndrea Canciani <ranma42@gmail.com>
Mon, 16 May 2016 13:41:45 +0000 (15:41 +0200)
The `volatile` modifier was incorrectly written outside of the `asm!`
blocks.

src/libcore/num/dec2flt/algorithm.rs

index 35a613ef5fce497586cd28bdd59bff3739e64ddc..c7af46a1e4f6ba62e5598baaf1800f7606654120 100644 (file)
@@ -70,7 +70,7 @@ mod fpu_precision {
     pub struct FPUControlWord(u16);
 
     fn set_cw(cw: u16) {
-        unsafe { asm!("fldcw $0" :: "m" (cw)) :: "volatile" }
+        unsafe { asm!("fldcw $0" :: "m" (cw) :: "volatile") }
     }
 
     /// Set the precision field of the FPU to `T` and return a `FPUControlWord`
@@ -86,7 +86,7 @@ pub fn set_precision<T>() -> FPUControlWord {
 
         // Get the original value of the control word to restore it later, when the
         // `FPUControlWord` structure is dropped
-        unsafe { asm!("fnstcw $0" : "=*m" (&cw)) ::: "volatile" }
+        unsafe { asm!("fnstcw $0" : "=*m" (&cw) ::: "volatile") }
 
         // Set the control word to the desired precision. This is achieved by masking away the old
         // precision (bits 8 and 9, 0x300) and replacing it with the precision flag computed above.