diff options
-rw-r--r-- | cpp/010vm.cc | 4 | ||||
-rw-r--r-- | cpp/031address.cc | 2 | ||||
-rw-r--r-- | cpp/032array.cc | 6 | ||||
-rw-r--r-- | cpp/042new.cc | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/cpp/010vm.cc b/cpp/010vm.cc index 2d1ce2ba..d70305b7 100644 --- a/cpp/010vm.cc +++ b/cpp/010vm.cc @@ -1,6 +1,6 @@ :(after "Types") // A program is a book of 'recipes' (functions) -typedef int recipe_number; +typedef size_t recipe_number; :(before "End Globals") map<string, recipe_number> Recipe_number; map<recipe_number, recipe> Recipe; @@ -70,7 +70,7 @@ Memory.clear(); // Unlike most computers today, mu stores types in a single big table, shared // by all the mu programs on the computer. This is useful in providing a // seamless experience to help understand arbitrary mu programs. -typedef int type_number; +typedef size_t type_number; :(before "End Globals") map<string, type_number> Type_number; map<type_number, type_info> Type; diff --git a/cpp/031address.cc b/cpp/031address.cc index f84af8d7..ddb9ba64 100644 --- a/cpp/031address.cc +++ b/cpp/031address.cc @@ -43,7 +43,7 @@ reagent canonize(reagent x) { reagent deref(reagent x) { //? cout << "deref: " << x.to_string() << "\n"; //? 2 - static const int ADDRESS = Type_number["address"]; + static const type_number ADDRESS = Type_number["address"]; reagent result; assert(x.types[0] == ADDRESS); diff --git a/cpp/032array.cc b/cpp/032array.cc index c1d35667..6c3eb6da 100644 --- a/cpp/032array.cc +++ b/cpp/032array.cc @@ -50,7 +50,7 @@ recipe main [ :(replace "if (size_of(x) != data.size())" following "void write_memory(reagent x, vector<int> data)") if (x.types[0] != Type_number["array"] && size_of(x) != data.size()) :(after "size_t size_of(const reagent& r)") - static const int ARRAY = Type_number["array"]; + static const type_number ARRAY = Type_number["array"]; if (r.types[0] == ARRAY) { assert(r.types.size() > 1); // skip the 'array' type to get at the element type @@ -96,7 +96,7 @@ INDEX, Recipe_number["index"] = INDEX; :(before "End Primitive Recipe Implementations") case INDEX: { - static const int ARRAY = Type_number["array"]; + static const type_number ARRAY = Type_number["array"]; //? if (Trace_stream) Trace_stream->dump_layer = "run"; //? 1 trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].to_string(); reagent base = canonize(current_instruction().ingredients[0]); @@ -161,7 +161,7 @@ INDEX_ADDRESS, Recipe_number["index-address"] = INDEX_ADDRESS; :(before "End Primitive Recipe Implementations") case INDEX_ADDRESS: { - static const int ARRAY = Type_number["array"]; + static const type_number ARRAY = Type_number["array"]; trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; reagent base = canonize(current_instruction().ingredients[0]); int base_address = base.value; diff --git a/cpp/042new.cc b/cpp/042new.cc index ea05a3ed..9b50d84d 100644 --- a/cpp/042new.cc +++ b/cpp/042new.cc @@ -54,7 +54,7 @@ case NEW: { size_t size = 0; size_t array_length = 0; { - vector<int> type; + vector<type_number> type; type.push_back(current_instruction().ingredients[0].value); if (current_instruction().ingredients.size() > 1) { // array |