Merge pull request #950 from daleglass-overte/fix-warnings

Fix C++20 warnings
This commit is contained in:
Dale Glass 2024-05-04 19:40:21 +02:00 committed by GitHub
commit f9ffccfe00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 39 additions and 39 deletions

View file

@ -64,7 +64,7 @@ void LODManager::setRenderTimes(float presentTime, float engineRunTime, float ba
}
void LODManager::autoAdjustLOD(float realTimeDelta) {
std::lock_guard<std::mutex> { _automaticLODLock };
std::lock_guard<std::mutex> lock{ _automaticLODLock };
// The "render time" is the worse of:
// - engineRunTime: Time spent in the render thread in the engine producing the gpu::Frame N
@ -300,7 +300,7 @@ void LODManager::resetLODAdjust() {
}
void LODManager::setAutomaticLODAdjust(bool value) {
std::lock_guard<std::mutex> { _automaticLODLock };
std::lock_guard<std::mutex> lock{ _automaticLODLock };
_automaticLODAdjust = value;
saveSettings();
emit autoLODChanged();

View file

@ -402,7 +402,7 @@ public:
public:
typedef T Data;
Data _data;
Cache<T>(const Data& data) : _data(data) {}
Cache(const Data& data) : _data(data) {}
static size_t _max;
class Vector {

View file

@ -387,8 +387,8 @@ public:
U t;
return std::make_shared<gpu::Buffer>(sizeof(U), (const gpu::Byte*) &t, sizeof(U));
}
~StructBuffer<T>() {};
StructBuffer<T>() : gpu::BufferView(makeBuffer<T>()) {}
~StructBuffer() {};
StructBuffer() : gpu::BufferView(makeBuffer<T>()) {}
T& edit() {

View file

@ -48,8 +48,8 @@ private:
template <class T, int MAX_NUM_SAMPLES> class MovingAverage {
public:
MovingAverage<T, MAX_NUM_SAMPLES>() {}
MovingAverage<T, MAX_NUM_SAMPLES>(const MovingAverage<T, MAX_NUM_SAMPLES>& other) {
MovingAverage() {}
MovingAverage(const MovingAverage<T, MAX_NUM_SAMPLES>& other) {
*this = other;
}
MovingAverage<T, MAX_NUM_SAMPLES>& operator=(const MovingAverage<T, MAX_NUM_SAMPLES>& other) {