File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,14 +61,14 @@ class observer_ptr {
6161 " Template parameter T cannot be void"
6262 );
6363public:
64- using element_type = std::remove_extent_t <T>;
64+ using element_type = std::remove_extent_t <T>;
6565
6666 // Default constructor: initialize to nullptr
6767 constexpr observer_ptr () noexcept : ptr(nullptr ) {}
6868 constexpr observer_ptr (std::nullptr_t ) noexcept : ptr(nullptr ) {}
6969
7070 // Constructor from raw pointer (implicit conversions allowed)
71- constexpr observer_ptr (T* p) noexcept : ptr(p) {}
71+ constexpr explicit observer_ptr (T* p) noexcept : ptr(p) {}
7272
7373 // Copy constructor and assignment
7474 constexpr observer_ptr (const observer_ptr&) noexcept = default;
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ class LightSourceDefinitions {
7575
7676 LightSourceRef GetLightSource (size_t n) const { return lights[n]; }
7777 LightSourcePtr GetLightSourcePtr (size_t n) const {
78- return std::addressof (lights[n].get ());
78+ return LightSourcePtr ( std::addressof (lights[n].get () ));
7979 }
8080
8181 auto ViewEnvLightSources () {
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ FilmPtr PathOCLNativeRenderThread::GetThreadFilmPtr() {
8989 auto * thread0 = static_cast <PathOCLNativeRenderThread *>(
9090 engine->renderNativeThreads [0 ]
9191 );
92- return thread0->threadFilm .get ();
92+ return FilmPtr ( thread0->threadFilm .get () );
9393}
9494
9595FilmRef PathOCLNativeRenderThread::GetThreadFilm () {
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ void TilePathCPURenderThread::RenderFunc(std::stop_token stop_token) {
108108 // Render the tile
109109 // ----------------------------------------------------------------------
110110
111- sampler.Init (&tileWork, tileFilm.get ());
111+ sampler.Init (&tileWork, FilmPtr ( tileFilm.get () ));
112112
113113 for (u_int y = 0 ; y < tileWork.GetCoord ().height && !interruptionRequested; ++y) {
114114 for (u_int x = 0 ; x < tileWork.GetCoord ().width && !interruptionRequested; ++x) {
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ LightSourceConstPtr LightSourceDefinitions::GetLightSourcePtr(const string &name
101101 if (e == lightsByName.end ())
102102 throw runtime_error (" Reference to an undefined LightSource in LightSourceDefinitions::GetLightSource(): " + name);
103103
104- return e->second .get ();
104+ return LightSourceConstPtr ( e->second .get () );
105105}
106106
107107LightSourcePtr LightSourceDefinitions::GetLightSourcePtr (const string &name) {
@@ -111,7 +111,7 @@ LightSourcePtr LightSourceDefinitions::GetLightSourcePtr(const string &name) {
111111 if (e == lightsByName.end ())
112112 throw runtime_error (" Reference to an undefined LightSource in LightSourceDefinitions::GetLightSource(): " + name);
113113
114- return e->second .get ();
114+ return LightSourcePtr ( e->second .get () );
115115}
116116
117117TriangleLightConstRef LightSourceDefinitions::GetLightSourceByMeshAndTriIndex (const u_int meshIndex, const u_int triIndex) const {
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ LightSourcePtr DistributionLightStrategy::SampleLights(
6060 assert ((lightIndex >= 0 ) && (lightIndex < scene.GetLightSources ().GetSize ()));
6161
6262 if (*pdf > 0 .f )
63- return &scene.GetLightSources ().GetLightSource (lightIndex);
63+ return LightSourcePtr ( &scene.GetLightSources ().GetLightSource (lightIndex) );
6464 else
6565 return nullptr ;
6666 } else
You can’t perform that action at this time.
0 commit comments