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 "util.h"
/**
* @brief main

View File

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

View File

@@ -1,5 +1,6 @@
#ifndef UTIL_H
#define UTIL_H
#include <stdio.h>
#include <stdlib.h>
@@ -14,4 +15,5 @@ static inline void die(int code, const char* message){
fprintf(stderr, "%s\n", message);
exit(code);
}
#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"
/**
@@ -39,7 +46,7 @@ void vm_execute(int code[], int ip, int datasize, unsigned long length){
while(ip < length){
int opcode = code[ip];
ip++;
if(DEBUG){
if(DEBUG_ON){
if(ip+2 != length)
disassemble(sp, fp, ip, opcode, ins, code, stack);
}

View File

@@ -1,21 +1,12 @@
#ifndef 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 TRUE 1
#define FALSE 0
#ifdef DEBUG_ON
#define DEBUG TRUE
#else
#define DEBUG FALSE
#ifndef DEBUG_ON
#define DEBUG_ON FALSE
#endif
typedef struct{