From effddefd2f36357e6a3b5192900679e5825e3657 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 4 Dec 2023 11:22:52 +0100 Subject: [PATCH] Fix non-constant-expression cannot be narrowed in initializer list Contributes to CURA-10831 --- src/gcodeExport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gcodeExport.cpp b/src/gcodeExport.cpp index 8372ba1656..8465874a50 100644 --- a/src/gcodeExport.cpp +++ b/src/gcodeExport.cpp @@ -1429,7 +1429,7 @@ void GCodeExport::writeFanCommand(double speed) else if (speed > 0) { const bool should_scale_zero_to_one = Application::getInstance().current_slice_->scene.settings.get("machine_scale_fan_speed_zero_to_one"); - *output_stream_ << "M106 S" << PrecisionedDouble{ (should_scale_zero_to_one ? 2u : 1u), (should_scale_zero_to_one ? speed : speed * 255) / 100 }; + *output_stream_ << "M106 S" << PrecisionedDouble{ static_cast((should_scale_zero_to_one ? 2u : 1u)), (should_scale_zero_to_one ? speed : speed * 255) / 100 }; if (fan_number_) { *output_stream_ << " P" << fan_number_;