-
Notifications
You must be signed in to change notification settings - Fork 467
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
Proposal: Remove _Ptr(_Const) typedefs #2785
Comments
I am fully in favour of removing these. I continually struggle to know what types I'm dealing with at any given time. |
I'm not really pro or con this change. My initial reason to introduce these types was to be able to check (search) which types I already converted during the conversion from global memory handling to reference counted memory handling. What I don't like are the @xzyfer not sure I got your comment right, but the difference is pretty easy. |
2 pro, 1 neutral, let's do this. @mgreter Is now a good time or would you like to finish the subweave PR first (to reduce conflicts)? |
Removes these typedefs because pointers should be handled with care. Having them visually stand out in the code helps us avoid common pitfalls, such as accidentally using `Ptr` instead of `Obj`. This change has been automatically generated using the following command: ```bash find src \( -name '*.cpp' -o -name '*.hpp' \) -exec sed -i \ '/typedef.*_Ptr[_;]/d;'\ 's/\([A-Za-z_]*\)_Ptr_Const/const \1*/g;'\ 's/\([A-Za-z_]*\)_Ptr/\1*/g;'\ 's/\([a-z]\)##\*/\1*/g' '{}' \+ ``` Fixes sass#2785
Removes these typedefs because pointers should be handled with care. Having them visually stand out in the code helps us avoid common pitfalls, such as accidentally using `Ptr` instead of `Obj`. This change has been automatically generated using the following command: ```bash find src \( -name '*.cpp' -o -name '*.hpp' \) -exec sed -i \ '/typedef.*_Ptr[_;]/d;'\ 's/\([A-Za-z_]*\)_Ptr_Const/const \1*/g;'\ 's/\([A-Za-z_]*\)_Ptr/\1*/g;'\ 's/\([a-z]\)##\*/\1*/g' '{}' \+ ``` Fixes sass#2785
Removes these typedefs because pointers should be handled with care. Having them visually stand out in the code helps us avoid common pitfalls, such as accidentally using `Ptr` instead of `Obj`. This change has been automatically generated using the following command: ```bash find src \( -name '*.cpp' -o -name '*.hpp' \) -exec sed -i \ '/typedef.*_Ptr[_;]/d;'\ 's/\([A-Za-z_]*\)_Ptr_Const/const \1*/g;'\ 's/\([A-Za-z_]*\)_Ptr/\1*/g;'\ 's/\([a-z]\)##\*/\1*/g' '{}' \+ ``` Fixes sass#2785
Removes these typedefs because pointers should be handled with care. Having them visually stand out in the code helps us avoid common pitfalls, such as accidentally using `Ptr` instead of `Obj`. This change has been automatically generated using the following command: ```bash find src \( -name '*.cpp' -o -name '*.hpp' \) -exec sed -i \ '/typedef.*_Ptr[_;]/d;'\ 's/\([A-Za-z_]*\)_Ptr_Const/const \1*/g;'\ 's/\([A-Za-z_]*\)_Ptr/\1*/g;'\ 's/\([a-z]\)##\*/\1*/g' '{}' \+ ``` Fixes #2785
The libsass codebase uses typedefs for pointers and const pointers, such as
Expression_Ptr
.However, pointers should be handled with care but it's easy to miss a pointer if it doesn't look like one.
@xzyfer @mgreter What do you think about removing the
_Ptr
and_Ptr_Const
typedefs?This can be done with the following command (GNU sed, for macOS and FreeBSD use
sed -i ''
):The text was updated successfully, but these errors were encountered: