Commit Graph

39 Commits

Author SHA1 Message Date
dd15b42b44 Add Unicode tests, fix whitespace, fix docs
Added Unicode tests (and fixed few bugs), changed whitespace script to
proccess markdown files, added new guide to showcase how to work with
Unicode.
2025-04-06 14:11:38 +03:00
6aee5a83aa Refactor string functions, add unicode support
Refactored existing functions. Added Unicode support and UTF-8, UTF-16,
and UTF-32 encoding/decoding.
2025-04-05 13:56:00 +03:00
f9ebeabb18 Refactor strings (avoid using dynamically allocated memory)
Refactored strings functions to make them use supplied string
instead of allocating new ones.

Additionally, split String/Int.c into several files to avoid define
mess that was present before.
2025-04-05 13:56:00 +03:00
9025c3d945 Fix bug related to char being signed or unsigned on different platforms 2025-04-05 13:56:00 +03:00
4b2e3da567 Add int tests, fix bugs, add docs
Added tests for string to/from integers and added documentation.
While adding tests caught few bugs and shortcomings (now everything
works as expected)
2025-04-05 13:56:00 +03:00
b7fc93a490 Refactor string to/from double conversion, fix bugs, use bigger ints
Finally, fixed bugs in bigint implementation as well as switched to
32/64 bit integer implementation (gained 2x speed up in some cases).

Additionally, I decided to split Float.c into Float.c and BInt.h for
better readability.
2025-04-05 13:56:00 +03:00
b943135d71 Fix whitespace, add asserts, add string to double function, fix bugs
Finally added StringToDouble function (should work for the majority of
the cases). Additionally fixed bug in StringFromDouble related to
incorrect rounding and added asserts (should add more asserts in the
following commits).

Also implemented some optimizations from Burger and Dybvig paper.
2025-04-05 13:56:00 +03:00
82bea0ebf8 Refactor bigints, add int and float conv functions
Added functions to convert from/to ints/floats. Floats are converted
according to basic Steele&White algorithm (without speedup).
2025-04-05 13:56:00 +03:00
69515af77f Fix styling issues, rename scripts 2025-04-05 13:56:00 +03:00
8009498331 Fix bug in setting precomputed power-of-10 2025-04-05 13:56:00 +03:00
fc3d4e22d5 Add initial bigint implementation for the fmt library 2025-04-05 13:56:00 +03:00
0683389d7b Improved build system and POSIX compatibility
Fixed few bugs related to build system and POSIX compatabilty.
2025-04-05 13:55:06 +03:00
83a4e723bf Fix build error on Linux/POSIX 2025-03-03 17:43:13 +03:00
fe2f39d489 Move include from BH/Thread.h to impls' Thread.h 2025-03-03 10:25:45 +03:00
d403d41f2c Add initial implementation of threads/mutexes/semaphores/cvs/spinlocks
Added initial implementation (or wrapper) of the threading library.
It's rather basic, but should work for most of the tasks.

Unfortunately, spinlock implementation relies on GCC/Clang compiler
built-ins (or in-worst-case-scenario on Win32 - InterlockExchange).
In the future, I should revisit this code and fix/reimplement some stuff
(or add support for Windows XP).
2025-03-02 23:18:23 +03:00
2ca6a3e316 Fix BH_INT2PTR, add generic callback definition 2025-03-02 23:12:43 +03:00
6a57851227 Fix documentation about implemented features 2025-02-28 22:49:29 +03:00
a2d0913c79 Add utils for working with endianness, more documentation, refactor CMake
Decided to update the docs, as well as adding few new features and small
refactoring.
2025-02-28 21:44:22 +03:00
93033ebc99 Remove main.c, rename variable in CMakeLists.txt 2025-02-28 10:28:17 +03:00
e1c62d4f6b Move platform-dependent code into it's own directory 2025-02-28 10:13:51 +03:00
b0fbfcd69e Split Math.c into smaller files
Friend said that Math.c was too big and complicated.
2025-02-28 10:08:05 +03:00
54e1c88f1f Fix missing newline in Args.h 2025-02-28 10:05:07 +03:00
37feb762cb Add argument parsing
Added (IMHO) relatively simple argument parsing function (as well as helper
function for printing help information).
2025-02-28 09:09:58 +03:00
cae66889a1 Add 2D/3D boxes/AABBs and intersection tests.
Added support for 2D/3D boxes (or AABBs) and intersection tests between
them and rays/segments.
2025-02-24 22:56:16 +03:00
67e7582d63 Add line, plane, ray and segments, split math unit test
Added some basic geometric primitives such as planes, rays, segments
and lines (plus some extra functions like xProject, xBarycentric, Lerpf),
as well as some intersection tests between them.

Additionally, I split massive math test into smaller ones and tweaked
unit test library (testing no longer stops after first failure).
2025-02-24 09:37:22 +03:00
be16daaecf Move planned features to separate file 2025-02-04 08:05:07 +03:00
7a7134a2f5 Fix function documentation, add missing function 2025-02-03 15:18:57 +03:00
c34a24c2a4 Fix naming in CMakeLists.txt 2025-02-03 10:56:40 +03:00
f86f1f4f74 Fix function declaration, extend math test 2025-02-03 08:26:10 +03:00
3e6e7a9b86 Add script for running calculating coverage 2025-02-02 22:51:57 +03:00
d917eaa479 Fix file and directory permissions 2025-02-02 22:51:28 +03:00
586a9ace21 Change file naming
This is a follow-up to previous commit.
2025-02-02 21:40:31 +03:00
c89cf8f316 Change code and naming style, fix several bugs, removed math types.
After a while I felt that putting underscores between words was not the
best solution, so I changed the underscores to capital letters.

Fixed consistency bug between POSIX/Win32 platform in BH_FileOpen.

Removed definitions for math types (vector, matrix, etc.) due to
potential aliasing issues.
2025-02-02 21:13:34 +03:00
8d73a9b473 Fix asan profile, add script for running tests
Linking against static asan library was a mistake. Now this should
work better for other compilers. Also added script for running all tests
under different profiles.
2025-01-29 22:41:39 +03:00
6ede63e18f Add Asan profile, fix multiple bugs.
Added Asan profile to help catch and fix various bugs (and indeed, there
were few of them).

Additionally, fixed bhunit macro to process arguments only once.
2025-01-29 09:19:34 +03:00
47c21a2035 Refactor math functions, add unit tests
After some testing, I decided to ditch the DirectX approach of writing
math functions.

Additionally, I added unit tests (with reference wxMaxima calculations)
for most math functions and fixed several bugs along the way.
2025-01-29 09:14:58 +03:00
ab27004af6 Document existing math methods. 2025-01-18 21:12:42 +03:00
881ffc87f9 Add readme and license file
Readme file contains implemented and future features.
License file is a license file.
2025-01-18 18:48:40 +03:00
453843f51a Initial commit 2025-01-18 17:24:36 +03:00