History

Minor updates to elinor's PR regarding building on MAC.

arr committed 9 years ago

Commit 0217bda1 parent 34cadb24 files · +10 −10Browse files

Unified · Split

4 files
  1. src/asm/type_signature.cpp +1 −1
  2. src/include/disvm.h +3 −3
  3. src/vm/stack.cpp +1 −1
  4. src/vm/string.cpp +5 −5
src/asm/type_signature.cpp+1−1
@@ -142,7 +142,7 @@ template<> const char Ttuple::begin = '('; · 141 unmodified lines
142template<> const char Ttuple::end = ')';142template<> const char Ttuple::end = ')';
143 143
144template<> const char Tmodule::begin = '{';144template<> const char Tmodule::begin = '{';
145template <> const char Tmodule::end = '}';145template<> const char Tmodule::end = '}';
146 146
147sig_stream_t &disvm::assembly::sigkind::operator<<(sig_stream_t &os, const Ttuple &t)147sig_stream_t &disvm::assembly::sigkind::operator<<(sig_stream_t &os, const Ttuple &t)
148{148{
src/include/disvm.h+3−3
@@ -55,12 +55,12 @@ namespace disvm · 54 unmodified lines
55 class vm_t final55 class vm_t final
56 {56 {
57 public: // static57 public: // static
58 static const uint32_t root_vm_thread_id = uint32_t{ 0 };58 static const uint32_t root_vm_thread_id = 0;
59 59
60 static const auto default_system_thread_count = uint32_t{ 1 };60 static const uint32_t default_system_thread_count = 1;
61 61
62 // The Inferno implementation defined the thread quanta as 2048 (include/interp.h)62 // The Inferno implementation defined the thread quanta as 2048 (include/interp.h)
63 static const auto default_thread_quanta = uint32_t{ 2048 };63 static const uint32_t default_thread_quanta = 2048;
64 64
65 public:65 public:
66 explicit vm_t(66 explicit vm_t(
src/vm/stack.cpp+1−1
@@ -180,7 +180,7 @@ pointer_t vm_frame_t::fixed_point_register_2() const · 179 unmodified lines
180vm_stack_t::vm_stack_t(std::size_t stack_extent)180vm_stack_t::vm_stack_t(std::size_t stack_extent)
181 : _mem{ std::make_unique<vm_stack_layout>(stack_extent) }181 : _mem{ std::make_unique<vm_stack_layout>(stack_extent) }
182{182{
183 assert(stack_extent != 0);183 assert(0 < stack_extent && stack_extent < static_cast<std::size_t>(std::numeric_limits<word_t>::max()));
184 debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "init: vm stack\n");184 debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "init: vm stack\n");
185}185}
186 186
src/vm/string.cpp+5−5
@@ -43,7 +43,7 @@ namespace · 42 unmodified lines
43 43
44 // Compare function for character types.44 // Compare function for character types.
45 template <typename CharacterType1, typename CharacterType2>45 template <typename CharacterType1, typename CharacterType2>
46 int _compare(word_t len, CharacterType1 *s1, CharacterType2 *s2)46 int _compare(word_t len, const CharacterType1 *s1, const CharacterType2 *s2)
47 {47 {
48 for (auto i = word_t{ 0 }; i < len; ++i)48 for (auto i = word_t{ 0 }; i < len; ++i)
49 {49 {
@@ -62,7 +62,7 @@ int vm_string_t::compare(const vm_string_t *s1, const vm_string_t *s2) · 12 unmodified lines
62{62{
63 auto len_1 = word_t{ 0 };63 auto len_1 = word_t{ 0 };
64 auto scen_1 = ascii_idx;64 auto scen_1 = ascii_idx;
65 void *str_mem_1 = const_cast<char *>("");65 const void *str_mem_1 = "";
66 if (s1 != nullptr)66 if (s1 != nullptr)
67 {67 {
68 len_1 = s1->_length;68 len_1 = s1->_length;
@@ -72,7 +72,7 @@ int vm_string_t::compare(const vm_string_t *s1, const vm_string_t *s2) · 3 unmodified lines
72 72
73 auto len_2 = word_t{ 0 };73 auto len_2 = word_t{ 0 };
74 auto scen_2 = ascii_idx;74 auto scen_2 = ascii_idx;
75 void *str_mem_2 = const_cast<char *>("");75 const void *str_mem_2 = "";
76 if (s2 != nullptr)76 if (s2 != nullptr)
77 {77 {
78 len_2 = s2->_length;78 len_2 = s2->_length;
@@ -97,10 +97,10 @@ int vm_string_t::compare(const vm_string_t *s1, const vm_string_t *s2) · 18 unmodified lines
97 result = std::memcmp(str_mem_1, str_mem_2, min_length);97 result = std::memcmp(str_mem_1, str_mem_2, min_length);
98 break;98 break;
99 case compare_case_t::ascii_rune:99 case compare_case_t::ascii_rune:
100 result = _compare(min_length, reinterpret_cast<char *>(str_mem_1), reinterpret_cast<rune_t *>(str_mem_2));100 result = _compare(min_length, reinterpret_cast<const char *>(str_mem_1), reinterpret_cast<const runtime::rune_t *>(str_mem_2));
101 break;101 break;
102 case compare_case_t::rune_ascii:102 case compare_case_t::rune_ascii:
103 result = _compare(min_length, reinterpret_cast<rune_t *>(str_mem_1), reinterpret_cast<char *>(str_mem_2));103 result = _compare(min_length, reinterpret_cast<const runtime::rune_t *>(str_mem_1), reinterpret_cast<const char *>(str_mem_2));
104 break;104 break;
105 }105 }
106 106