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

Clang-Tidy 17: bugprone-switch-missing-default-case #3816

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Src/AmrCore/AMReX_Interp_2D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ facediv_face_interp (int ci, int cj, int /*ck*/,

break;
}
default : { break; }
}
}

Expand Down
1 change: 1 addition & 0 deletions Src/AmrCore/AMReX_Interp_3D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ facediv_face_interp (int ci, int cj, int ck,

break;
}
default : { break; }
}
}

Expand Down
1 change: 1 addition & 0 deletions Src/Base/AMReX_BLBackTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ BLBackTrace::handler(int s)
case SIGABRT:
amrex::ErrorStream() << "SIGABRT\n";
break;
default: break;
}

#if defined(AMREX_BACKTRACE_SUPPORTED) || defined(AMREX_TINY_PROFILING)
Expand Down
12 changes: 12 additions & 0 deletions Src/Base/AMReX_CoordSys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ CoordSys::AreaLo (const IntVect& point, int dir) const noexcept // NOLINT(readab
{
case 0: return dx[1];
case 1: return dx[0];
default:
AMREX_ASSERT(0);
}
return 0._rt; // to silent compiler warning
case RZ:
Expand All @@ -490,6 +492,8 @@ CoordSys::AreaLo (const IntVect& point, int dir) const noexcept // NOLINT(readab
{
case 0: return Real(TWOPI)*dx[1]*xlo[0];
case 1: return ((xlo[0]+dx[0])*(xlo[0]+dx[0])-xlo[0]*xlo[0])*static_cast<Real>(0.5*TWOPI);
default:
AMREX_ASSERT(0);
}
return 0._rt; // to silent compiler warning
default:
Expand All @@ -502,6 +506,8 @@ CoordSys::AreaLo (const IntVect& point, int dir) const noexcept // NOLINT(readab
case 0: return dx[1]*dx[2];
case 1: return dx[0]*dx[2];
case 2: return dx[1]*dx[0];
default:
AMREX_ASSERT(0);
}
#endif
return 0;
Expand All @@ -520,6 +526,8 @@ CoordSys::AreaHi (const IntVect& point, int dir) const noexcept // NOLINT(readab
{
case 0: return dx[1];
case 1: return dx[0];
default:
AMREX_ASSERT(0);
}
return 0._rt; // to silent compiler warning
case RZ:
Expand All @@ -528,6 +536,8 @@ CoordSys::AreaHi (const IntVect& point, int dir) const noexcept // NOLINT(readab
{
case 0: return Real(TWOPI)*dx[1]*xhi[0];
case 1: return (xhi[0]*xhi[0]-(xhi[0]-dx[0])*(xhi[0]-dx[0]))*static_cast<Real>(TWOPI*0.5);
default:
AMREX_ASSERT(0);
}
return 0._rt; // to silent compiler warning
default:
Expand All @@ -540,6 +550,8 @@ CoordSys::AreaHi (const IntVect& point, int dir) const noexcept // NOLINT(readab
case 0: return dx[1]*dx[2];
case 1: return dx[0]*dx[2];
case 2: return dx[1]*dx[0];
default:
AMREX_ASSERT(0);
}
#endif
return 0._rt;
Expand Down
2 changes: 2 additions & 0 deletions Src/Base/AMReX_FilCC_1D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct FilccCell
q(i,0,0,n) = -q(2*ilo-i-1,0,0,n);
break;
}
default: { break; }
}
}
else if (i > ihi)
Expand Down Expand Up @@ -111,6 +112,7 @@ struct FilccCell
q(i,0,0,n) = -q(2*ihi-i+1,0,0,n);
break;
}
default: { break; }
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions Src/Base/AMReX_FilCC_2D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct FilccCell
q(i,j,0,n) = -q(2*ilo-i-1,j,0,n);
break;
}
default: { break; }
}
}
else if (i > ihi)
Expand Down Expand Up @@ -116,6 +117,7 @@ struct FilccCell
q(i,j,0,n) = -q(2*ihi-i+1,j,0,n);
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -159,6 +161,7 @@ struct FilccCell
q(i,j,0,n) = -q(i,2*jlo-j-1,0,n);
break;
}
default: { break; }
}
}
else if (j > jhi)
Expand Down Expand Up @@ -201,6 +204,7 @@ struct FilccCell
q(i,j,0,n) = -q(i,2*jhi-j+1,0,n);
break;
}
default: { break; }
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions Src/Base/AMReX_FilCC_3D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct FilccCell
q(i,j,k,n) = -q(2*ilo-i-1,j,k,n);
break;
}
default: { break; }
}
}
else if (i > ihi)
Expand Down Expand Up @@ -115,6 +116,7 @@ struct FilccCell
q(i,j,k,n) = -q(2*ihi-i+1,j,k,n);
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -158,6 +160,7 @@ struct FilccCell
q(i,j,k,n) = -q(i,2*jlo-j-1,k,n);
break;
}
default: { break; }
}
}
else if (j > jhi)
Expand Down Expand Up @@ -200,6 +203,7 @@ struct FilccCell
q(i,j,k,n) = -q(i,2*jhi-j+1,k,n);
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -243,6 +247,7 @@ struct FilccCell
q(i,j,k,n) = -q(i,j,2*klo-k-1,n);
break;
}
default: { break; }
}
}
else if (k > khi)
Expand Down Expand Up @@ -285,6 +290,7 @@ struct FilccCell
q(i,j,k,n) = -q(i,j,2*khi-k+1,n);
break;
}
default: { break; }
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Src/Base/AMReX_FilFC_1D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct FilfcFace
q(i,0,0,n) = -q(2*ilo-i,0,0,n);
break;
}
default: { break; }
}
}
else if (i == ihi)
Expand Down Expand Up @@ -106,6 +107,7 @@ struct FilfcFace
q(i,0,0,n) = -q(2*ihi-i,0,0,n);
break;
}
default: { break; }
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions Src/Base/AMReX_FilFC_2D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct FilfcFace
: -q(2*ilo-i-1,j,0,n);
break;
}
default: { break; }
}
}
else if (i == ihi)
Expand Down Expand Up @@ -118,6 +119,7 @@ struct FilfcFace
: -q(2*ihi-i+1,j,0,n);
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -163,6 +165,7 @@ struct FilfcFace
: -q(i,2*jlo-j-1,0,n);
break;
}
default: { break; }
}
}
else if (j == jhi)
Expand Down Expand Up @@ -207,6 +210,7 @@ struct FilfcFace
: -q(i,2*jhi-j+1,0,n);
break;
}
default: { break; }
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions Src/Base/AMReX_FilFC_3D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ struct FilfcFace
: -q(2*ilo-i-1,j,k,n);
break;
}
default: { break; }
}
}
if (i == ihi)
Expand Down Expand Up @@ -121,6 +122,7 @@ struct FilfcFace
: -q(2*ihi-i+1,j,k,n);
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -166,6 +168,7 @@ struct FilfcFace
: -q(i,2*jlo-j-1,k,n);
break;
}
default: { break; }
}
}
else if (j == jhi)
Expand Down Expand Up @@ -210,6 +213,7 @@ struct FilfcFace
: -q(i,2*jhi-j+1,k,n);
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -255,6 +259,7 @@ struct FilfcFace
: -q(i,j,2*klo-k-1,n);
break;
}
default: { break; }
}
}
if (k == khi)
Expand Down Expand Up @@ -299,6 +304,7 @@ struct FilfcFace
: -q(i,j,2*khi-k+1,n);
break;
}
default: { break; }
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions Src/Base/AMReX_MultiFabUtil_2D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ void amrex_avgdown_faces (Box const& bx, Array4<T> const& crse,
}
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -157,6 +158,7 @@ void amrex_avgdown_faces (int i, int j, int, int n, Array4<T> const& crse,
crse(i,j,0,n+ccomp) = c * facInv;
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -206,6 +208,7 @@ void amrex_avgdown_edges (Box const& bx, Array4<Real> const& crse,
}
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -242,6 +245,7 @@ void amrex_avgdown_edges (int i, int j, int, int n, Array4<Real> const& crse,
crse(i,j,0,n+ccomp) = c * facInv;
break;
}
default: { break; }
}
}

