From 5798a11bf083ef3a0a2bbf2f55ddb6dfa1ee6b17 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 11 May 2015 10:04:16 -0700 Subject: 1343 --- 002test.cc | 2 +- 012transform.cc | 2 +- 037call_reply.cc | 2 +- 044space_surround.cc | 2 +- 045closure_name.cc | 2 +- 050scenario.cc | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/002test.cc b/002test.cc index 776e78e9..72f083bb 100644 --- a/002test.cc +++ b/002test.cc @@ -82,7 +82,7 @@ bool is_number(const string& s) { return s.find_first_not_of("0123456789-.") == string::npos; } -long long int to_int(string n) { +long long int to_number(string n) { char* end = NULL; long long int result = strtoll(n.c_str(), &end, /*any base*/0); assert(*end == '\0'); diff --git a/012transform.cc b/012transform.cc index b95b036c..7b2b58e8 100644 --- a/012transform.cc +++ b/012transform.cc @@ -48,5 +48,5 @@ void parse_int_reagents() { void populate_value(reagent& r) { if (r.initialized) return; if (!is_number(r.name)) return; - r.set_value(to_int(r.name)); + r.set_value(to_number(r.name)); } diff --git a/037call_reply.cc b/037call_reply.cc index e44fe205..3de6d588 100644 --- a/037call_reply.cc +++ b/037call_reply.cc @@ -33,7 +33,7 @@ case REPLY: { if (has_property(reply_inst.ingredients.at(i), "same-as-ingredient")) { vector tmp = property(reply_inst.ingredients.at(i), "same-as-ingredient"); assert(tmp.size() == 1); - long long int ingredient_index = to_int(tmp.at(0)); + long long int ingredient_index = to_number(tmp.at(0)); if (caller_instruction.products.at(i).value != caller_instruction.ingredients.at(ingredient_index).value) raise << "'same-as-ingredient' result " << caller_instruction.products.at(i).value << " must be location " << caller_instruction.ingredients.at(ingredient_index).value << '\n'; } diff --git a/044space_surround.cc b/044space_surround.cc index 16aef4dc..b1e4c5e7 100644 --- a/044space_surround.cc +++ b/044space_surround.cc @@ -45,7 +45,7 @@ index_t space_index(const reagent& x) { for (index_t i = 0; i < x.properties.size(); ++i) { if (x.properties.at(i).first == "space") { assert(x.properties.at(i).second.size() == 1); - return to_int(x.properties.at(i).second.at(0)); + return to_number(x.properties.at(i).second.at(0)); } } return 0; diff --git a/045closure_name.cc b/045closure_name.cc index 83fbeede..4cb9411f 100644 --- a/045closure_name.cc +++ b/045closure_name.cc @@ -84,7 +84,7 @@ index_t lookup_name(const reagent& x, const recipe_number default_recipe) { } vector p = property(x, "space"); if (p.size() != 1) raise << "/space property should have exactly one (non-negative integer) value\n"; - int n = to_int(p.at(0)); + int n = to_number(p.at(0)); assert(n >= 0); recipe_number surrounding_recipe = lookup_surrounding_recipe(default_recipe, n); set done; diff --git a/050scenario.cc b/050scenario.cc index af97b34a..6344c9a1 100644 --- a/050scenario.cc +++ b/050scenario.cc @@ -200,7 +200,7 @@ void check_memory(const string& s) { check_type(lhs, in); continue; } - int address = to_int(lhs); + int address = to_number(lhs); skip_whitespace_and_comments(in); string _assign; in >> _assign; assert(_assign == "<-"); skip_whitespace_and_comments(in); @@ -223,7 +223,7 @@ void check_memory(const string& s) { void check_type(const string& lhs, istream& in) { reagent x(lhs); if (x.properties.at(0).second.at(0) == "string") { - x.set_value(to_int(x.name)); + x.set_value(to_number(x.name)); skip_whitespace_and_comments(in); string _assign = next_word(in); assert(_assign == "<-"); -- cgit 1.4.1-2-gfad0