Fixed subroutine bugs

This commit is contained in:
Samuel D. Crow
2021-04-16 18:56:10 -05:00
parent ca08646b93
commit 9ddac1afd6
8 changed files with 64 additions and 41 deletions

View File

@@ -7,16 +7,16 @@
struct subroutine *callStack=nullptr;
subroutine::subroutine(enum STATES r)
subroutine::subroutine(unsigned int r)
{
this->ret=r;
this->called=callStack;
}
enum STATES subroutine::close()
unsigned int subroutine::close()
{
if (callStack==nullptr) return STACK_UNDERFLOW_ERROR;
enum STATES r=callStack->ret;
unsigned int r=callStack->ret;
struct subroutine *l=callStack->called;
delete callStack;
callStack=l;

View File

@@ -21,11 +21,11 @@ enum STATES:unsigned int
class subroutine
{
struct subroutine *called;
enum STATES ret;
unsigned int ret;
public:
static enum STATES close();
subroutine(enum STATES r);
static unsigned int close();
subroutine(unsigned int r);
virtual ~subroutine()
{}
};