From 658f75cf7bd3d8e23f3d32b03ed27e548d168391 Mon Sep 17 00:00:00 2001 From: Joachim Wuttke <j.wuttke@fz-juelich.de> Date: Wed, 29 Nov 2023 12:12:05 +0100 Subject: [PATCH] mv constant to prevent error in clang-tidy --- .clang-tidy | 1 - Device/Data/Datafield.cpp | 6 +++--- Device/Resolution/ConvolutionDetectorResolution.h | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 9048f4f3b0c..f3bee573b94 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -121,7 +121,6 @@ Checks: '*, -bugprone-misplaced-widening-cast, -clang-analyzer-core.CallAndMessage, -clang-analyzer-optin.cplusplus.VirtualCall, --clang-diagnostic-error, -cppcoreguidelines-pro-type-const-cast, -cppcoreguidelines-pro-type-static-cast-downcast, -google-runtime-references, diff --git a/Device/Data/Datafield.cpp b/Device/Data/Datafield.cpp index 27d6c2c9f1e..43eb227b0f3 100644 --- a/Device/Data/Datafield.cpp +++ b/Device/Data/Datafield.cpp @@ -27,9 +27,6 @@ namespace { -auto const seed = 123; -auto urbg = std::mt19937(seed); - PyObject* npExport(const Frame& frame, const std::vector<double>& flatData) { if (flatData.empty()) @@ -429,6 +426,9 @@ Datafield Datafield::flat() const Datafield Datafield::noisy(double prefactor, double minimum) const { + auto const seed = 123; + static auto urbg = std::mt19937(seed); + std::vector<double> outval(size()); std::vector<double> errval(size()); for (size_t i = 0; i < size(); ++i) { diff --git a/Device/Resolution/ConvolutionDetectorResolution.h b/Device/Resolution/ConvolutionDetectorResolution.h index 8bb29dd9128..f32e4adad1f 100644 --- a/Device/Resolution/ConvolutionDetectorResolution.h +++ b/Device/Resolution/ConvolutionDetectorResolution.h @@ -41,7 +41,7 @@ public: std::string className() const final { return "ConvolutionDetectorResolution"; } //! Convolve given intensities with the encapsulated resolution. - void execDetectorResolution(Datafield* p_intensity_map) const override; + void execDetectorResolution(Datafield* df) const override; const IResolutionFunction2D* getResolutionFunction2D() const; @@ -52,8 +52,8 @@ protected: private: void setResolutionFunction(const IResolutionFunction2D& resFunc); - void apply1dConvolution(Datafield* p_intensity_map) const; - void apply2dConvolution(Datafield* p_intensity_map) const; + void apply1dConvolution(Datafield* df) const; + void apply2dConvolution(Datafield* df) const; double getIntegratedPDF1d(double x, double step) const; double getIntegratedPDF2d(double x, double step_x, double y, double step_y) const; -- GitLab