diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-04 11:02:56 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-04 11:02:56 -0700 |
commit | a66c9ae68122e04637d65c7f3aedcd96012c8cb6 (patch) | |
tree | ceddf9f22c55621be86768a0aeedc927495e62d6 /cpp/036call_ingredient.cc | |
parent | de49fb426aa44984d308f5856ec836360ba0bdce (diff) | |
download | mu-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.cc | 4 |
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]; |