diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-01-12 22:10:38 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-01-12 22:10:38 -0800 |
commit | 802283e450b7a8b14b1730358ecb9473ef074147 (patch) | |
tree | ede5bef292934514c9cf149636760888badedbe0 /056recipe_header.cc | |
parent | 0fac1f87339709e9e3ef8d2df2dbd88ba8c8d706 (diff) | |
download | mu-802283e450b7a8b14b1730358ecb9473ef074147.tar.gz |
2559 - stop using 'next-ingredient' explicitly
I still need it in some situations because I have no way to set a non-zero default for an optional ingredient. Open question..
Diffstat (limited to '056recipe_header.cc')
-rw-r--r-- | 056recipe_header.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/056recipe_header.cc b/056recipe_header.cc index a438054c..6797cab8 100644 --- a/056recipe_header.cc +++ b/056recipe_header.cc @@ -168,9 +168,11 @@ case NEXT_INGREDIENT_WITHOUT_TYPECHECKING: { ++current_call().next_ingredient_to_process; } else { - raise_error << maybe(current_recipe_name()) << "no ingredient to save in " << current_instruction().products.at(0).original_string << '\n' << end(); products.resize(2); - products.at(0).push_back(0); + // pad the first product with sufficient zeros to match its type + long long int size = size_of(current_instruction().products.at(0)); + for (long long int i = 0; i < size; ++i) + products.at(0).push_back(0); products.at(1).push_back(0); } break; |