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

Remove _Ptr(_Const) typedefs #2847

Merged
merged 1 commit into from
Mar 20, 2019
Merged

Remove _Ptr(_Const) typedefs #2847

merged 1 commit into from
Mar 20, 2019

Conversation

glebm
Copy link
Contributor

@glebm glebm commented Mar 19, 2019

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 (GNU sed, for macOS and FreeBSD use sed -i ''):

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

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
@glebm
Copy link
Contributor Author

glebm commented Mar 19, 2019

@xzyfer Merging this won't cause any problems for @mgreter, as he can just apply the same sed command to his outstanding PR.

@xzyfer xzyfer merged commit c55821a into sass:master Mar 20, 2019
@glebm glebm deleted the ptr-rename branch April 28, 2019 12:33
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.

2 participants