sprintf_malloc

This commit is contained in:
2024-11-16 19:36:17 +05:00
parent b8296a45a7
commit 83172df776
7 changed files with 41 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
#include "impl_macros.h"
NULLABLE(FILE* fileFromN(VM* vm, size_t pos, u32 file_n)){
FILE* NULLABLE(fileFromN)(VM* vm, size_t pos, u32 file_n){
FILE* f = NULL;
switch(file_n){
case 0: f = stdin; break;

View File

@@ -16,7 +16,7 @@ const Instruction instructions[] = {
};
const size_t instructions_count = sizeof(instructions)/sizeof(instructions[0]);
NULLABLE(const Instruction* Instruction_getFromOpcode(u8 opcode)){
const Instruction* NULLABLE(Instruction_getFromOpcode)(u8 opcode){
if(opcode >= instructions_count)
return NULL;

View File

@@ -18,7 +18,7 @@ typedef struct Instruction {
/// @brief get instruction info from table
/// @param opcode any byte
/// @return ptr to struct or NULL
NULLABLE(const Instruction* Instruction_getFromOpcode(u8 opcode));
const Instruction* NULLABLE(Instruction_getFromOpcode)(u8 opcode);
i32 NOP_impl(VM* vm, size_t pos);
i32 PUSH_impl(VM* vm, size_t pos);