about summary refs log tree commit diff stats
path: root/032array.cc
diff options
context:
space:
mode:
Diffstat (limited to '032array.cc')
-rw-r--r--032array.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/032array.cc b/032array.cc
index fd7f9baf..384b2106 100644
--- a/032array.cc
+++ b/032array.cc
@@ -47,11 +47,11 @@ recipe main [
 +mem: storing 16 in location 9
 
 //: disable the size mismatch check since the destination array need not be initialized
-:(replace "if (size_of(x) != data.size())" following "void write_memory(reagent x, vector<double> data)")
-if (x.types.at(0) != Type_number["array"] && size_of(x) != data.size())
-:(after "size_t size_of(const reagent& r)")
+:(replace "if (size_of(x) != SIZE(data))" following "void write_memory(reagent x, vector<double> data)")
+if (x.types.at(0) != Type_number["array"] && size_of(x) != SIZE(data))
+:(after "long long int size_of(const reagent& r)")
   if (r.types.at(0) == Type_number["array"]) {
-    assert(r.types.size() > 1);
+    assert(SIZE(r.types) > 1);
     // skip the 'array' type to get at the element type
     return 1 + Memory[r.value]*size_of(array_element(r.types));
   }
@@ -98,7 +98,7 @@ case INDEX: {
 //?   if (Trace_stream) Trace_stream->dump_layer = "run"; //? 1
   reagent base = canonize(current_instruction().ingredients.at(0));
 //?   trace("run") << "ingredient 0 after canonize: " << base.to_string(); //? 1
-  index_t base_address = base.value;
+  long long int base_address = base.value;
   assert(base.types.at(0) == Type_number["array"]);
   reagent offset = canonize(current_instruction().ingredients.at(1));
 //?   trace("run") << "ingredient 1 after canonize: " << offset.to_string(); //? 1
@@ -106,7 +106,7 @@ case INDEX: {
   vector<type_number> element_type = array_element(base.types);
 //?   trace("run") << "offset: " << offset_val.at(0); //? 1
 //?   trace("run") << "size of elements: " << size_of(element_type); //? 1
-  index_t src = base_address + 1 + offset_val.at(0)*size_of(element_type);
+  long long int src = base_address + 1 + offset_val.at(0)*size_of(element_type);
   trace("run") << "address to copy is " << src;
   trace("run") << "its type is " << element_type.at(0);
   reagent tmp;
@@ -153,12 +153,12 @@ Recipe_number["index-address"] = INDEX_ADDRESS;
 :(before "End Primitive Recipe Implementations")
 case INDEX_ADDRESS: {
   reagent base = canonize(current_instruction().ingredients.at(0));
-  index_t base_address = base.value;
+  long long int base_address = base.value;
   assert(base.types.at(0) == Type_number["array"]);
   reagent offset = canonize(current_instruction().ingredients.at(1));
   vector<double> offset_val(read_memory(offset));
   vector<type_number> element_type = array_element(base.types);
-  index_t result = base_address + 1 + offset_val.at(0)*size_of(element_type);
+  long long int result = base_address + 1 + offset_val.at(0)*size_of(element_type);
   products.resize(1);
   products.at(0).push_back(result);
   break;