@@ -7,6 +7,7 @@ | |||||
#endif | #endif | ||||
#if defined IZ_UNIX | #if defined IZ_UNIX | ||||
typedef unsigned long size_t; | |||||
typedef size_t rsize_t; | typedef size_t rsize_t; | ||||
typedef int errno_t; | typedef int errno_t; | ||||
#endif | #endif | ||||
@@ -3,7 +3,7 @@ | |||||
void IZ_AppHandleNetworkingInboundBinaryEvents(struct IZ_App* app, void* binary_raw, size_t len) { | void IZ_AppHandleNetworkingInboundBinaryEvents(struct IZ_App* app, void* binary_raw, size_t len) { | ||||
u8* binary = binary_raw; | u8* binary = binary_raw; | ||||
size_t i; | size_t i; | ||||
printf("%llu: Binary", IZ_AppGetTicks(app)); | |||||
printf("%lu: Binary", IZ_AppGetTicks(app)); | |||||
for (i = 0; i < len; i += 1) { | for (i = 0; i < len; i += 1) { | ||||
printf("%c%02x", i == 0 ? '(' : ' ', binary[i]); | printf("%c%02x", i == 0 ? '(' : ' ', binary[i]); | ||||
} | } | ||||
@@ -11,7 +11,7 @@ void IZ_AppHandleNetworkingInboundBinaryEvents(struct IZ_App* app, void* binary_ | |||||
} | } | ||||
void IZ_AppHandleNetworkingInboundTextEvents(struct IZ_App* app, const char* text, size_t len) { | void IZ_AppHandleNetworkingInboundTextEvents(struct IZ_App* app, const char* text, size_t len) { | ||||
printf("%llu: String(%s)\n", IZ_AppGetTicks(app), text); | |||||
printf("%lu: String(%s)\n", IZ_AppGetTicks(app), text); | |||||
} | } | ||||
void IZ_AppHandleOutboundNetworking(struct IZ_App* app) { | void IZ_AppHandleOutboundNetworking(struct IZ_App* app) { | ||||
@@ -57,7 +57,7 @@ void IZ_ListPrintNodeValues(IZ_List* list) { | |||||
u64 index = 0; | u64 index = 0; | ||||
printf("\nlist@%p\n", list); | printf("\nlist@%p\n", list); | ||||
do { | do { | ||||
printf(" %llu@%p:%u\n", index, *list->iterator, *((unsigned int*)(*list->iterator)->value)); | |||||
printf(" %lu@%p:%u\n", index, *list->iterator, *((unsigned int*)(*list->iterator)->value)); | |||||
index += 1; | index += 1; | ||||
list->iterator = &(*list->iterator)->next; | list->iterator = &(*list->iterator)->next; | ||||
} while (*list->iterator); | } while (*list->iterator); | ||||
@@ -26,7 +26,7 @@ IZ_PoolItem* IZ_PoolAllocate(IZ_Pool* pool, IZ_PoolAllocationArgs args) { | |||||
// TODO deallocate memory based from priority | // TODO deallocate memory based from priority | ||||
} | } | ||||
void* pointer = &pool->memory[pool->next_address]; | |||||
void* pointer = &((u8*) pool->memory)[pool->next_address]; | |||||
IZ_ListNode* new_item; | IZ_ListNode* new_item; | ||||
IZ_ListAppendNode(&pool->items, &(IZ_PoolItem) { | IZ_ListAppendNode(&pool->items, &(IZ_PoolItem) { | ||||
.pointer = pointer, | .pointer = pointer, | ||||
@@ -21,6 +21,8 @@ | |||||
#include <SDL_syswm.h> | #include <SDL_syswm.h> | ||||
#elif defined IZ_MACOS | #elif defined IZ_MACOS | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#elif defined IZ_UNIX | |||||
#include <unistd.h> | |||||
#endif | #endif | ||||
#include "../compat/IZ_compat.h" | #include "../compat/IZ_compat.h" | ||||
@@ -7,6 +7,8 @@ | |||||
#include <SDL_syswm.h> | #include <SDL_syswm.h> | ||||
#elif defined IZ_MACOS | #elif defined IZ_MACOS | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#elif defined IZ_UNIX | |||||
#include "../../src/packages/compat/IZ_compat.h" | |||||
#endif | #endif | ||||
errno_t IZ_memcpy(void*, rsize_t, const void*, rsize_t); | errno_t IZ_memcpy(void*, rsize_t, const void*, rsize_t); | ||||
@@ -40,7 +40,7 @@ unsigned int IZ_TimerElapsedRaw() { | |||||
* @sa IZ_TimerElapsedRaw() | * @sa IZ_TimerElapsedRaw() | ||||
*/ | */ | ||||
char* IZ_TimerElapsed() { | char* IZ_TimerElapsed() { | ||||
static char buffer[32]; | |||||
static char buffer[48]; | |||||
struct timespec t; | struct timespec t; | ||||
clock_gettime(CLOCK_MONOTONIC, &t); | clock_gettime(CLOCK_MONOTONIC, &t); | ||||
unsigned int seconds = t.tv_sec - IZ_TIMER_START_TIMESTAMP; | unsigned int seconds = t.tv_sec - IZ_TIMER_START_TIMESTAMP; | ||||
@@ -58,7 +58,7 @@ char* IZ_TimerElapsed() { | |||||
char* IZ_TimerNow() { | char* IZ_TimerNow() { | ||||
struct timespec t; | struct timespec t; | ||||
clock_gettime(CLOCK_REALTIME, &t); | clock_gettime(CLOCK_REALTIME, &t); | ||||
static char buffer[32]; | |||||
static char buffer[48]; | |||||
unsigned int seconds = t.tv_sec; | unsigned int seconds = t.tv_sec; | ||||
unsigned int milliseconds = t.tv_nsec / 1000000; | unsigned int milliseconds = t.tv_nsec / 1000000; | ||||
static char formatted[32]; | static char formatted[32]; | ||||
@@ -75,7 +75,7 @@ char* IZ_TimerNow() { | |||||
char* IZ_TimerNowPathSafe() { | char* IZ_TimerNowPathSafe() { | ||||
struct timespec t; | struct timespec t; | ||||
clock_gettime(CLOCK_REALTIME, &t); | clock_gettime(CLOCK_REALTIME, &t); | ||||
static char buffer[32]; | |||||
static char buffer[48]; | |||||
unsigned int seconds = t.tv_sec; | unsigned int seconds = t.tv_sec; | ||||
unsigned int milliseconds = t.tv_nsec / 1000000; | unsigned int milliseconds = t.tv_nsec / 1000000; | ||||
static char formatted[32]; | static char formatted[32]; | ||||