Some light header pruning
This commit is contained in:
@@ -54,7 +54,6 @@ void darr_append_bytes(darr_t *darr, byte_t *bytes, size_t n)
|
|||||||
byte_t *darr_at(darr_t *darr, size_t index)
|
byte_t *darr_at(darr_t *darr, size_t index)
|
||||||
{
|
{
|
||||||
if (index >= darr->used)
|
if (index >= darr->used)
|
||||||
// TODO: Error (index is out of bounds)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
return darr->data + index;
|
return darr->data + index;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,7 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <math.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "./runtime.h"
|
#include "./runtime.h"
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,8 @@
|
|||||||
#ifndef RUNTIME_H
|
#ifndef RUNTIME_H
|
||||||
#define RUNTIME_H
|
#define RUNTIME_H
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <lib/inst.h>
|
#include <lib/inst.h>
|
||||||
|
|
||||||
#include "./runtime.h"
|
|
||||||
#include "./struct.h"
|
#include "./struct.h"
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
* Description: Virtual machine data structures and some helpers
|
* Description: Virtual machine data structures and some helpers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "./struct.h"
|
#include "./struct.h"
|
||||||
@@ -118,7 +117,7 @@ void vm_print_registers(vm_t *vm, FILE *fp)
|
|||||||
vm->registers.available / HWORD_SIZE,
|
vm->registers.available / HWORD_SIZE,
|
||||||
vm->registers.available / WORD_SIZE);
|
vm->registers.available / WORD_SIZE);
|
||||||
fprintf(fp, "Registers.reg = [");
|
fprintf(fp, "Registers.reg = [");
|
||||||
for (size_t i = 0; i < ceil((long double)reg.used / WORD_SIZE); ++i)
|
for (size_t i = 0; i < (reg.used / WORD_SIZE); ++i)
|
||||||
{
|
{
|
||||||
fprintf(fp, "{%lu:%lX}", i, VM_NTH_REGISTER(reg, i));
|
fprintf(fp, "{%lu:%lX}", i, VM_NTH_REGISTER(reg, i));
|
||||||
if (i != reg.used - 1)
|
if (i != reg.used - 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user