## Summary Standardize naming conventions across the entire wizapp-stdlib codebase by replacing inconsistent prefixes and snake_case with a unified `wp` prefix + CamelCase scheme. ## Changes ### Naming convention applied | Pattern | Before | After | |---|---|---| | Public functions | `wapp_module_function` | `wpModuleFunction` | | Public types | `GenericXxx`, bare `Xxx` | `WpXxx` | | Constants / enum values | `WAPP_XXX`, `SHELL_XXX` | `WP_XXX`, `WP_SHELL_XXX` | | Internal functions | `_module_function` | `_moduleFunction` | | Storage-class macros | `wapp_extern`, `wapp_intern` | `wp_extern`, `wp_intern` | ### Modules affected All 20 modules were renamed: `arena`, `array`, `dbl_list`, `queue`, `str8`, `mem_allocator`, `mem_utils`, `mem_os`, `file`, `cpath`, `log`, `shell_commander`, `shell_termcolour`, `shell_utils`, `prng/xorshift`, `uuid`, `tester`, `aliases`, `assert`, `misc_utils`, `platform` — plus their test files. ### Backward compatibility Added `src/oldnames.h` with `#define OLD_NAME NEW_NAME` for every renamed symbol, organized by module under Constants → Types → Functions sections. Existing code that includes this file will compile without changes. Reviewed-on: #12 Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com> Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
This commit was merged in pull request #12.
This commit is contained in:
+18
-18
@@ -9,42 +9,42 @@
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifdef WAPP_PLATFORM_CPP
|
||||
#ifdef WP_PLATFORM_CPP
|
||||
BEGIN_C_LINKAGE
|
||||
#endif // !WAPP_PLATFORM_CPP
|
||||
#endif // !WP_PLATFORM_CPP
|
||||
|
||||
#define wapp_static_assert(EXPR, MSG) wapp_extern char ASSERTION_FAILED[EXPR ? 1 : -1]
|
||||
#define wpStaticAssert(EXPR, MSG) wp_extern char ASSERTION_FAILED[EXPR ? 1 : -1]
|
||||
|
||||
#ifndef WAPP_NO_RUNTIME_ASSERT
|
||||
#define wapp_runtime_assert(EXPR, MSG) __wapp_runtime_assert(EXPR, MSG)
|
||||
#ifndef WP_NO_RUNTIME_ASSERT
|
||||
#define wpRuntimeAssert(EXPR, MSG) _runtimeAssert(EXPR, MSG)
|
||||
#else
|
||||
#define wapp_runtime_assert(EXPR, MSG)
|
||||
#define wpRuntimeAssert(EXPR, MSG)
|
||||
#endif
|
||||
|
||||
#ifdef WAPP_DEBUG_ASSERT
|
||||
#define wapp_debug_assert(EXPR, MSG) wapp_runtime_assert(EXPR, MSG)
|
||||
#ifdef WP_DEBUG_ASSERT
|
||||
#define wpDebugAssert(EXPR, MSG) wpRuntimeAssert(EXPR, MSG)
|
||||
#else
|
||||
#define wapp_debug_assert(EXPR, MSG)
|
||||
#define wpDebugAssert(EXPR, MSG)
|
||||
#endif
|
||||
|
||||
#ifdef WAPP_PLATFORM_WINDOWS
|
||||
#define __wapp_runtime_assert(EXPR, MSG) do { \
|
||||
#ifdef WP_PLATFORM_WINDOWS
|
||||
#define _runtimeAssert(EXPR, MSG) do { \
|
||||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4127)) \
|
||||
if (!(EXPR)) { \
|
||||
__pragma(warning(pop)) \
|
||||
__runtime_assert_failed(EXPR, MSG); \
|
||||
_runtimeAssertFailed(EXPR, MSG); \
|
||||
} \
|
||||
} while(false)
|
||||
#else
|
||||
#define __wapp_runtime_assert(EXPR, MSG) do { \
|
||||
#define _runtimeAssert(EXPR, MSG) do { \
|
||||
if (!(EXPR)) { \
|
||||
__runtime_assert_failed(EXPR, MSG); \
|
||||
_runtimeAssertFailed(EXPR, MSG); \
|
||||
} \
|
||||
} while(false)
|
||||
#endif // !WAPP_PLATFORM_WINDOWS
|
||||
#endif // !WP_PLATFORM_WINDOWS
|
||||
|
||||
#define __runtime_assert_failed(EXPR, MSG) do { \
|
||||
#define _runtimeAssertFailed(EXPR, MSG) do { \
|
||||
fprintf( \
|
||||
stderr, \
|
||||
"%s:%d (In function `%s`): Assertion failed (%" PRIu32 ")\nDiagnostic: %s\n\n", \
|
||||
@@ -54,8 +54,8 @@ BEGIN_C_LINKAGE
|
||||
abort(); \
|
||||
} while(false)
|
||||
|
||||
#ifdef WAPP_PLATFORM_CPP
|
||||
#ifdef WP_PLATFORM_CPP
|
||||
END_C_LINKAGE
|
||||
#endif // !WAPP_PLATFORM_CPP
|
||||
#endif // !WP_PLATFORM_CPP
|
||||
|
||||
#endif // !WAPP_ASSERT_H
|
||||
|
||||
Reference in New Issue
Block a user