about summary refs log tree commit diff stats
path: root/036call_ingredient.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-17 02:22:41 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-17 02:22:41 -0700
commitac0e9db526dc15cf91f4c45c4586ddcc19e9708c (patch)
treeb5820975a254965d9963fda26d1a3d6644885e58 /036call_ingredient.cc
parent6f8f9fb53b5a7ef26496d496a4b93266c78d6332 (diff)
downloadmu-ac0e9db526dc15cf91f4c45c4586ddcc19e9708c.tar.gz
1391 - avoid unsigned integers
Diffstat (limited to '036call_ingredient.cc')
-rw-r--r--036call_ingredient.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/036call_ingredient.cc b/036call_ingredient.cc
index a6fbb181..090d86a8 100644
--- a/036call_ingredient.cc
+++ b/036call_ingredient.cc
@@ -24,13 +24,13 @@ recipe f [
 
 :(before "End call Fields")
 vector<vector<double> > ingredient_atoms;
-index_t next_ingredient_to_process;
+long long int 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) {}
 
 :(replace "Current_routine->calls.push_front(call(current_instruction().operation))" following "End Primitive Recipe Implementations")
 call callee(current_instruction().operation);
-for (size_t i = 0; i < ingredients.size(); ++i) {
+for (long long int i = 0; i < SIZE(ingredients); ++i) {
   callee.ingredient_atoms.push_back(ingredients.at(i));
 }
 Current_routine->calls.push_front(callee);
@@ -42,10 +42,10 @@ Recipe_number["next-ingredient"] = NEXT_INGREDIENT;
 :(before "End Primitive Recipe Implementations")
 case NEXT_INGREDIENT: {
   assert(!Current_routine->calls.empty());
-  if (Current_routine->calls.front().next_ingredient_to_process < Current_routine->calls.front().ingredient_atoms.size()) {
+  if (Current_routine->calls.front().next_ingredient_to_process < SIZE(Current_routine->calls.front().ingredient_atoms)) {
     products.push_back(
         Current_routine->calls.front().ingredient_atoms.at(Current_routine->calls.front().next_ingredient_to_process));
-    assert(products.size() == 1);  products.resize(2);  // push a new vector
+    assert(SIZE(products) == 1);  products.resize(2);  // push a new vector
     products.at(1).push_back(1);
     ++Current_routine->calls.front().next_ingredient_to_process;
   }
@@ -100,17 +100,17 @@ Recipe_number["ingredient"] = INGREDIENT;
 :(before "End Primitive Recipe Implementations")
 case INGREDIENT: {
   assert(isa_literal(current_instruction().ingredients.at(0)));
-  assert(ingredients.at(0).size() == 1);  // scalar
-  if (static_cast<index_t>(ingredients.at(0).at(0)) < Current_routine->calls.front().ingredient_atoms.size()) {
+  assert(scalar(ingredients.at(0)));
+  if (static_cast<long long int>(ingredients.at(0).at(0)) < SIZE(Current_routine->calls.front().ingredient_atoms)) {
     Current_routine->calls.front().next_ingredient_to_process = ingredients.at(0).at(0);
     products.push_back(
         Current_routine->calls.front().ingredient_atoms.at(Current_routine->calls.front().next_ingredient_to_process));
-    assert(products.size() == 1);  products.resize(2);  // push a new vector
+    assert(SIZE(products) == 1);  products.resize(2);  // push a new vector
     products.at(1).push_back(1);
     ++Current_routine->calls.front().next_ingredient_to_process;
   }
   else {
-    if (current_instruction().products.size() > 1) {
+    if (SIZE(current_instruction().products) > 1) {
       products.resize(2);
       products.at(0).push_back(0);  // todo: will fail noisily if we try to read a compound value
       products.at(1).push_back(0);