mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Removed bytecodeSize parameter
This commit is contained in:
@@ -289,7 +289,7 @@ static void process(Toy_VM* vm) {
|
||||
}
|
||||
|
||||
//exposed functions
|
||||
void Toy_bindVM(Toy_VM* vm, unsigned char* bytecode, unsigned int bytecodeSize) {
|
||||
void Toy_bindVM(Toy_VM* vm, unsigned char* bytecode) {
|
||||
if (bytecode[0] != TOY_VERSION_MAJOR || bytecode[1] > TOY_VERSION_MINOR) {
|
||||
fprintf(stderr, TOY_CC_ERROR "ERROR: Wrong bytecode version found: expected %d.%d.%d found %d.%d.%d, exiting\n" TOY_CC_RESET, TOY_VERSION_MAJOR, TOY_VERSION_MINOR, TOY_VERSION_PATCH, bytecode[0], bytecode[1], bytecode[2]);
|
||||
exit(-1);
|
||||
@@ -314,7 +314,6 @@ void Toy_bindVM(Toy_VM* vm, unsigned char* bytecode, unsigned int bytecodeSize)
|
||||
|
||||
//cache these
|
||||
vm->bc = bytecode;
|
||||
vm->bcSize = bytecodeSize;
|
||||
}
|
||||
|
||||
void Toy_bindVMToRoutine(Toy_VM* vm, unsigned char* routine) {
|
||||
@@ -376,7 +375,6 @@ void Toy_freeVM(Toy_VM* vm) {
|
||||
|
||||
void Toy_resetVM(Toy_VM* vm) {
|
||||
vm->bc = NULL;
|
||||
vm->bcSize = 0;
|
||||
|
||||
vm->routine = NULL;
|
||||
vm->routineSize = 0;
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
typedef struct Toy_VM {
|
||||
//hold the raw bytecode
|
||||
unsigned char* bc;
|
||||
unsigned int bcSize;
|
||||
|
||||
//raw instructions to be executed
|
||||
unsigned char* routine;
|
||||
@@ -33,7 +32,7 @@ typedef struct Toy_VM {
|
||||
Toy_Stack* stack;
|
||||
} Toy_VM;
|
||||
|
||||
TOY_API void Toy_bindVM(Toy_VM* vm, unsigned char* bytecode, unsigned int bytecodeSize); //process the version data
|
||||
TOY_API void Toy_bindVM(Toy_VM* vm, unsigned char* bytecode); //process the version data
|
||||
TOY_API void Toy_bindVMToRoutine(Toy_VM* vm, unsigned char* routine); //process the routine only
|
||||
|
||||
TOY_API void Toy_runVM(Toy_VM* vm);
|
||||
|
||||
Reference in New Issue
Block a user