Minor tweak

This commit is contained in:
2023-02-18 12:15:19 +00:00
parent 3acbd7447a
commit 49f240ea07
8 changed files with 8 additions and 8 deletions

View File

@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct Toy_Runner {
Toy_Interpreter interpreter;

View File

@@ -2,9 +2,10 @@
#include "toy_memory.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
static int nativeClock(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments) {
//no arguments

View File

@@ -4,6 +4,7 @@
#include "toy_literal.h"
#include <stdio.h>
#include <string.h>
//static math utils, copied from the interpreter
static Toy_Literal addition(Toy_Interpreter* interpreter, Toy_Literal lhs, Toy_Literal rhs) {

View File

@@ -9,6 +9,7 @@
#include "toy_console_colors.h"
#include <stdio.h>
#include <string.h>
void Toy_initCompiler(Toy_Compiler* compiler) {
Toy_initLiteralArray(&compiler->literalCache);

View File

@@ -8,6 +8,7 @@
#include "toy_console_colors.h"
#include <stdio.h>
#include <string.h>
//hash util functions
static unsigned int hashString(const char* string, int length) {

View File

@@ -12,8 +12,6 @@ typedef int (*Toy_NativeFn)(struct Toy_Interpreter* interpreter, struct Toy_Lite
typedef int (*Toy_HookFn)(struct Toy_Interpreter* interpreter, struct Toy_Literal identifier, struct Toy_Literal alias);
typedef void (*Toy_PrintFn)(const char*);
#include <string.h>
typedef enum {
TOY_LITERAL_NULL,
TOY_LITERAL_BOOLEAN,

View File

@@ -1,7 +1,5 @@
#include "toy_refstring.h"
#include <string.h>
//memory allocation
extern void* Toy_private_defaultMemoryAllocator(void* pointer, size_t oldSize, size_t newSize);
static Toy_RefStringAllocatorFn allocate = Toy_private_defaultMemoryAllocator;

View File

@@ -1,10 +1,9 @@
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include "toy_common.h"
#include <string.h>
//memory allocation hook
typedef void* (*Toy_RefStringAllocatorFn)(void* pointer, size_t oldSize, size_t newSize);
TOY_API void Toy_setRefStringAllocatorFn(Toy_RefStringAllocatorFn);