about summary refs log tree commit diff stats
path: root/020run.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-07 15:49:40 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-07 15:49:40 -0700
commit05d177737c980aad2fcdb54765433e02021ab1e0 (patch)
tree3b146349a2674db7e585f396bfb5eb0062c4ccd9 /020run.cc
parent0487a30e7078861ed7de42bdb21b5c71fb9b54a1 (diff)
downloadmu-05d177737c980aad2fcdb54765433e02021ab1e0.tar.gz
1299 - stop using [] in any vector
Useful check:

  $ grep "[^ '\"]\[[^\"]" *.cc \
    |perl -pwe 's/\Wargv\[|\WTests\[|\Wframe\[|\WMemory\[|\WName\[|\WSurrounding_space\[|\WRecipe\[|\WType\[|\WRecipe_number\[|\WType_number\[|\WBefore_fragments\[|\WAfter_fragments\[//g' \
    |perl -pwe 's/\Wargv\[|\WTests\[|\Wframe\[|\WMemory\[|\WName\[|\WSurrounding_space\[|\WRecipe\[|\WType\[|\WRecipe_number\[|\WType_number\[|\WBefore_fragments\[|\WAfter_fragments\[//g' \
    |grep '[^ ]\['
Diffstat (limited to '020run.cc')
-rw-r--r--020run.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/020run.cc b/020run.cc
index 7dadff6d..0f196b82 100644
--- a/020run.cc
+++ b/020run.cc
@@ -111,7 +111,7 @@ inline const string& current_recipe_name() {
 }
 
 inline const instruction& current_instruction() {
-  return Recipe[Current_routine->running_recipe].steps[Current_routine->running_step_index];
+  return Recipe[Current_routine->running_recipe].steps.at(Current_routine->running_step_index);
 }
 
 inline bool routine::completed() const {
@@ -192,8 +192,8 @@ void write_memory(reagent x, vector<long long int> data) {
   if (size_of(x) != data.size())
     raise << "size mismatch in storing to " << x.to_string() << '\n';
   for (index_t offset = 0; offset < data.size(); ++offset) {
-    trace("mem") << "storing " << data[offset] << " in location " << base+offset;
-    Memory[base+offset] = data[offset];
+    trace("mem") << "storing " << data.at(offset) << " in location " << base+offset;
+    Memory[base+offset] = data.at(offset);
   }
 }
 
@@ -211,7 +211,7 @@ bool is_dummy(const reagent& x) {
 }
 
 bool isa_literal(const reagent& r) {
-  return r.types.size() == 1 && r.types[0] == 0;
+  return r.types.size() == 1 && r.types.at(0) == 0;
 }
 
 :(scenario run_label)