diff --git a/MAKE.bat b/MAKE.bat index 6fcc42b..9865a8f 100644 --- a/MAKE.bat +++ b/MAKE.bat @@ -695,7 +695,6 @@ for %%f in ("workbench\plugins\*.c") do ( rem demos if "!demos!"=="yes" ( !echo! 00-ui && !cc! !o! 00-ui.exe demos\00-ui.c !import! !args! || set rc=1 -!echo! 00-loop && !cc! !o! 00-loop.exe demos\00-loop.c !import! !args! || set rc=1 !echo! 00-script && !cc! !o! 00-script.exe demos\00-script.c !import! !args! || set rc=1 !echo! 00-hello && !cc! !o! 00-hello.exe demos\00-hello.c !import! !args! || set rc=1 !echo! 01-sprite && !cc! !o! 01-sprite.exe demos\01-sprite.c !import! !args! || set rc=1 @@ -721,7 +720,11 @@ if "!demos!"=="yes" ( rem lab if "!lab!"=="yes" ( for %%f in ("demos\99-*") do ( - !echo! %%~nf && !cc! !o! %%~nf.exe demos\%%~nf.c !import! !args! || set rc=1 + set limport=!import! + >nul find "V4K_IMPLEMENTATION" demos\%%~nf.c && ( + set limport= + ) + !echo! %%~nf && !cc! !o! %%~nf.exe demos\%%~nf.c !limport! !args! || set rc=1 ) ) diff --git a/bind/lua b/bind/lua index a0125b9..2c458c9 100644 Binary files a/bind/lua and b/bind/lua differ diff --git a/bind/v4k.lua b/bind/v4k.lua index 6acbe37..77d0f34 100644 --- a/bind/v4k.lua +++ b/bind/v4k.lua @@ -2204,25 +2204,25 @@ bool id_valid(uintptr_t id); uint64_t swap64( uint64_t x ); float swap32f(float n); double swap64f(double n); - uint16_t lil16(uint16_t n); - uint32_t lil32(uint32_t n); - uint64_t lil64(uint64_t n); - uint16_t big16(uint16_t n); - uint32_t big32(uint32_t n); - uint64_t big64(uint64_t n); - float lil32f(float n); - double lil64f(double n); - float big32f(float n); - double big64f(double n); + uint16_t lil16(uint16_t n); + uint32_t lil32(uint32_t n); + uint64_t lil64(uint64_t n); + float lil32f(float n); + double lil64f(double n); + uint16_t big16(uint16_t n); + uint32_t big32(uint32_t n); + uint64_t big64(uint64_t n); + float big32f(float n); + double big64f(double n); uint16_t* lil16p(void *p, int sz); - uint16_t* big16p(void *p, int sz); uint32_t* lil32p(void *p, int sz); - uint32_t* big32p(void *p, int sz); uint64_t* lil64p(void *p, int sz); - uint64_t* big64p(void *p, int sz); float * lil32pf(void *p, int sz); - float * big32pf(void *p, int sz); double * lil64pf(void *p, int sz); + uint16_t* big16p(void *p, int sz); + uint32_t* big32p(void *p, int sz); + uint64_t* big64p(void *p, int sz); + float * big32pf(void *p, int sz); double * big64pf(void *p, int sz); typedef uint16_t half; float half_to_float(half value); diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index b80c662..38d41f6 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -16062,32 +16062,31 @@ API int is_little(); API uint16_t swap16( uint16_t x ); API uint32_t swap32( uint32_t x ); API uint64_t swap64( uint64_t x ); - API float swap32f(float n); API double swap64f(double n); -API uint16_t lil16(uint16_t n); -API uint32_t lil32(uint32_t n); -API uint64_t lil64(uint64_t n); -API uint16_t big16(uint16_t n); -API uint32_t big32(uint32_t n); -API uint64_t big64(uint64_t n); +API uint16_t lil16(uint16_t n); // swap16 as lil +API uint32_t lil32(uint32_t n); // swap32 as lil +API uint64_t lil64(uint64_t n); // swap64 as lil +API float lil32f(float n); // swap32 as lil +API double lil64f(double n); // swap64 as lil -API float lil32f(float n); -API double lil64f(double n); -API float big32f(float n); -API double big64f(double n); +API uint16_t big16(uint16_t n); // swap16 as big +API uint32_t big32(uint32_t n); // swap32 as big +API uint64_t big64(uint64_t n); // swap64 as big +API float big32f(float n); // swap32 as big +API double big64f(double n); // swap64 as big API uint16_t* lil16p(void *p, int sz); -API uint16_t* big16p(void *p, int sz); API uint32_t* lil32p(void *p, int sz); -API uint32_t* big32p(void *p, int sz); API uint64_t* lil64p(void *p, int sz); -API uint64_t* big64p(void *p, int sz); - API float * lil32pf(void *p, int sz); -API float * big32pf(void *p, int sz); API double * lil64pf(void *p, int sz); + +API uint16_t* big16p(void *p, int sz); +API uint32_t* big32p(void *p, int sz); +API uint64_t* big64p(void *p, int sz); +API float * big32pf(void *p, int sz); API double * big64pf(void *p, int sz); #if is(cl) @@ -17792,13 +17791,6 @@ API void trap_on_quit(int signal); // helper util API void trap_on_abort(int signal); // helper util API void trap_on_debug(int signal); // helper util -#define hton16 big16 -#define ntoh16 big16 -#define hton32 big32 -#define ntoh32 big32 -#define hton64 big64 -#define ntoh64 big64 - #define PANIC(...) PANIC(va(__VA_ARGS__), __FILE__, __LINE__) // die() ? API int (PANIC)(const char *error, const char *file, int line); diff --git a/engine/split/v4k_pack.h b/engine/split/v4k_pack.h index bc1de1c..6529312 100644 --- a/engine/split/v4k_pack.h +++ b/engine/split/v4k_pack.h @@ -7,32 +7,31 @@ API int is_little(); API uint16_t swap16( uint16_t x ); API uint32_t swap32( uint32_t x ); API uint64_t swap64( uint64_t x ); - API float swap32f(float n); API double swap64f(double n); -API uint16_t lil16(uint16_t n); -API uint32_t lil32(uint32_t n); -API uint64_t lil64(uint64_t n); -API uint16_t big16(uint16_t n); -API uint32_t big32(uint32_t n); -API uint64_t big64(uint64_t n); +API uint16_t lil16(uint16_t n); // swap16 as lil +API uint32_t lil32(uint32_t n); // swap32 as lil +API uint64_t lil64(uint64_t n); // swap64 as lil +API float lil32f(float n); // swap32 as lil +API double lil64f(double n); // swap64 as lil -API float lil32f(float n); -API double lil64f(double n); -API float big32f(float n); -API double big64f(double n); +API uint16_t big16(uint16_t n); // swap16 as big +API uint32_t big32(uint32_t n); // swap32 as big +API uint64_t big64(uint64_t n); // swap64 as big +API float big32f(float n); // swap32 as big +API double big64f(double n); // swap64 as big API uint16_t* lil16p(void *p, int sz); -API uint16_t* big16p(void *p, int sz); API uint32_t* lil32p(void *p, int sz); -API uint32_t* big32p(void *p, int sz); API uint64_t* lil64p(void *p, int sz); -API uint64_t* big64p(void *p, int sz); - API float * lil32pf(void *p, int sz); -API float * big32pf(void *p, int sz); API double * lil64pf(void *p, int sz); + +API uint16_t* big16p(void *p, int sz); +API uint32_t* big32p(void *p, int sz); +API uint64_t* big64p(void *p, int sz); +API float * big32pf(void *p, int sz); API double * big64pf(void *p, int sz); #if is(cl) diff --git a/engine/split/v4k_system.h b/engine/split/v4k_system.h index 0762890..20876c8 100644 --- a/engine/split/v4k_system.h +++ b/engine/split/v4k_system.h @@ -55,13 +55,6 @@ API void trap_on_quit(int signal); // helper util API void trap_on_abort(int signal); // helper util API void trap_on_debug(int signal); // helper util -#define hton16 big16 -#define ntoh16 big16 -#define hton32 big32 -#define ntoh32 big32 -#define hton64 big64 -#define ntoh64 big64 - #define PANIC(...) PANIC(va(__VA_ARGS__), __FILE__, __LINE__) // die() ? API int (PANIC)(const char *error, const char *file, int line); diff --git a/engine/v4k.h b/engine/v4k.h index c5714db..fb547e9 100644 --- a/engine/v4k.h +++ b/engine/v4k.h @@ -2129,32 +2129,31 @@ API int is_little(); API uint16_t swap16( uint16_t x ); API uint32_t swap32( uint32_t x ); API uint64_t swap64( uint64_t x ); - API float swap32f(float n); API double swap64f(double n); -API uint16_t lil16(uint16_t n); -API uint32_t lil32(uint32_t n); -API uint64_t lil64(uint64_t n); -API uint16_t big16(uint16_t n); -API uint32_t big32(uint32_t n); -API uint64_t big64(uint64_t n); +API uint16_t lil16(uint16_t n); // swap16 as lil +API uint32_t lil32(uint32_t n); // swap32 as lil +API uint64_t lil64(uint64_t n); // swap64 as lil +API float lil32f(float n); // swap32 as lil +API double lil64f(double n); // swap64 as lil -API float lil32f(float n); -API double lil64f(double n); -API float big32f(float n); -API double big64f(double n); +API uint16_t big16(uint16_t n); // swap16 as big +API uint32_t big32(uint32_t n); // swap32 as big +API uint64_t big64(uint64_t n); // swap64 as big +API float big32f(float n); // swap32 as big +API double big64f(double n); // swap64 as big API uint16_t* lil16p(void *p, int sz); -API uint16_t* big16p(void *p, int sz); API uint32_t* lil32p(void *p, int sz); -API uint32_t* big32p(void *p, int sz); API uint64_t* lil64p(void *p, int sz); -API uint64_t* big64p(void *p, int sz); - API float * lil32pf(void *p, int sz); -API float * big32pf(void *p, int sz); API double * lil64pf(void *p, int sz); + +API uint16_t* big16p(void *p, int sz); +API uint32_t* big32p(void *p, int sz); +API uint64_t* big64p(void *p, int sz); +API float * big32pf(void *p, int sz); API double * big64pf(void *p, int sz); #if is(cl) @@ -3859,13 +3858,6 @@ API void trap_on_quit(int signal); // helper util API void trap_on_abort(int signal); // helper util API void trap_on_debug(int signal); // helper util -#define hton16 big16 -#define ntoh16 big16 -#define hton32 big32 -#define ntoh32 big32 -#define hton64 big64 -#define ntoh64 big64 - #define PANIC(...) PANIC(va(__VA_ARGS__), __FILE__, __LINE__) // die() ? API int (PANIC)(const char *error, const char *file, int line);