diff --git a/EffectLoad.cpp b/EffectLoad.cpp index 05fced7..95e3509 100644 --- a/EffectLoad.cpp +++ b/EffectLoad.cpp @@ -1916,6 +1916,14 @@ HRESULT CEffectLoader::LoadAssignments( uint32_t Assignments, SAssignment **ppAs case ELHS_GeometryShaderSO: assert(0); // Should never happen + #if (__cplusplus >= 201703L) + [[fallthrough]]; + #elif defined(__clang__) + [[clang::fallthrough]]; + #elif defined(_MSC_VER) + __fallthrough; + #endif + default: VHD( E_FAIL, "Internal loading error: invalid shader type." ); } diff --git a/inc/d3dxGlobal.h b/inc/d3dxGlobal.h index 2018c19..5d2bef2 100644 --- a/inc/d3dxGlobal.h +++ b/inc/d3dxGlobal.h @@ -680,7 +680,12 @@ static uint32_t ComputeHash(_In_reads_bytes_(cbToHash) const uint8_t *pb, _In_ u c += cbToHash; - switch(cbLeft) // all the case statements fall through +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable:26819, "all the case statements fall through") +#endif + + switch(cbLeft) { case 11: c+=((uint32_t) pb[10] << 24); case 10: c+=((uint32_t) pb[9] << 16); @@ -696,6 +701,10 @@ static uint32_t ComputeHash(_In_reads_bytes_(cbToHash) const uint8_t *pb, _In_ u case 1 : a+=pb[0]; } +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + HASH_MIX(a,b,c); return c; @@ -733,7 +742,12 @@ static uint32_t ComputeHashLower(_In_reads_bytes_(cbToHash) const uint8_t *pb, _ for( size_t i = 0; i < cbLeft; i++ ) pbT[i] = (uint8_t)tolower(pb[i]); - switch(cbLeft) // all the case statements fall through +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable:26819, "all the case statements fall through") +#endif + + switch(cbLeft) { case 11: c+=((uint32_t) pbT[10] << 24); case 10: c+=((uint32_t) pbT[9] << 16); @@ -749,6 +763,10 @@ static uint32_t ComputeHashLower(_In_reads_bytes_(cbToHash) const uint8_t *pb, _ case 1 : a+=pbT[0]; } +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + HASH_MIX(a,b,c); return c;