about summary refs log tree commit diff stats
path: root/063wait.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-03-13 20:26:47 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-03-13 20:26:47 -0700
commitb24eb4766ad12eceaafa2ee0d620e070e21a3293 (patch)
treed7efc84bce7cf75fa18792d02bceb15480690a2d /063wait.cc
parent95b2a140094697dec176167154f9b3b31c2ef70f (diff)
downloadmu-b24eb4766ad12eceaafa2ee0d620e070e21a3293.tar.gz
2773 - switch to 'int'
This should eradicate the issue of 2771.
Diffstat (limited to '063wait.cc')
-rw-r--r--063wait.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/063wait.cc b/063wait.cc
index 2d0e2d8d..072a73ca 100644
--- a/063wait.cc
+++ b/063wait.cc
@@ -23,7 +23,7 @@ def f2 [
 WAITING,
 :(before "End routine Fields")
 // only if state == WAITING
-long long int waiting_on_location;
+int waiting_on_location;
 int old_value_of_waiting_location;
 :(before "End routine Constructor")
 waiting_on_location = old_value_of_waiting_location = 0;
@@ -52,7 +52,7 @@ case WAIT_FOR_LOCATION: {
 //: scheduler tweak to get routines out of that state
 
 :(before "End Scheduler State Transitions")
-for (long long int i = 0; i < SIZE(Routines); ++i) {
+for (int i = 0; i < SIZE(Routines); ++i) {
   if (Routines.at(i)->state != WAITING) continue;
   if (Routines.at(i)->waiting_on_location &&
       get_or_insert(Memory, Routines.at(i)->waiting_on_location) != Routines.at(i)->old_value_of_waiting_location) {
@@ -85,7 +85,7 @@ def f2 [
 
 :(before "End routine Fields")
 // only if state == WAITING
-long long int waiting_on_routine;
+int waiting_on_routine;
 :(before "End routine Constructor")
 waiting_on_routine = 0;
 
@@ -121,12 +121,12 @@ case WAIT_FOR_ROUTINE: {
 // Wake up any routines waiting for other routines to go to sleep.
 // Important: this must come after the scheduler loop above giving routines
 // waiting for locations to change a chance to wake up.
-for (long long int i = 0; i < SIZE(Routines); ++i) {
+for (int i = 0; i < SIZE(Routines); ++i) {
   if (Routines.at(i)->state != WAITING) continue;
   if (!Routines.at(i)->waiting_on_routine) continue;
-  long long int id = Routines.at(i)->waiting_on_routine;
+  int id = Routines.at(i)->waiting_on_routine;
   assert(id != Routines.at(i)->id);  // routine can't wait on itself
-  for (long long int j = 0; j < SIZE(Routines); ++j) {
+  for (int j = 0; j < SIZE(Routines); ++j) {
     if (Routines.at(j)->id == id && Routines.at(j)->state != RUNNING) {
       trace(9999, "schedule") << "waking up routine " << Routines.at(i)->id << end();
       Routines.at(i)->state = RUNNING;
@@ -145,7 +145,7 @@ case SWITCH: {
 }
 :(before "End Primitive Recipe Implementations")
 case SWITCH: {
-  long long int id = some_other_running_routine();
+  int id = some_other_running_routine();
   if (id) {
     assert(id != Current_routine->id);
     Current_routine->state = WAITING;
@@ -155,8 +155,8 @@ case SWITCH: {
 }
 
 :(code)
-long long int some_other_running_routine() {
-  for (long long int i = 0; i < SIZE(Routines); ++i) {
+int some_other_running_routine() {
+  for (int i = 0; i < SIZE(Routines); ++i) {
     if (i == Current_routine_index) continue;
     assert(Routines.at(i) != Current_routine);
     assert(Routines.at(i)->id != Current_routine->id);