Skip to content

Remove Dead Code 2 - #699

Merged
economon merged 4 commits into
developfrom
feature_deadcode
Jun 5, 2019
Merged

Remove Dead Code 2#699
economon merged 4 commits into
developfrom
feature_deadcode

Conversation

@economon

@economon economon commented Jun 5, 2019

Copy link
Copy Markdown
Member

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

vdweide commented Jun 5, 2019

Copy link
Copy Markdown
Contributor

@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

economon commented Jun 5, 2019

Copy link
Copy Markdown
Member Author

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

vdweide commented Jun 5, 2019

Copy link
Copy Markdown
Contributor

Alright, do you want me to fix the warning?

@economon

economon commented Jun 5, 2019

Copy link
Copy Markdown
Member Author

Nope, one min please...

@vdweide vdweide left a comment

Copy link
Copy Markdown
Contributor

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