From 7dc749fb31f77d6412c089f346d2c1d08e84b6ad Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sun, 13 Sep 2026 14:31:45 +0200 Subject: [PATCH] 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) Claude-Session: https://claude.ai/code/session_011GxZqDiFP3KqriBhNdcR56 --- tests/SearchSpaceGroupTest.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/SearchSpaceGroupTest.cpp b/tests/SearchSpaceGroupTest.cpp index c06b32acd..2e6361d8e 100644 --- a/tests/SearchSpaceGroupTest.cpp +++ b/tests/SearchSpaceGroupTest.cpp @@ -88,9 +88,9 @@ namespace { .h = h, .k = k, .l = l, - .I = absent ? 0.0 : SyntheticIntensityFromAsu(asu), + .I = static_cast(absent ? 0.0 : SyntheticIntensityFromAsu(asu)), .sigma = 1.0, - .d = CalcSyntheticD(h, k, l) + .d = static_cast(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(I), + .sigma = static_cast(I / 20.0), .d = static_cast(d)}); } return merged; };