Commit Graph

148 Commits

Author SHA1 Message Date
Xavier Del Campo Romero 33a383b98e libfixmath/fix16.h: replace static const with define
This allows using them with compile-time expressions.
2022-02-24 21:45:25 +01:00
Xavier Del Campo Romero b5c0c9c5f4 CMakeLists.txt: disable -Werror=return-type 2022-02-24 21:45:25 +01:00
Xavier Del Campo Romero 7a8cb94901 Disable tests 2022-02-24 21:45:25 +01:00
Xavier Del Campo Romero 151798a2b2 libfixmath/CMakeLists.txt: avoid glob matching 2022-02-24 21:45:25 +01:00
Xavier Del Campo Romero 84a5a3e9b3 libfixmath/CMakeLists.txt: use target_include_directories 2022-02-24 21:45:25 +01:00
Xavier Del Campo Romero 7119e719d1 Downgrade CMAKE_C_STANDARD to 99 2022-02-24 21:45:25 +01:00
Xavier Del Campo Romero f0cb4e0f38 Rename library CMakeLists.txt 2022-02-24 21:45:25 +01:00
Johannes Ringler 64d851a6f9 fix unsigned signed comparison in fix16_fft 2022-02-23 08:50:12 +02:00
Johannes Ringler 09d10c16d3 fix warnings due to signed char on some platforms
some context:
https://stackoverflow.com/a/10186479/1976323
2022-02-23 08:50:12 +02:00
Johannes Ringler 29ddf649e1
fix unused variable warning with FIXMATH_FAST_SIN (#35) 2022-02-10 08:54:05 +02:00
Petteri Aimonen a1e92c7c5e
Update README.md
Add note about maintenance
2021-05-30 10:52:41 +03:00
Martin Bařinka 0c88e55fa8
fixed division, undefined behaviors and some improvements (#33)
* testing using ctest

* emove old testing script

* added github workflow CI

* updated CI

* added unit test for macros

* F16() and F16C() are both rounding allways, so fix16_from_dbl should as well

* added tests for strign operations, but these functions are in my opinion unreliable and tests are failing

* removed old unittests

* removed old unittests from cmake

* problem with division using gcc

* improved benchmark

* clarification of problem with division

* attempt to fix

* fixed some undefined behaviors, fixed division
2021-05-03 13:43:54 +03:00
Martin Bařinka 4ea8f3ff12
Unit testing with cmake (#31)
* testing using ctest

* emove old testing script

* added github workflow CI

* updated CI
2021-04-29 13:38:21 +03:00
Martin Bařinka 799ecab03d
better unittest script (#30) 2021-04-29 13:09:56 +03:00
Petteri Aimonen 19e5ec621e
Make unittest #include path consistent (#29) 2021-04-29 10:02:02 +03:00
Petteri Aimonen 9b701e574b Enable Travis CI 2021-04-29 09:55:42 +03:00
Petteri Aimonen c4a480774a Fix compiler warning in fix16_abs() 2021-04-29 09:50:32 +03:00
Martin Bařinka 35eb7753d2
New unittests (#28)
Refactor unittests
2021-04-29 09:40:06 +03:00
Petteri Aimonen 951f522b13
Merge pull request #26 from maruncz/hotfix/abs-signed-overflow
signed integer overflow is undefined behavior
2021-04-27 12:32:08 +03:00
maruncz ba0991de3e fixed: signed integer overflow is undefined behavior 2021-04-27 11:08:33 +02:00
Petteri Aimonen b20bdb01d9
Merge pull request #25 from maruncz/master
Added CMakeLists.txt and some fixes
2021-04-22 11:04:01 +03:00
maruncz 17a6197819 fix formatting 2021-04-22 09:10:50 +02:00
maruncz edcfdea949 fixed some warnings 2021-04-21 15:08:15 +02:00
maruncz 7541eae325 added cmake project file 2021-04-19 10:46:15 +02:00
Petteri Aimonen 24488b16cc
Merge pull request #23 from theacodes/patch-1
Add LICENSE
2021-01-23 11:56:48 +02:00
Thea Flowers 9a5a33c8cb Add AUTHORS file 2021-01-22 14:26:00 -05:00
Stargirl Flowers 579f60511f
Add LICENSE
This library is wonderful, however, it's missing an explicit license in its source code. This adds the text of the MIT license along with the name of the original author. This helps folks like me make sure we follow the license terms when using this library. :)
2021-01-21 15:26:19 -05:00
Petteri Aimonen 83c5f4438e
Merge pull request #21 from HamAndChris/fix_linear_interpolation
Removed 64-bit restriction on linear interpolation functions, fixed int64 bugs
2020-10-29 21:23:07 +02:00
Chris Hammond 18a9ad00de Removed 64-bit restriction on linear interpolation functions. Added more test cases and fixed several bugs in the 64-bit arithmetic functions.
Also added script to run all unit tests.
2020-10-29 13:20:27 -04:00
Petteri Aimonen 54c1f9276a
Merge pull request #20 from HamAndChris/fix_linear_interpolation
Fix type conversion bugs in linear interpolation functions
2020-10-23 08:22:13 +03:00
Chris Hammond 2859cbf31d Added unit tests for "lerp" functions, and found several type conversion bugs 2020-10-22 16:24:49 -04:00
Petteri Aimonen 66365d5888
Merge pull request #16 from althonos/patch-1
Fix GCC error when compiling in no-overflow mode
2020-03-15 06:53:22 +02:00
Martin Larralde 950d51759b
Fix `elif` without condition in `fix16_trig.c` 2020-03-15 02:22:25 +01:00
Petteri Aimonen 20a2d64bb8
Merge pull request #15 from dlech/patch-1
add #include <stdint.h> to int64.h
2019-12-13 08:17:21 +02:00
David Lechner d09f7a4396
add #include <stdint.h> to int64.h
When using the `gcc -M` option to determine header file dependencies, int64.h causes an error because the types from stdint.h are not defined.
2019-12-12 17:02:53 -06:00
Petteri Aimonen c3017d7d74
Merge pull request #13 from althonos/patch-1
Fix missing function when building without overflow support
2019-09-08 21:35:57 +03:00
Martin Larralde 6f6284807f
Fix missing function when building without overflow support 2019-09-08 15:28:05 +02:00
Petteri Aimonen fd01d546a9
Merge pull request #12 from dlech/master
Fixes
2019-06-17 09:17:19 +03:00
David Lechner 11855068c3 Fix conflict with __int64_t typedef
On Linux, we get a compile error because __int64_t is defined and
included by stdint.h. Double underscores are reseved in C in general
and should not be used anyway. Replace with a single leading underscore.
2019-06-16 15:38:23 -05:00
David Lechner ff0a5f69c2 add FIXMATH_NO_CTYPE option
When compiling with -nostdlib, the functions in ctype may not be
available. Add FIXMATH_NO_CTYPE option to replace them with inline
functions.

Also add unit test to test str functions with this option enabled.
2019-06-16 15:38:19 -05:00
David Lechner 108fd93a34 clean all unit tests
make clean should delete all unit test binary files
2019-06-16 15:37:41 -05:00
David Lechner 3b7f96f982 Add explicit cast in fix16_from_dbl()
This fixes the error:

    implicit conversion from 'float' to 'double' to match other operand
    of binary expression

When the compiler options -fsingle-precision-constant -Wdouble-promotion
are set
2019-06-16 15:19:01 -05:00
Petteri Aimonen 47a5aa74ff
Merge pull request #10 from puzrin/patch-1
Suppress `-Wconversion` warning
2019-04-15 09:14:33 +03:00
Vitaly Puzrin f13c322287
Suppress `-Wconversion` warning 2019-04-15 02:29:08 +03:00
Petteri Aimonen bada934981
Merge pull request #9 from puzrin/patch-1
platformio: drop 'export' option from config
2018-07-27 15:53:53 +03:00
Vitaly Puzrin f1d95c94df
platformio: drop 'export' option from config
Library should be useable from pio both by direct git link and by name.
2018-07-27 14:54:22 +03:00
Petteri Aimonen 7dbe4b984b
Merge pull request #8 from puzrin/master
Update pio manifest to satisfy registry add rules
2018-07-24 15:06:30 +03:00
Vitaly Puzrin c0e66997db
Update pio manifest to satisfy registry add rules 2018-07-24 14:59:00 +03:00
Petteri Aimonen dd8da476c7
Merge pull request #6 from puzrin/master
Add library config for PlatformIO
2018-07-24 14:16:02 +03:00
Vitaly Puzrin ad66a42562 Add library config for PlatformIO 2018-07-24 14:00:19 +03:00