Skip to content

Commit e79d876

Browse files
feat: linter test; fix doxygen
1 parent 4315125 commit e79d876

46 files changed

Lines changed: 4439 additions & 156 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ out/
1212

1313
# third_party dependencies (downloaded during configuration)
1414
third_party/*/
15-
!third_party/.gitkeep
15+
!third_party/.gitkeep
16+
17+
__pycache__/

base/include/base/expected/expected.hpp

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,12 @@ template <typename E> class unexpected {
223223
*
224224
* @throws None if E is nothrow swappable.
225225
*
226-
* @ingroup base_utilities
226+
* @note None.
227+
*
228+
* @warning None.
229+
*
230+
* @since 0.1
231+
* @ingroup base_utilities
227232
*/
228233
void swap(unexpected& other) noexcept(std::is_nothrow_swappable_v<E>) {
229234
using std::swap;
@@ -292,11 +297,44 @@ template <typename T, typename E> class expected {
292297
"T must not be a reference (use T* or std::reference_wrapper)");
293298
static_assert(!std::is_reference_v<E>, "E must not be a reference");
294299

295-
/// Internal storage union.
300+
/**
301+
* @brief Internal storage union for value or error.
302+
*
303+
* Discriminated union that holds either the value or the error.
304+
* Only one member is active at any time.
305+
*
306+
* @note Trivial (no explicit initialization).
307+
*
308+
* @warning Direct access to members is unsafe; use has_val_ to
309+
* determine which member is active.
310+
*
311+
* @since 0.1
312+
* @ingroup base_utilities
313+
* @internal
314+
*/
296315
union Storage {
297316
T val; ///< Value storage.
317+
298318
E err; ///< Error storage.
319+
320+
/**
321+
* @brief Default constructor.
322+
*
323+
* @throws None.
324+
*
325+
* @since 0.1
326+
* @ingroup base_utilities
327+
*/
299328
Storage() {}
329+
330+
/**
331+
* @brief Destructor.
332+
*
333+
* @throws None.
334+
*
335+
* @since 0.1
336+
* @ingroup base_utilities
337+
*/
300338
~Storage() {}
301339
};
302340

@@ -1236,7 +1274,12 @@ template <typename T, typename E> class expected {
12361274
*
12371275
* @throws None if types are nothrow move constructible and swappable.
12381276
*
1239-
* @ingroup base_utilities
1277+
* @note None.
1278+
*
1279+
* @warning None.
1280+
*
1281+
* @since 0.1
1282+
* @ingroup base_utilities
12401283
*/
12411284
void swap(expected& o) noexcept(std::is_nothrow_move_constructible_v<T> &&
12421285
std::is_nothrow_swappable_v<T> &&
@@ -1287,7 +1330,12 @@ template <typename T, typename E> class expected {
12871330
*
12881331
* @throws None if types are nothrow move constructible and swappable.
12891332
*
1290-
* @ingroup base_utilities
1333+
* @note None.
1334+
*
1335+
* @warning None.
1336+
*
1337+
* @since 0.1
1338+
* @ingroup base_utilities
12911339
*/
12921340
friend void swap(expected& a, expected& b) noexcept(noexcept(a.swap(b))) { a.swap(b); }
12931341
};

base/include/base/hash/constexpr_fnv1a.hpp

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ constexpr uint64_t fnv1a64(const char* str, uint64_t seed = fnv1a64_offset_basis
9696
*
9797
* @return 64-bit hash value.
9898
*
99+
* @throws None.
100+
*
101+
* @note This function can be evaluated at compile time if the
102+
* input is a constant expression.
103+
*
104+
* @warning Different inputs may produce the same hash (collision).
105+
* Use string comparison as fallback when hashes match.
106+
*
99107
* @since 0.1
100108
* @ingroup base_hash
101109
*/
@@ -115,6 +123,13 @@ constexpr uint64_t fnv1a64(std::string_view sv, uint64_t seed = fnv1a64_offset_b
115123
*
116124
* @return 32-bit hash value.
117125
*
126+
* @throws None.
127+
*
128+
* @note The hash is computed at compile time for string literals.
129+
*
130+
* @warning Different inputs may produce the same hash (collision).
131+
* Use string comparison as fallback when hashes match.
132+
*
118133
* @since 0.1
119134
* @ingroup base_hash
120135
*/
@@ -132,6 +147,14 @@ constexpr uint32_t fnv1a32(const char* str, uint32_t seed = fnv1a32_offset_basis
132147
*
133148
* @return 32-bit hash value.
134149
*
150+
* @throws None.
151+
*
152+
* @note This function can be evaluated at compile time if the
153+
* input is a constant expression.
154+
*
155+
* @warning Different inputs may produce the same hash (collision).
156+
* Use string comparison as fallback when hashes match.
157+
*
135158
* @since 0.1
136159
* @ingroup base_hash
137160
*/
@@ -148,8 +171,19 @@ constexpr uint32_t fnv1a32(std::string_view sv, uint32_t seed = fnv1a32_offset_b
148171
*
149172
* Enables syntax: `"TokenName"_hash` for compile-time hash computation.
150173
*
151-
* @since 0.1
152-
* @ingroup base_hash
174+
* @param[in] str Null-terminated string to hash.
175+
* @param[in] len Length of the string (unused, required by UDL syntax).
176+
*
177+
* @return 64-bit hash value.
178+
*
179+
* @throws None.
180+
*
181+
* @note This function is constexpr and evaluated at compile time.
182+
*
183+
* @warning None.
184+
*
185+
* @since 0.1
186+
* @ingroup base_hash
153187
*
154188
* @code
155189
* constexpr uint64_t h = "MyToken"_hash; // Compile-time hash

base/system/cpu/private/linux_impl/cpu_features.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@
1414
#include <vector>
1515

1616
/**
17-
* @brief Internal Windows Query for CPU features
17+
* @brief Internal Linux Query for CPU features.
1818
*
19-
* @param feats Output parameter to store detected CPU feature names
20-
* @return cf::expected<void, cf::CPUBonusInfoViewError>
19+
* @param[out] feats Output parameter to store detected CPU feature names.
20+
*
21+
* @throws None (error reporting via return code if applicable).
22+
*
23+
* @note None.
24+
*
25+
* @warning None.
26+
*
27+
* @since 0.1
28+
* @ingroup system_cpu
2129
*/
2230
void query_cpu_features(std::vector<std::string>& feats);

base/system/cpu/private/win_impl/cpu_features.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@
1414
#include <vector>
1515

1616
/**
17-
* @brief Internal Windows Query for CPU features
17+
* @brief Internal Windows Query for CPU features.
1818
*
19-
* @param feats Output parameter to store detected CPU feature names
20-
* @return cf::expected<void, cf::CPUBonusInfoViewError>
19+
* @param[out] feats Output parameter to store detected CPU feature names.
20+
*
21+
* @throws None (error reporting via return code if applicable).
22+
*
23+
* @note None.
24+
*
25+
* @warning None.
26+
*
27+
* @since 0.1
28+
* @ingroup system_cpu
2129
*/
2230
void query_cpu_features(std::vector<std::string>& feats);

base/system/memory/private/win_impl/dimm_info.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ namespace win_impl {
1919
/**
2020
* @brief Query DIMM (memory module) information using GetSystemFirmwareTable (SMBIOS).
2121
*
22-
* @param dimms Output vector to be populated with DIMM information
22+
* @param[out] dimms Output vector to be populated with DIMM information.
23+
*
24+
* @throws None.
25+
*
26+
* @note None.
27+
*
28+
* @warning None.
29+
*
30+
* @since 0.1
31+
* @ingroup system_memory
2332
*/
2433
void queryDimmInfo(std::vector<DimmInfo>& dimms);
2534

base/system/memory/private/win_impl/physical_memory.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ namespace win_impl {
1818
/**
1919
* @brief Query physical memory information using GlobalMemoryStatusEx.
2020
*
21-
* @param physical Output parameter for physical memory statistics
21+
* @param[out] physical Output parameter for physical memory statistics.
22+
*
23+
* @throws None.
24+
*
25+
* @note None.
26+
*
27+
* @warning None.
28+
*
29+
* @since 0.1
30+
* @ingroup system_memory
2231
*/
2332
void queryPhysicalMemory(PhysicalMemory& physical);
2433

base/system/memory/private/win_impl/process_memory.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ namespace win_impl {
1818
/**
1919
* @brief Query current process memory usage using GetProcessMemoryInfo.
2020
*
21-
* @param process Output parameter for process memory statistics
21+
* @param[out] process Output parameter for process memory statistics.
22+
*
23+
* @throws None.
24+
*
25+
* @note None.
26+
*
27+
* @warning None.
28+
*
29+
* @since 0.1
30+
* @ingroup system_memory
2231
*/
2332
void queryProcessMemory(ProcessMemory& process);
2433

base/system/memory/private/win_impl/swap_memory.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ namespace win_impl {
1818
/**
1919
* @brief Query swap space information using GlobalMemoryStatusEx.
2020
*
21-
* @param swap Output parameter for swap space statistics
21+
* @param[out] swap Output parameter for swap space statistics.
22+
*
23+
* @throws None.
24+
*
25+
* @note None.
26+
*
27+
* @warning None.
28+
*
29+
* @since 0.1
30+
* @ingroup system_memory
2231
*/
2332
void querySwapMemory(SwapMemory& swap);
2433

document/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# AI Helpers lol
2-
DOXYGEN_REQUEST.md
32
TODO.md

0 commit comments

Comments
 (0)