tests: the synthetic merged reflections are built without narrowing conversions
MergedReflection's I, sigma and d are floats; the designated initialisers fed them doubles, which is a narrowing conversion in a braced initialiser and five of the nine default-visible warnings the project emitted. The casts are what the compiler was doing anyway - the values are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011GxZqDiFP3KqriBhNdcR56
This commit is contained in:
@@ -88,9 +88,9 @@ namespace {
|
||||
.h = h,
|
||||
.k = k,
|
||||
.l = l,
|
||||
.I = absent ? 0.0 : SyntheticIntensityFromAsu(asu),
|
||||
.I = static_cast<float>(absent ? 0.0 : SyntheticIntensityFromAsu(asu)),
|
||||
.sigma = 1.0,
|
||||
.d = CalcSyntheticD(h, k, l)
|
||||
.d = static_cast<float>(CalcSyntheticD(h, k, l))
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -323,7 +323,8 @@ TEST_CASE("SearchSpaceGroup operator correlation reads symmetry, not the resolut
|
||||
const double jitter = SyntheticIntensityFromAsu(gemmi::Op::Miller{{h, k, l}}) / 350.0;
|
||||
const double I = 1.0e5 * falloff * jitter;
|
||||
merged.push_back(MergedReflection{
|
||||
.h = h, .k = k, .l = l, .I = I, .sigma = I / 20.0, .d = d});
|
||||
.h = h, .k = k, .l = l, .I = static_cast<float>(I),
|
||||
.sigma = static_cast<float>(I / 20.0), .d = static_cast<float>(d)});
|
||||
}
|
||||
return merged;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user