-
Notifications
You must be signed in to change notification settings - Fork 4
Cleanups #32
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
Cleanups #32
Conversation
WalkthroughThis pull request removes the TSharedPtr component from the build process by deleting its implementation and associated unit tests. It also enhances the RandomGenerator module by updating functions to return booleans and adding null-pointer checks with assertions. Minor changes include updating preprocessor macros in the FileSystem module for Windows compatibility and revising the copyright year in the Hash module. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as "Caller"
participant RG as "RandomGenerator"
Caller->>RG: Call mersenne_twister(seed, len)
RG->>RG: Call mersenne_twister_vector_init(seedPoints, len)
alt seedPoints is null
RG-->>Caller: Return false (initialization failed)
else
RG-->>Caller: Return true (initialization succeeded)
end
RG->>RG: Call mersenne_twister_vector_update(p)
alt p is null
RG-->>Caller: Return false (update failed)
else
RG-->>Caller: Return true (update succeeded)
end
RG->>Caller: Assert overall success (ok)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
code/Random/RandomGenerator.cpp (2)
4-4
: Update copyright year to reflect current date.The copyright year extends to 2025, which is beyond the current date (February 2025). Consider updating it to 2024.
-Copyright (c) 2014-2025 Kim Kulling +Copyright (c) 2014-2024 Kim Kulling
95-95
: Consider using a more secure seeding mechanism.Using
time(nullptr)
for seeding the random number generator is predictable and not suitable for security-critical applications. Consider using a more secure source of entropy like/dev/urandom
on Unix systems orCryptGenRandom
on Windows.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
CMakeLists.txt
(0 hunks)code/Random/RandomGenerator.cpp
(5 hunks)include/cppcore/Common/Hash.h
(1 hunks)include/cppcore/Common/TSharedPtr.h
(0 hunks)include/cppcore/IO/FileSystem.h
(2 hunks)test/common/TSharedPtrTest.cpp
(0 hunks)
💤 Files with no reviewable changes (3)
- include/cppcore/Common/TSharedPtr.h
- CMakeLists.txt
- test/common/TSharedPtrTest.cpp
✅ Files skipped from review due to trivial changes (2)
- include/cppcore/Common/Hash.h
- include/cppcore/IO/FileSystem.h
🔇 Additional comments (3)
code/Random/RandomGenerator.cpp (3)
31-32
: Great use of constexpr!Using
constexpr
for these constants is a good improvement as it enables compile-time evaluation and better optimization opportunities.
34-47
: Good error handling improvement!The changes improve robustness by:
- Adding nullptr check for input pointer
- Returning a boolean status to indicate success/failure
49-65
: Good error handling improvement!The changes improve robustness by:
- Adding nullptr check for input pointer
- Returning a boolean status to indicate success/failure
|
Summary by CodeRabbit
Chores
Refactor