Changes towards C++20 compatibility (#2520)

master
Ansariel Hiller 2024-09-09 12:02:34 +02:00 committed by GitHub
parent 2f692fbac3
commit d91d39fa0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 26 additions and 18 deletions

View File

@ -226,7 +226,7 @@ bool LLApp::parseCommandOptions(int argc, wchar_t** wargv)
if(wargv[ii][0] != '-')
{
LL_INFOS() << "Did not find option identifier while parsing token: "
<< wargv[ii] << LL_ENDL;
<< (intptr_t)wargv[ii] << LL_ENDL;
return false;
}
int offset = 1;

View File

@ -89,10 +89,10 @@ private:
}
// Given arbitrary CALLABLE, which might be a lambda, how are we
// supposed to obtain its signature for std::packaged_task? It seems
// redundant to have to add an argument list to engage result_of, then
// redundant to have to add an argument list to engage invoke_result_t, then
// add the argument list again to complete the signature. At least we
// only support a nullary CALLABLE.
std::packaged_task<typename std::result_of<CALLABLE()>::type()> mTask;
std::packaged_task<std::invoke_result_t<CALLABLE>()> mTask;
};
};

View File

@ -418,6 +418,17 @@ private:
bool mStayUnique;
};
template<typename Type>
bool operator!=(Type* lhs, const LLPointer<Type>& rhs)
{
return (lhs != rhs.get());
}
template<typename Type>
bool operator==(Type* lhs, const LLPointer<Type>& rhs)
{
return (lhs == rhs.get());
}
// boost hash adapter
template <class Type>

View File

@ -139,7 +139,7 @@ namespace LLPredicate
Rule()
{}
void require(ENUM e, bool match)
void mandate(ENUM e, bool match)
{
mRule.set(e, match);
}
@ -154,7 +154,7 @@ namespace LLPredicate
return (mRule && value).someSet();
}
bool requires(const Value<ENUM> value) const
bool mandates(const Value<ENUM> value) const
{
return (mRule && value).someSet() && (!mRule && value).noneSet();
}

View File

@ -92,7 +92,7 @@ namespace tut
op->setReplyPath(LLCore::HttpOperation::HttpReplyQueuePtr_t(), h1);
// Check ref count
ensure(op.unique() == 1);
ensure(op.use_count() == 1);
// release the reference, releasing the operation but
// not the handlers.

View File

@ -261,7 +261,7 @@ void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) {
event.insert("event",LLSD("keyDown"));
LL_DEBUGS() << "[VITA] unicode key: " << uni_char << LL_ENDL;
LL_DEBUGS() << "[VITA] unicode key: " << (int)uni_char << LL_ENDL;
LL_DEBUGS() << "[VITA] dumpxml " << LLSDXMLStreamer(event) << "\n" << LL_ENDL;

View File

@ -29,8 +29,6 @@
#include "lldeferredsounds.h"
#include "llaudioengine.h"
void LLDeferredSounds::deferSound(SoundData& sound)
{
soundVector.push_back(sound);

View File

@ -28,8 +28,7 @@
#define LL_LLDEFERREDSOUNDS_H
#include "llsingleton.h"
struct SoundData;
#include "llaudioengine.h"
class LLDeferredSounds : public LLSingleton<LLDeferredSounds>
{

View File

@ -757,7 +757,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
if (current_shader)
{
current_shader->uniform4f(LLShaderMgr::SPECULAR_COLOR, spec_color.mV[0], spec_color.mV[1], spec_color.mV[2], spec_color.mV[3]);
current_shader->uniform4f(LLShaderMgr::SPECULAR_COLOR, spec_color.mV[VRED], spec_color.mV[VGREEN], spec_color.mV[VBLUE], spec_color.mV[VALPHA]);
current_shader->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, env_intensity);
current_shader->uniform1f(LLShaderMgr::EMISSIVE_BRIGHTNESS, brightness);
}

View File

@ -300,7 +300,7 @@ bool LLSpatialGroup::addObject(LLDrawable *drawablep)
}
{
drawablep->setGroup(this);
setState(OBJECT_DIRTY | GEOM_DIRTY);
setState(static_cast<U32>(OBJECT_DIRTY) | static_cast<U32>(GEOM_DIRTY));
setOcclusionState(LLSpatialGroup::DISCARD_QUERY, LLSpatialGroup::STATE_MODE_ALL_CAMERAS);
gPipeline.markRebuild(this);
if (drawablep->isSpatialBridge())
@ -730,7 +730,7 @@ bool LLSpatialGroup::changeLOD()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL;
if (hasState(ALPHA_DIRTY | OBJECT_DIRTY))
if (hasState(static_cast<U32>(ALPHA_DIRTY) | static_cast<U32>(OBJECT_DIRTY)))
{
//a rebuild is going to happen, update distance and LoD
return true;

View File

@ -47,7 +47,7 @@
#include <unordered_map>
#define SG_STATE_INHERIT_MASK (OCCLUDED)
#define SG_INITIAL_STATE_MASK (DIRTY | GEOM_DIRTY)
#define SG_INITIAL_STATE_MASK (static_cast<U32>(DIRTY) | static_cast<U32>(GEOM_DIRTY))
class LLViewerOctreePartition;
class LLSpatialPartition;

View File

@ -503,7 +503,7 @@ S32 LLEmbeddedItems::getIndexFromEmbeddedChar(llwchar wch)
}
else
{
LL_WARNS() << "Embedded char " << wch << " not found, using 0" << LL_ENDL;
LL_WARNS() << "Embedded char " << (int)wch << " not found, using 0" << LL_ENDL;
return 0;
}
}

View File

@ -596,7 +596,7 @@ U32 LLVOGrass::getPartitionType() const
}
LLGrassPartition::LLGrassPartition(LLViewerRegion* regionp)
: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, true, regionp)
: LLSpatialPartition(static_cast<U32>(LLDrawPoolAlpha::VERTEX_DATA_MASK) | static_cast<U32>(LLVertexBuffer::MAP_TEXTURE_INDEX), true, regionp)
{
mDrawableType = LLPipeline::RENDER_TYPE_GRASS;
mPartitionType = LLViewerRegion::PARTITION_GRASS;

View File

@ -702,7 +702,7 @@ U32 LLVOPartGroup::getPartitionType() const
}
LLParticlePartition::LLParticlePartition(LLViewerRegion* regionp)
: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, true, regionp)
: LLSpatialPartition(static_cast<U32>(LLDrawPoolAlpha::VERTEX_DATA_MASK) | static_cast<U32>(LLVertexBuffer::MAP_TEXTURE_INDEX), true, regionp)
{
mRenderPass = LLRenderPass::PASS_ALPHA;
mDrawableType = LLPipeline::RENDER_TYPE_PARTICLES;