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 /039wait.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 '039wait.cc')
-rw-r--r-- | 039wait.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/039wait.cc b/039wait.cc index 82354a53..a674ad25 100644 --- a/039wait.cc +++ b/039wait.cc @@ -24,7 +24,7 @@ WAITING, :(before "End routine Fields") // only if state == WAITING index_t waiting_on_location; -int old_value_of_waiting_location; +double old_value_of_waiting_location; :(before "End routine Constructor") waiting_on_location = old_value_of_waiting_location = 0; @@ -39,9 +39,9 @@ case WAIT_FOR_LOCATION: { reagent loc = canonize(current_instruction().ingredients.at(0)); Current_routine->state = WAITING; Current_routine->waiting_on_location = loc.value; - Current_routine->old_value_of_waiting_location = Memory[loc.value]; - trace("run") << "waiting for location " << loc.value << " to change from " << Memory[loc.value]; -//? trace("schedule") << Current_routine->id << ": waiting for location " << loc.value << " to change from " << Memory[loc.value]; //? 2 + Current_routine->old_value_of_waiting_location = value(Memory[loc.value]); + trace("run") << "waiting for location " << loc.value << " to change from " << value(Memory[loc.value]); +//? trace("schedule") << Current_routine->id << ": waiting for location " << loc.value << " to change from " << value(Memory[loc.value]); //? 2 break; } @@ -54,9 +54,9 @@ for (index_t i = 0; i < Routines.size(); ++i) { //? trace("schedule") << "waiting on location: " << Routines.at(i)->waiting_on_location; //? 1 //? if (Routines.at(i)->waiting_on_location) //? 2 //? trace("schedule") << "checking routine " << Routines.at(i)->id << " waiting on location " //? 2 -//? << Routines.at(i)->waiting_on_location << ": " << Memory[Routines.at(i)->waiting_on_location] << " vs " << Routines.at(i)->old_value_of_waiting_location; //? 2 +//? << Routines.at(i)->waiting_on_location << ": " << value(Memory[Routines.at(i)->waiting_on_location]) << " vs " << Routines.at(i)->old_value_of_waiting_location; //? 2 if (Routines.at(i)->waiting_on_location && - Memory[Routines.at(i)->waiting_on_location] != Routines.at(i)->old_value_of_waiting_location) { + value(Memory[Routines.at(i)->waiting_on_location]) != Routines.at(i)->old_value_of_waiting_location) { trace("schedule") << "waking up routine\n"; Routines.at(i)->state = RUNNING; Routines.at(i)->waiting_on_location = Routines.at(i)->old_value_of_waiting_location = 0; |