95 Commits
Author SHA1 Message Date
Volodymyr FialkoandBIAGINI Nathan 15d823dab6 Enable build flags and fix compilation warnings (gcc 14.1.0) (#66)
* Fix rpc build with other examples

CPP_COMPILE is an option, a cache variable, thus regular unset() is not
working for it since it tries to unset the scope variable.

This causing cmake to skip compilation of rpc.
Unset CPP_COMPILE from CACHE to make it work as intended.

* Fix compiler flags with build targets

Currently tests, soak and examples are build without extra flags,
because add_compile_options is specified after defining build targets.

From add_compile_options() docs:
Adds options to the compiler command line for targets in the current
directory and below that are added *after* this command is invoked.

* Pass debug callbacks as struct

Fixes:
warning: ISO C forbids conversion of function pointer to object pointer
type

* Move global variables under NBNET_IMPL

Nb net could be included multiple times, to prevent creation of global
variables in each file move them under NBNET_IMPL.

Also use designated initializer to initiate a driver structure to
remove warnings about partial initialization. Designated initializer
would initialize other members to zero.

* Resolve unused variables warnings.

Cast unused function arguments to (void) to suspend warnings.

* Resolve signed vs unsigned warnings

Remove unnecessary lt 0 checks and sync types to remove signed vs
unsigned warnings.

* Resolve string related warnings

Fixes:
nbnet/tests/string_tests.c:18:9: error: ‘strncpy’
output truncated before terminating nul copying 5 bytes from a string of
the same length
[-Werror=stringop-truncation]
   18 |         strncpy(res + pos, b, len_b);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

nbnet/tests/string_tests.c:24:9: error: ‘strncpy’
specified bound depends on the length of the source argument
[-Werror=stringop-truncation]

* Resolve function defined but not used warnings

Mark GameServer_GetClientCount() as inline.

* Attempt to fix warning in ASSERT_VALUE_IN_RANGE

In case when value in unsigned type and min is 0, this commit just
obfuscates types, maybe there's better solution.

Fixes:
warning: comparison of unsigned expression in ‘>= 0’ is always true
[-Wtype-limits]

* Ensure that read len is less than word size

In release mode(-DCMAKE_BUILD_TYPE=Release) tests returning following
error:
nbnet/tests/../nbnet.h:2272:9: error: ‘memcpy’ forming offset [4, 7] is
out of the bound s [0, 4] of object ‘word’ with type ‘Word’ {aka
‘unsigned int’} [-Werror=array-bounds=]
 2272 |         memcpy(bytes, &word, length); |
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add check to verify that length is less than Word size.

* add -Wno-unknown-pragmas flag

* fix examples compilation on windows

* fix examples compilation on windows

* fix examples compilation on windows

* fix unit tests compilation on windows

* fix soak test compilation on windows

* fix unit tests compilation on windows

* fix unit tests compilation on windows

---------

Co-authored-by: BIAGINI Nathan <nath.biagini@gmail.com>
2024-08-10 12:02:42 +02:00
BIAGINI Nathan 3c8de60010 address wrtc module compatibility issues with arm64 2024-07-15 19:07:22 +02:00
BIAGINI Nathan 0e1974d287 update copyright year 2024-02-07 22:28:54 +01:00
Nathan a0d605e27f [WIP] Rework native webrtc driver (ditch facil.io) (#52)
Remove the dependency of the native webrtc driver to facil.io entirely.
2024-02-07 22:03:20 +01:00
BIAGINI Nathan 0b9c7b9477 remove soak log files 2024-01-06 09:46:00 +01:00
Nathan 9e28e97685 nbnet 2.0 (#35)
2.0 release - internal refactoring, public API rework, and introduction of a new CI based on GitHub actions
2023-09-24 19:43:08 +02:00
BIAGINI Nathan a0ee00e944 optimize packets dequeuing in webrtc js driver 2023-08-19 16:06:54 +02:00
BIAGINI Nathan a17507edcc clean up soak test CMake script 2023-07-01 09:21:28 +02:00
BIAGINI Nathan 4d5231837f update soak test 2023-05-28 00:35:53 +02:00
BIAGINI Nathan c371edfecf remove debug log 2023-05-27 15:09:05 +02:00
BIAGINI Nathan a085157f45 rework channels 2023-05-24 16:28:06 +02:00
BIAGINI Nathan a59c4303ec update copyrights year 2023-02-18 11:28:18 +01:00
BIAGINI Nathan 4bd8ea90ef fix examples and soak compilation issues 2023-02-18 10:30:19 +01:00
BIAGINI Nathan e774e1ca87 https wip 2023-02-12 16:14:42 +01:00
BIAGINI Nathan 3712b841c0 update soak test 2023-02-11 10:47:59 +01:00
BIAGINI Nathan 2b0c221574 webrtc native driver WIP 2023-02-05 10:17:16 +01:00
BIAGINI Nathan 6f75b3b807 WIP 2023-01-15 18:57:32 +01:00
BIAGINI Nathan 21a839587c fix soak test compilation issue 2022-12-25 18:35:16 +01:00
BIAGINI Nathan 9bd6a55a6e update examples & soak test 2021-11-30 14:41:27 +01:00
BIAGINI Nathan a42fc0e933 update examples & soak test 2021-11-30 10:11:06 +01:00
BIAGINI Nathan e875d756b4 dirty comment of a segfaulting function call 2021-10-08 23:55:32 +02:00
BIAGINI Nathan c2efb6e78f link with libm on unix 2021-10-08 23:09:06 +02:00
BIAGINI Nathan 8615e575f0 do not link with libm 2021-10-08 23:00:49 +02:00
BIAGINI Nathan 3da8c4671f do not link with pthread on windows 2021-10-08 22:55:07 +02:00
BIAGINI Nathan cf18da91fb windows fix attempt 2 2021-10-08 22:47:26 +02:00
BIAGINI Nathan 3cd099419a windows fix attempt 2021-10-08 22:40:39 +02:00
BIAGINI Nathan f7ee0728c0 adapt soak test for windows 2021-10-08 22:34:33 +02:00
BIAGINI Nathan bdf625d53c adapt soak test for windows 2021-10-08 22:23:07 +02:00
BIAGINI Nathan fab714d2cd allow soak test to be compiled to cpp 2021-10-08 10:34:32 +02:00
BIAGINI Nathan f24c73be17 add -Wpedantic to CMakeLists.txt files 2021-09-22 22:01:44 +02:00
BIAGINI Nathan fe137bf844 update soak 2021-09-05 12:21:03 +02:00
Nathan BIAGINI d1a4e7c48e update soak test 2021-08-29 18:41:00 +02:00
Nathan BIAGINI 715275ed99 update soak test 2021-08-29 18:22:11 +02:00
Nathan BIAGINI 4dae473c83 update soak test 2021-05-26 20:31:51 +02:00
Nathan BIAGINI cf597c1902 update soak test 2021-05-26 20:08:34 +02:00
Nathan BIAGINI 4615d46b7b update soak test 2021-05-22 23:09:34 +02:00
Nathan BIAGINI fb27e7a0b5 update soak test 2021-05-20 08:18:43 +02:00
Nathan BIAGINI 9ace87206f update soak test 2021-05-18 19:20:12 +02:00
Nathan BIAGINI efe0045e94 update soak example 2021-05-14 17:02:23 +02:00
Nathan BIAGINI 489b9c4c97 update soak test 2021-05-11 21:47:00 +02:00
Nathan BIAGINI eb0bb7a50d update soak test 2021-04-21 17:57:16 +02:00
Nathan BIAGINI 25377e47c1 CMakeLists; enable memory tracing 2021-04-21 17:56:34 +02:00
Nathan BIAGINI d48350f20b fix memory leak in soak test 2021-04-19 22:01:13 +02:00
Nathan BIAGINI 295614bffc update soak 2021-04-18 20:03:49 +02:00
Nathan BIAGINI efd5698252 update soak test, drop linked list all together for static arrays 2021-04-16 11:45:25 +02:00
Nathan BIAGINI d8fea6687e fix premature message destroy in soak test 2021-04-16 09:11:42 +02:00
Nathan BIAGINI 6b14eefcff provide the soak example with a linked list implementation 2021-04-15 19:26:34 +02:00
Nathan BIAGINI 607f6ecda8 update soak test 2021-04-15 09:16:58 +02:00
Nathan BIAGINI 18b34231ff update soak 2021-04-11 15:30:11 +02:00
Nathan BIAGINI 55b5c3437b adapt soak test to new *CanSendMessage functions 2021-04-05 18:09:48 +02:00