Skip to content

Project modernization#630

Draft
ModMaker101 wants to merge 5 commits intosmartcmd:mainfrom
ModMaker101:feat/project-modernization
Draft

Project modernization#630
ModMaker101 wants to merge 5 commits intosmartcmd:mainfrom
ModMaker101:feat/project-modernization

Conversation

@ModMaker101
Copy link
Contributor

Description

This replaces all C-style casts in the codebase with their appropriate C++-style equivalent. This improves type safety.

Changes

Previous Behavior

The codebase relied on C-style cases like crazy. The C-style casts lack type safety and can performant multiple types of conversions implicitly.

Root Cause

The original code used C-style cases because they were new/didn't exist when this was written. This over time can make it harder to program especially when it in C++.

New Behavior

Most C=style casts now use their C++ equivalent.

Fix Implementation

  • Went through the codebase and replaced most of the C-style casts with C++ ones.

AI Use Disclosure

No.

@ModMaker101
Copy link
Contributor Author

Dang it why is the boat commit there. Oh well.

@ModMaker101
Copy link
Contributor Author

Ready to merge.

@EnderActually
Copy link
Contributor

Dang it why is the boat commit there. Oh well.

Should have probably made a separate fork to prevent that.

@void2012
Copy link
Collaborator

void2012 commented Mar 5, 2026

Please keep the old boat code because we try to achieve feature accuracy

@void2012 void2012 marked this pull request as draft March 5, 2026 23:52
@ModMaker101
Copy link
Contributor Author

That boat code is from this Pr #615 its a fix I just made a new branch based of my boat fix branch on accident

@ModMaker101 ModMaker101 marked this pull request as ready for review March 6, 2026 00:06
@ModMaker101 ModMaker101 marked this pull request as draft March 6, 2026 00:06
@ModMaker101
Copy link
Contributor Author

If you don't mind me asking why did you make the PR a draft?

@void2012
Copy link
Collaborator

void2012 commented Mar 6, 2026

There are examples where int is used in place of where size_t is used, especially for object sizes, array subscripts and std::wstring::find_* functions. Could you please work on this, too? For the sake of the name of this PR. This may also hunt some obscure bugs.

@void2012
Copy link
Collaborator

void2012 commented Mar 6, 2026

Also, I think it makes sense to get rid off NULL, std::shared_ptr(new(...)) in favor of std::make_shared and other kinds of modernizations that can be done (semi-)automatically with clang-tidy(although some of those should be checked manually because sometimes it breaks the code. I think all of it can be done in this PR.

@ModMaker101
Copy link
Contributor Author

Alright I'll work on it.

@void2012
Copy link
Collaborator

void2012 commented Mar 6, 2026

I enabled all modernize-* checks in .clang-tidy but today plan to add even more checks for aggressive standard conforming refactoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants