## 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:
@@ -2,29 +2,29 @@
|
||||
|
||||
#include "test_str8_array.h"
|
||||
|
||||
TestFuncResult test_str8_array(void) {
|
||||
WpTestFuncResult test_str8_array(void) {
|
||||
b8 result;
|
||||
|
||||
Str8 expected[] = {wapp_str8_lit("Hello"), wapp_str8_lit("Hi"), wapp_str8_lit("Bye")};
|
||||
WpStr8 expected[] = {wpStr8Lit("Hello"), wpStr8Lit("Hi"), wpStr8Lit("Bye")};
|
||||
|
||||
Str8 str1 = wapp_str8_lit("Hello");
|
||||
Str8 str2 = wapp_str8_lit("Hi");
|
||||
Str8 str3 = wapp_str8_lit("Bye");
|
||||
Str8Array array = wapp_array(Str8, str1, str2, str3);
|
||||
WpStr8 str1 = wpStr8Lit("Hello");
|
||||
WpStr8 str2 = wpStr8Lit("Hi");
|
||||
WpStr8 str3 = wpStr8Lit("Bye");
|
||||
WpStr8Array array = wpArray(WpStr8, str1, str2, str3);
|
||||
|
||||
result = wapp_array_count(array) == 3 && wapp_array_capacity(array) == 8;
|
||||
result = wpArrayCount(array) == 3 && wpArrayCapacity(array) == 8;
|
||||
|
||||
Str8 *item;
|
||||
u64 count = wapp_array_count(array);
|
||||
WpStr8 *item;
|
||||
u64 count = wpArrayCount(array);
|
||||
u64 index = 0;
|
||||
b8 running = true;
|
||||
while (running) {
|
||||
item = wapp_array_get(Str8, array, index);
|
||||
result = result && item && (wapp_str8_equal(item, &expected[index]));
|
||||
item = wpArrayGet(WpStr8, array, index);
|
||||
result = result && item && (wpStr8Equal(item, &expected[index]));
|
||||
|
||||
++index;
|
||||
running = index < count;
|
||||
}
|
||||
|
||||
return wapp_tester_result(result);
|
||||
return wpTesterResult(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user