about summary refs log tree commit diff stats
path: root/cpp/036call_ingredient.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-04 11:02:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-04 11:02:56 -0700
commita66c9ae68122e04637d65c7f3aedcd96012c8cb6 (patch)
treeceddf9f22c55621be86768a0aeedc927495e62d6 /cpp/036call_ingredient.cc
parentde49fb426aa44984d308f5856ec836360ba0bdce (diff)
downloadmu-a66c9ae68122e04637d65c7f3aedcd96012c8cb6.tar.gz
1249 - new type: index_t
It will always be identical to size_t, just more readable, like
recipe_number, etc. The various unsigned types are sizes, indices (which
often compare with sizes for bounds checking), numbers which are
canonical elements of a specific space (like recipes or mu types), and
ids which I haven't introduced yet.
Diffstat (limited to 'cpp/036call_ingredient.cc')
-rw-r--r--cpp/036call_ingredient.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpp/036call_ingredient.cc b/cpp/036call_ingredient.cc
index d928f286..87abe5ef 100644
--- a/cpp/036call_ingredient.cc
+++ b/cpp/036call_ingredient.cc
@@ -24,7 +24,7 @@ recipe f [
 
 :(before "End call Fields")
 vector<vector<int> > ingredient_atoms;
-size_t next_ingredient_to_process;
+index_t next_ingredient_to_process;
 :(replace{} "call(recipe_number r)")
 call(recipe_number r) :running_recipe(r), running_step_index(0), next_ingredient_to_process(0) {}
 
@@ -105,7 +105,7 @@ INGREDIENT,
 Recipe_number["ingredient"] = INGREDIENT;
 :(before "End Primitive Recipe Implementations")
 case INGREDIENT: {
-  if (static_cast<size_t>(current_instruction().ingredients[0].value) < Current_routine->calls.top().ingredient_atoms.size()) {
+  if (static_cast<index_t>(current_instruction().ingredients[0].value) < Current_routine->calls.top().ingredient_atoms.size()) {
     Current_routine->calls.top().next_ingredient_to_process = current_instruction().ingredients[0].value;
     trace("run") << "product 0 is "
         << Current_routine->calls.top().ingredient_atoms[Current_routine->calls.top().next_ingredient_to_process][0];