about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-01-18 09:26:00 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-01-18 09:26:00 -0800
commit4c2229fb2d1f762afcbdd41d62b7f0ee9df6a60f (patch)
treed6c48ed593a9840218ab94342d6f310be97fd67f
parentaf085cf654eb499c1756509dea1d74f93ecbef45 (diff)
downloadmu-4c2229fb2d1f762afcbdd41d62b7f0ee9df6a60f.tar.gz
2564
-rw-r--r--056recipe_header.cc12
-rw-r--r--057static_dispatch.cc2
2 files changed, 6 insertions, 8 deletions
diff --git a/056recipe_header.cc b/056recipe_header.cc
index 15c407a5..026f44e6 100644
--- a/056recipe_header.cc
+++ b/056recipe_header.cc
@@ -215,11 +215,11 @@ void check_calls_against_header(const recipe_ordinal r) {
     if (inst.operation < MAX_PRIMITIVE_RECIPES) continue;
     const recipe& callee = get(Recipe, inst.operation);
     if (!callee.has_header) continue;
-    for (long int i = 0; i < smaller(SIZE(inst.ingredients), SIZE(callee.ingredients)); ++i) {
+    for (long int i = 0; i < min(SIZE(inst.ingredients), SIZE(callee.ingredients)); ++i) {
       if (!types_coercible(callee.ingredients.at(i), inst.ingredients.at(i)))
         raise_error << maybe(caller.name) << "ingredient " << i << " has the wrong type at '" << inst.to_string() << "'\n" << end();
     }
-    for (long int i = 0; i < smaller(SIZE(inst.products), SIZE(callee.products)); ++i) {
+    for (long int i = 0; i < min(SIZE(inst.products), SIZE(callee.products)); ++i) {
       if (is_dummy(inst.products.at(i))) continue;
       if (!types_coercible(callee.products.at(i), inst.products.at(i)))
         raise_error << maybe(caller.name) << "product " << i << " has the wrong type at '" << inst.to_string() << "'\n" << end();
@@ -227,10 +227,6 @@ void check_calls_against_header(const recipe_ordinal r) {
   }
 }
 
-inline long long int smaller(long long int a, long long int b) {
-  return a < b ? a : b;
-}
-
 //:: Check types going in and out of all recipes with headers.
 
 :(scenarios transform)
@@ -459,3 +455,7 @@ recipe add2 x:number, y:number -> x:number [
   load-ingredients
 ]
 +error: main: '3:number <- add2 1:number, 2:number' should write to 1:number rather than 3:number
+
+:(before "End Includes")
+using std::min;
+using std::max;
diff --git a/057static_dispatch.cc b/057static_dispatch.cc
index dc2e4cb5..bad8c1d8 100644
--- a/057static_dispatch.cc
+++ b/057static_dispatch.cc
@@ -459,6 +459,4 @@ recipe foo a:boolean -> b:number [
 +error: main: failed to find a matching call for 'y:number <- foo x'
 
 :(before "End Includes")
-using std::min;
-using std::max;
 using std::abs;