Cleaned up includes

This commit is contained in:
Veit Heller
2015-02-08 15:59:02 +01:00
parent 1de25417f4
commit 647e890e75
5 changed files with 15 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
#include "vm.h" #include "vm.h"
#include "util.h"
/** /**
* @brief main * @brief main

View File

@@ -1,5 +1,6 @@
#ifndef OPCODE_H #ifndef OPCODE_H
#define OPCODE_H #define OPCODE_H
enum { enum {
/*Addition operation*/ /*Addition operation*/
IADD = 1, IADD = 1,

View File

@@ -1,5 +1,6 @@
#ifndef UTIL_H #ifndef UTIL_H
#define UTIL_H #define UTIL_H
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -14,4 +15,5 @@ static inline void die(int code, const char* message){
fprintf(stderr, "%s\n", message); fprintf(stderr, "%s\n", message);
exit(code); exit(code);
} }
#endif #endif

View File

@@ -1,3 +1,10 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <alloca.h>
#include "util.h"
#include "opcode.h"
#include "vm.h" #include "vm.h"
/** /**
@@ -39,7 +46,7 @@ void vm_execute(int code[], int ip, int datasize, unsigned long length){
while(ip < length){ while(ip < length){
int opcode = code[ip]; int opcode = code[ip];
ip++; ip++;
if(DEBUG){ if(DEBUG_ON){
if(ip+2 != length) if(ip+2 != length)
disassemble(sp, fp, ip, opcode, ins, code, stack); disassemble(sp, fp, ip, opcode, ins, code, stack);
} }

View File

@@ -1,21 +1,12 @@
#ifndef VM_H #ifndef VM_H
#define VM_H #define VM_H
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <alloca.h>
#include "util.h"
#include "opcode.h"
#define MAX_SIZE 4096 #define MAX_SIZE 4096
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
#ifdef DEBUG_ON
#define DEBUG TRUE #ifndef DEBUG_ON
#else #define DEBUG_ON FALSE
#define DEBUG FALSE
#endif #endif
typedef struct{ typedef struct{