52 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
Nathan 32b1b62781 remove encryption support from core library (#59)
remove encryption support from the core library
2024-07-16 23:34:00 +02:00
BIAGINI Nathan 23b9fc8627 fix driver registering in echo example 2024-06-23 08:48:06 +02:00
BIAGINI Nathan 0e1974d287 update copyright year 2024-02-07 22:28:54 +01:00
Nathan e8368ace47 Fix url in raylib example README 2024-01-03 17:58:43 +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 8113cddb3b fix examples 2023-05-27 18:38:13 +02:00
Nathan 1d758aa259 Update README.md 2023-03-23 19:43:06 +01:00
BIAGINI Nathan a59c4303ec update copyrights year 2023-02-18 11:28:18 +01:00
Nathan c0d7a9f977 Update raylib example README 2023-02-18 11:09:22 +01:00
Nathan 01f1c5f51c Update raylib example README 2023-02-18 10:54:01 +01:00
BIAGINI Nathan 4bd8ea90ef fix examples and soak compilation issues 2023-02-18 10:30:19 +01:00
BIAGINI Nathan 75872ba0a0 update raylib example 2023-02-11 10:47:37 +01:00
BIAGINI Nathan 993b6c9c7c fix examples 2023-02-05 10:28:39 +01:00
BIAGINI Nathan 6f75b3b807 WIP 2023-01-15 18:57:32 +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 f24c73be17 add -Wpedantic to CMakeLists.txt files 2021-09-22 22:01:44 +02:00
BIAGINI Nathan d43a30fef3 update examples 2021-09-05 12:21:03 +02:00
Nathan BIAGINI 60a862e95a clean disconnection 2021-09-01 15:24:11 +02:00
Nathan BIAGINI 1740c4120b update examples 2021-08-29 18:40:53 +02:00
Nathan BIAGINI ceb1426228 update examples 2021-08-29 18:23:16 +02:00
Nathan BIAGINI 3dbe1defcb update raylib example server 2021-05-26 20:29:49 +02:00
Nathan BIAGINI cf597c1902 update soak test 2021-05-26 20:08:34 +02:00
Nathan BIAGINI ac9b5db620 update examples 2021-05-22 23:10:20 +02:00
Nathan BIAGINI ebee4cfe45 update raylib example to support encryption + fix cmake script for osx 2021-01-29 18:04:58 +01:00
Nathan BIAGINI 7f98bfa409 wip 2021-01-29 18:04:58 +01:00
Nathan BIAGINI 43f8d07bf1 update examples 2021-01-19 19:23:52 +01:00
Nathan BIAGINI 3c57b1f6a6 fix CMakeLists.txt of raylib example 2021-01-14 18:35:59 +01:00
Nathan BIAGINI b2de7c0c36 update raylib example 2020-10-18 10:19:08 +02:00
Nathan BIAGINI 6695a86d9d update examples 2020-10-12 21:13:10 +02:00
Nathan BIAGINI 2133134ebb update examples 2020-10-10 15:24:44 +02:00
Nathan 8b4b5b84b4 Update README.md 2020-10-06 09:09:10 +02:00
Nathan 991940570c Update README.md 2020-10-06 09:03:37 +02:00
Nathan 1839949255 Update README.md 2020-10-03 23:43:44 +02:00
Nathan BIAGINI cef4c400bc README; webrtc stuff 2020-10-03 22:36:03 +02:00
Nathan BIAGINI fc301d8814 update raylib example to work with the webrtc driver 2020-10-03 22:36:03 +02:00
Nathan BIAGINI f37abea666 licensing 2020-09-20 20:52:21 +02:00
Nathan 7357118ca5 Update README.md 2020-09-20 20:18:45 +02:00
Nathan BIAGINI 1042a3f42e example screenshot 2020-09-20 20:17:02 +02:00
Nathan bd43d4b276 Update README.md 2020-09-20 20:13:56 +02:00
Nathan BIAGINI cda770f224 examples 2020-09-20 20:08:28 +02:00
Nathan BIAGINI 1d54ef5f9e update raylib example 2020-09-16 08:54:08 +02:00
Nathan BIAGINI 1bd340b962 adapt raylib example to api rework 2020-09-12 07:42:09 +02:00
nathb 0fcdbe7672 display packet loss in raylib example 2020-09-06 21:28:41 +02:00
nathb 3e0f34b605 minor api changes 2020-09-05 17:29:49 +02:00
nathb 7fd14046d4 minor api rename, fix segv, windows thread support 2020-09-03 23:14:36 +02:00
Nathan BIAGINI da2c352724 api channel abstraction 2020-09-02 14:16:01 +02:00
Nathan BIAGINI c9f9551073 remove sdl net udp driver 2020-09-01 12:28:34 +02:00
Nathan BIAGINI a5a17c6378 update raylib example 2020-09-01 12:16:35 +02:00