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
142142 template<> const char Ttuple::end = ')';
143143
144144 template<> const char Tmodule::begin = '{';
145−template <> const char Tmodule::end = '}';
145+template<> const char Tmodule::end = '}';
146146
147147 sig_stream_t &disvm::assembly::sigkind::operator<<(sig_stream_t &os, const Ttuple &t)
148148 {
src/include/disvm.h+3−3
@@ -55,12 +55,12 @@ namespace disvm · 54 unmodified lines
5555 class vm_t final
5656 {
5757 public: // static
58− static const uint32_t root_vm_thread_id = uint32_t{ 0 };
58+ static const uint32_t root_vm_thread_id = 0;
5959
60− static const auto default_system_thread_count = uint32_t{ 1 };
60+ static const uint32_t default_system_thread_count = 1;
6161
6262 // 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;
6464
6565 public:
6666 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
180180 vm_stack_t::vm_stack_t(std::size_t stack_extent)
181181 : _mem{ std::make_unique<vm_stack_layout>(stack_extent) }
182182 {
183− assert(stack_extent != 0);
183+ assert(0 < stack_extent && stack_extent < static_cast<std::size_t>(std::numeric_limits<word_t>::max()));
184184 debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "init: vm stack\n");
185185 }
186186
src/vm/string.cpp+5−5
@@ -43,7 +43,7 @@ namespace · 42 unmodified lines
4343
4444 // Compare function for character types.
4545 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)
4747 {
4848 for (auto i = word_t{ 0 }; i < len; ++i)
4949 {
@@ -62,7 +62,7 @@ int vm_string_t::compare(const vm_string_t *s1, const vm_string_t *s2) · 12 unmodified lines
6262 {
6363 auto len_1 = word_t{ 0 };
6464 auto scen_1 = ascii_idx;
65− void *str_mem_1 = const_cast<char *>("");
65+ const void *str_mem_1 = "";
6666 if (s1 != nullptr)
6767 {
6868 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
7272
7373 auto len_2 = word_t{ 0 };
7474 auto scen_2 = ascii_idx;
75− void *str_mem_2 = const_cast<char *>("");
75+ const void *str_mem_2 = "";
7676 if (s2 != nullptr)
7777 {
7878 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
9797 result = std::memcmp(str_mem_1, str_mem_2, min_length);
9898 break;
9999 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));
101101 break;
102102 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));
104104 break;
105105 }
106106