forked from JKSunny/Quake3e
-
Notifications
You must be signed in to change notification settings - Fork 0
C23 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added build_log.txt to .gitignore to prevent unnecessary log files from being tracked. - Updated BUILD.md to include new toolchain notes and build instructions for C23 compliance. - Enhanced CMakeLists.txt to enforce C23 standards and added options for stricter warning settings. - Improved README.md with new standards section detailing C23 target and internal code preferences. - Made minor adjustments to various source files to suppress unused parameter warnings and improve code clarity.
- Introduced clamping for volume values in S_Base_RawSamples to prevent overflow in integer calculations. - Changed variable types from `int` to `unsigned` in multiple image rendering files for better type safety and consistency.
…atibility - Removed unused FS_CheckIdPaks function and replaced it with a no-op version for better code clarity. - Added conditional inclusion of netinet6 header for Apple platforms to support IPv6. - Updated various sections in vm_aarch64.c and vm_x86.c to cast array lengths to (int) for type safety and prevent potential issues with unsigned comparisons.
- src/qcommon/net_ip.c: Remove direct netinet6/in6.h include (fixes macOS error), fix IFF_UP loop bug, and resolve -Wsign-compare/Wcast-qual. - src/qcommon/vm_x86.c & vm_aarch64.c: Resolve merge conflicts, unify DROP macro for C23/GCC/MSVC portability, and fix MAP_ANONYMOUS undeclared. - src/qcommon/files.c: Fix unused-function warning for FS_CheckIdPaks stub. - src/renderers/rendercommon/tr_fs_compat.h: Fix -Wcast-qual by using transient mutable copy.
- src/qcommon/net_ip.c: Define _DARWIN_C_SOURCE on macOS, move sys/types.h up, and add fallbacks for IFF_UP and struct ipv6_mreq to fix build breaks. - src/botlib/l_script.c: Add printf format attributes to ScriptWarning and ScriptError to fix -Wformat-nonliteral. - src/renderers/openglrenderer/tr_animation.c: Fix -Wcast-qual by adding const to unsigned short pointer casts. - src/client/mp3: Add (void) to non-prototype declarations and mark unused dummy functions with __attribute__((unused)). - src/client: Resolve multiple -Wsign-compare warnings in cl_parse.c, cl_ui.c, and cl_input.c by adding appropriate casts.
- src/qcommon/files.c: Add forward declaration for FS_CheckIdPaks to avoid implicit declaration warning/redefinition error in MSVC. - src/qcommon/vm_aarch64.c: Remove unused struct ipv6_mreq definition which caused errors in MSVC due to missing in6_addr.
- src/botlib/l_script.c: Added GCC diagnostic pragmas to suppress warnings for format-nonliteral in ScriptError and ScriptWarning functions. - src/client/cl_jpeg.c: Updated FS_ReadFile call to use va for filename formatting. - src/client/cl_main.c: Simplified Cvar_VariableString calls for map configuration. - src/client/mp3/csbt.c: Updated function signatures to include void for clarity. - src/qcommon/net_ip.c: Cleaned up includes and organized header files for better compatibility. - src/qcommon/q_math.c and q_shared.h: Changed VectorRotate function signature for consistency. - src/renderers: Various updates to function signatures and type safety improvements across OpenGL and Vulkan renderers. - Added new noise functions in rendercommon for enhanced noise generation capabilities.
- Updated function signatures across multiple files to include (void) for unused parameters, improving clarity and suppressing compiler warnings. - Added explicit casts to size_t in array length checks to ensure type safety. - Changed function visibility from public to static where appropriate to limit scope and improve encapsulation.
- Updated net_ip.c to provide a fallback for struct ipv6_mreq only when necessary, enhancing compatibility across platforms. - Added static assertion macros in q_compat.h to improve compile-time checks for MSVC, ensuring better type safety and error detection.
- Updated the static assertion macro definition to ensure compatibility with compilers that do not support _Static_assert, enhancing cross-platform build reliability.
- Updated net_ip.c to include <netinet6/in6.h> for macOS, improving IPv6 compatibility. - Modified q_compat.h to refine static assertion macros for better compatibility with MSVC and other compilers, ensuring robust compile-time checks. - Added a fallback definition for MAP_ANONYMOUS in vm_aarch64.c to address potential issues on platforms lacking this definition.
- Updated net_ip.c to ensure struct ipv6_mreq is only defined when necessary, improving compatibility across platforms. - Removed unnecessary inclusion of <netinet6/in6.h> for macOS, relying on <netinet/in.h> instead.
1305def to
a82e584
Compare
- Remove unnecessary network includes from vm_aarch64.c - Add consistent MAP_ANONYMOUS/MAP_ANON fallback to all VM files - Replace hardcoded fallback value with compile-time error for safety - Ensures cross-platform compatibility for anonymous memory mapping Fixes build issues on platforms where MAP_ANONYMOUS may not be defined but MAP_ANON is available (e.g., Darwin/BSDs).
- Add comprehensive C23 documentation (docs/C23.md) - Update BUILD.md with C23 toolchain and feature information - Document all adopted C23 features and compatibility measures - Complete the incremental C23 modernization of idTech3 This finalizes the C23 integration with full documentation and build guidance for developers. All C23 features have been incrementally adopted with fallbacks maintained for compatibility.
- files.c: Keep conditional FS_CheckIdPaks stub - net_ip.c: Keep C23 IPv6 fallback handling - vm_aarch64.c: Keep MAP_ANONYMOUS fallback - vm_x86.c: Keep C23 __VA_OPT__ DROP macro All C23 modernization changes preserved.
…IFF_UP and ipv6_mreq fallbacks
…dness in MIN macro usage
- Fix DROP macro in vm_aarch64.c and vm_armv7l.c to use correct argument order - Add MAP_ANONYMOUS fallback in vm_aarch64.c for cross-platform mmap support - Fix bounds pointer casting in tr_animation.c R_MDRCullModel function
- Guard GCC pragmas in botlib/l_script.c with #ifdef __GNUC__ for MSVC compatibility - Move FS_CheckIdPaks declaration inside #if 0 block to avoid MSVC 'declared but not defined' error
- Add ipv6_mreq struct definition for non-Windows platforms when USE_IPV6 is enabled - Fix const qualifier warnings in NET_CompareBaseAdrMask by using const pointers
- Remove FS_CheckIdPaks declaration from inside #if 0 block to avoid MSVC parsing issues - Add MSVC-specific warning suppression for format string warnings in l_script.c
- Remove unused FS_CheckIdPaks function and its call since SKIP_IDPAK_CHECK is enabled - Remove GCC pragmas from l_script.c to avoid MSVC warnings about unknown pragmas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Furthering C23 integration to pass building on all platforms.