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 instances of CALL #460

Merged
merged 2 commits into from
Jul 19, 2023
Merged

remove instances of CALL #460

merged 2 commits into from
Jul 19, 2023

Conversation

MichaelRawson
Copy link
Contributor

In #412 we removed the need for CALL macros, but didn't actually remove them to facilitate easy code review. This actually removes them.

This was done mostly automatically with the following AWK script to conservatively remove CALL macros followed by any number of trailing blank lines:

BEGIN {
  trailing = 0
}

/^[[:space:]]*CALL *\( *".*" *\)( *;)* *$/ {
  trailing = 1
  next
}

/^[[:space:]]*$/ {
  if(!trailing) print $0
  next
}

{
  trailing = 0
  print $0
}

People with branches might want to apply the following one-liner to new files in their branches to get the same effect, although it's probably easier to merge/rebase/cherry-pick for existing files.

for file in `git ls-files | egrep '\.(hpp|cpp|c|h|cc)$'`; do echo $file; awk 'BEGIN {trailing=0}; /^[[:space:]]*CALL *\( *".*" *\)( *;)* *$/ { trailing=1; next } /^[[:space:]]*$/ { if(!trailing) print $0; next } { trailing=0; print $0 }' $file > /tmp/out; mv /tmp/out $file; done

I then manually cleaned up some awkward cases, deleted the macro definitions, and removed most includes of Debug/Tracer.hpp.

@MichaelRawson MichaelRawson merged commit 817a77f into master Jul 19, 2023
1 check passed
@MichaelRawson MichaelRawson deleted the michael-remove-call branch July 19, 2023 07:34
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