Fixed subroutine bugs
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
{}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user