Expand Down
4 changes: 4 additions & 0 deletions Src/Base/AMReX_MultiFabUtil_3D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ void amrex_avgdown_faces (Box const& bx, Array4<T> const& crse,
}
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -214,6 +215,7 @@ void amrex_avgdown_faces (int i, int j, int k, int n, Array4<T> const& crse,
crse(i,j,k,n+ccomp) = c * facInv;
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -287,6 +289,7 @@ void amrex_avgdown_edges (Box const& bx, Array4<Real> const& crse,
}
break;
}
default: { break; }
}
}

Expand Down Expand Up @@ -333,6 +336,7 @@ void amrex_avgdown_edges (int i, int j, int k, int n, Array4<Real> const& crse,
crse(i,j,k,n+ccomp) = c * facInv;
break;
}
default: { break; }
}
}

Expand Down
2 changes: 2 additions & 0 deletions Src/Base/AMReX_MultiFabUtil_nd_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void amrex_fill_slice_interp (Box const& bx, Array4<Real> slice,
break;
case 2:
khi = 1;
default: { break; }
}
} else {
switch (dir)
Expand All @@ -51,6 +52,7 @@ void amrex_fill_slice_interp (Box const& bx, Array4<Real> slice,
break;
case 2:
klo = -1;
default: { break; }
}
}

Expand Down
2 changes: 1 addition & 1 deletion Src/EB/AMReX_EB2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ BuildFromChkptFile (std::string const& fname,
max_coarsening_level, ngrow,
build_coarse_level_by_coarsening,
a_extend_domain_face));
}
} // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)

namespace {
int comp_max_crse_level (Box cdomain, const Box& domain)
Expand Down
Loading