diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-12 13:10:23 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-12 17:00:19 -0700 |
commit | 3663ca6c2d4c42c4a7bf6af4b2edf71dd8d10dd7 (patch) | |
tree | 330d04974b9d30bff1b16adc8d14a3d9fd77643d /070display.cc | |
parent | a70d593dfb8eea87a898a69adeb9689a21199edf (diff) | |
download | mu-3663ca6c2d4c42c4a7bf6af4b2edf71dd8d10dd7.tar.gz |
1356 - snapshot #2: floating point support
I added one test to check that divide can return a float, then hacked at the rippling failures across the entire entire codebase until all tests pass. Now I need to look at the changes I made and see if there's a system to them, identify other places that I missed, and figure out the best way to cover all cases. I also need to show real rather than encoded values in the traces, but I can't use value() inside reagent methods because of the name clash with the member variable. So let's take a snapshot before we attempt any refactoring. This was non-trivial to get right. Even if I convince myself that I've gotten it right, I might back this all out if I can't easily *persuade others* that I've gotten it right.
Diffstat (limited to '070display.cc')
-rw-r--r-- | 070display.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/070display.cc b/070display.cc index 8a782f87..7c850ef8 100644 --- a/070display.cc +++ b/070display.cc @@ -70,7 +70,7 @@ case PRINT_CHARACTER_TO_DISPLAY: { size_t height = (h >= 0) ? h : 0; size_t width = (w >= 0) ? w : 0; assert(ingredients.at(0).size() == 1); // scalar - long long int c = ingredients.at(0).at(0); + long long int c = value(ingredients.at(0).at(0)); // unicode code-point will probably always be a positive integer if (c == '\n' || c == '\r') { if (Display_row < height-1) { Display_column = 0; @@ -117,9 +117,9 @@ Recipe_number["move-cursor-on-display"] = MOVE_CURSOR_ON_DISPLAY; :(before "End Primitive Recipe Implementations") case MOVE_CURSOR_ON_DISPLAY: { assert(ingredients.at(0).size() == 1); // scalar - Display_row = ingredients.at(0).at(0); + Display_row = ingredients.at(0).at(0); // screen coordinate will always be a non-negative integer assert(ingredients.at(1).size() == 1); // scalar - Display_column = ingredients.at(1).at(0); + Display_column = ingredients.at(1).at(0); // screen coordinate will always be a non-negative integer tb_set_cursor(Display_column, Display_row); tb_present(); break; |