]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/strings.cpp
vm: Tweak Factor VM to compile with Microsoft Visual Studio on Windows, in addition...
[factor.git] / vm / strings.cpp
index c7e0354cbaf89d8012ad0ea5c7b727c132c16853..67e4fb4508b909fe2af48a5b9ca6e74a24528183 100644 (file)
@@ -24,7 +24,7 @@ cell string::nth(cell index) const
 
 void factor_vm::set_string_nth_fast(string *str, cell index, cell ch)
 {
-       str->data()[index] = ch;
+       str->data()[index] = (u8)ch;
 }
 
 void factor_vm::set_string_nth_slow(string *str_, cell index, cell ch)
@@ -51,7 +51,7 @@ void factor_vm::set_string_nth_slow(string *str_, cell index, cell ch)
                write_barrier(&str->aux);
        }
 
-       aux->data<u16>()[index] = ((ch >> 7) ^ 1);
+       aux->data<u16>()[index] = (u16)((ch >> 7) ^ 1);
 }
 
 /* allocates memory */