## 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:
1 parent
ea689e7357
commit
a998f6b981
89 files changed
+4081
-3486
No files matched your search
+12
-12
@@ -15,11 +15,11 @@ struct UUID4 {
|
||||
u64 low;
|
||||
};
|
||||
|
||||
wapp_intern UUID4 generate_uuid4(void);
|
||||
wapp_intern void uuid4_to_uuid(const UUID4* uuid4, WUUID *uuid);
|
||||
wp_intern UUID4 generate_uuid4(void);
|
||||
wp_intern void uuid4_to_uuid(const UUID4* uuid4, WpUuid *uuid);
|
||||
|
||||
WUUID *wapp_uuid_init_uuid4(WUUID *uuid) {
|
||||
wapp_debug_assert(uuid != NULL, "`uuid` should not be NULL");
|
||||
WpUuid *wpUuidInitUuid4(WpUuid *uuid) {
|
||||
wpDebugAssert(uuid != NULL, "`uuid` should not be NULL");
|
||||
|
||||
UUID4 uuid4 = generate_uuid4();
|
||||
uuid4_to_uuid(&uuid4, uuid);
|
||||
@@ -27,18 +27,18 @@ WUUID *wapp_uuid_init_uuid4(WUUID *uuid) {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
wapp_intern UUID4 generate_uuid4(void) {
|
||||
wapp_persist XOR256State state = {0};
|
||||
wapp_persist b8 initialised = false;
|
||||
wp_intern UUID4 generate_uuid4(void) {
|
||||
wp_persist WpXor256State state = {0};
|
||||
wp_persist b8 initialised = false;
|
||||
|
||||
if (!initialised) {
|
||||
initialised = true;
|
||||
state = wapp_prng_xorshift_init_state();
|
||||
state = wpPrngXorshiftInit();
|
||||
}
|
||||
|
||||
UUID4 uuid = (UUID4){
|
||||
.high = wapp_prng_xorshift_256(&state),
|
||||
.low = wapp_prng_xorshift_256(&state),
|
||||
.high = wpPrngXorshift256(&state),
|
||||
.low = wpPrngXorshift256(&state),
|
||||
};
|
||||
|
||||
uuid.high = (uuid.high & 0xffffffffffff0fff) | 0x0000000000004000;
|
||||
@@ -47,12 +47,12 @@ wapp_intern UUID4 generate_uuid4(void) {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
wapp_intern void uuid4_to_uuid(const UUID4* uuid4, WUUID *uuid) {
|
||||
wp_intern void uuid4_to_uuid(const UUID4* uuid4, WpUuid *uuid) {
|
||||
u64 group1 = uuid4->high >> 32;
|
||||
u64 group2 = (uuid4->high << 32) >> 48;
|
||||
u64 group3 = (uuid4->high << 48) >> 48;
|
||||
u64 group4 = uuid4->low >> 48;
|
||||
u64 group5 = (uuid4->low << 16) >> 16;
|
||||
|
||||
wapp_str8_format(&(uuid->uuid), UUID_STR_FORMAT, group1, group2, group3, group4, group5);
|
||||
wpStr8Format(&(uuid->uuid), UUID_STR_FORMAT, group1, group2, group3, group4, group5);
|
||||
}
|
||||
Reference in new issue
Block a user