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 Dead Code 2 #699

Merged
merged 4 commits into from
Jun 5, 2019
Merged

Remove Dead Code 2 #699

merged 4 commits into from
Jun 5, 2019

Conversation

economon
Copy link
Member

@economon economon commented Jun 5, 2019

Proposed Changes

Give a brief overview of your contribution here in a few sentences.

More dead code removed after merging #652. Likely one or two more PRs to come with more removals.

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.

N/A

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags).
  • My contribution is commented and consistent with SU2 style.

@vdweide
Copy link
Contributor

vdweide commented Jun 5, 2019

@economon , when I compile this branch with all the debug flags I get the following warnings

../src/geometry_structure.cpp: In member function ‘virtual void CPhysicalGeometry::Set_MPI_Coord(CConfig*)’:
../src/geometry_structure.cpp:15933:33: warning: variable ‘iPeriodic_Index’ set but not used [-Wunused-but-set-variable]
unsigned short iDim, iMarker, iPeriodic_Index, MarkerS, MarkerR;
^~~~~~~~~~~~~~~
../src/geometry_structure.cpp: In member function ‘virtual void CPhysicalGeometry::Set_MPI_GridVel(CConfig*)’:
../src/geometry_structure.cpp:16066:33: warning: variable ‘iPeriodic_Index’ set but not used [-Wunused-but-set-variable]
unsigned short iDim, iMarker, iPeriodic_Index, MarkerS, MarkerR;
^~~~~~~~~~~~~~~
../src/geometry_structure.cpp: In member function ‘virtual void CPhysicalGeometry::Set_MPI_OldCoord(CConfig*)’:
../src/geometry_structure.cpp:16195:33: warning: variable ‘iPeriodic_Index’ set but not used [-Wunused-but-set-variable]
unsigned short iDim, iMarker, iPeriodic_Index, MarkerS, MarkerR;

Further inspection shows that iPeriodic_Index is used to retrieve the periodic transformations. However, these lines are commented

//angles = config->GetPeriodicRotation(iPeriodic_Index);
//translation = config->GetPeriodicTranslate(iPeriodic_Index);

Hence angles and translation get their default values of 0.0. Is this correct? These lines are not commented in develop. If it is correct, could you fix the compiler warning?

For the rest, I think this is a no-brainer and can be merged in quickly.

@economon
Copy link
Member Author

economon commented Jun 5, 2019

I see, those warnings didn’t pop up with LLVM on Mac.

Actually, in a next pass, each of those Set_MPI_* routines that carry the warnings will be deleted. I didn’t do it yet, because git was getting confused with the spacings again. None of those routines are active anywhere any longer, so even just removing that index variable is fine to get rid of the warning

@vdweide
Copy link
Contributor

vdweide commented Jun 5, 2019

Alright, do you want me to fix the warning?

@economon
Copy link
Member Author

economon commented Jun 5, 2019

Nope, one min please...

Copy link
Contributor

@vdweide vdweide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an easy one, I think. If the regression tests go through it can be merged in.

@economon economon merged commit 9fca37e into develop Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants