Skip to content
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

[Feature] coding style guide new content suggestions #36544

Open
cecille opened this issue Nov 18, 2024 · 0 comments
Open

[Feature] coding style guide new content suggestions #36544

cecille opened this issue Nov 18, 2024 · 0 comments

Comments

@cecille
Copy link
Contributor

cecille commented Nov 18, 2024

Feature description

...

Content suggestions from the original PR:

casting:
Use C++-style casts (e.g. static_cast) for type conversions instead of C-style casts.
Whenever possible, use SafePointerCast from SafePointerCast.h instead of reinterpret_cast for pointer casting, since it is safer and adds alignment and type safety checks.
Avoid casting function pointers to void *, as this is considered undefined behavior in C++. (we currently have LambdaBridge.h that can be used as alternative, I dont know if its sensible to add it here)

Use Span/ByteSpan instead of C-style pointers for buffers

Variable, class, file naming?
PascalCasing
constexpr preferred to defines
class enum
Maybe some guidance for .gn file structure

refs:
#36275 (comment)
#36275 (comment)
#36275 (comment)

Platform

core

Platform Version(s)

No response

Anything else?

No response

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

No branches or pull requests

1 participant