Skip to content
Open
  •  
  •  
  •  
18 changes: 9 additions & 9 deletions indra/integration_tests/llimage_libtest/llimage_libtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ LLPointer<LLImageRaw> load_image(const std::string &src_filename, int discard_le
// Load the header
if (!image->load(src_filename, 600))
{
return NULL;
return nullptr;
}
S32 h = ((LLImageJ2C*)(image.get()))->calcHeaderSize();
S32 d = (load_size > 0 ? ((LLImageJ2C*)(image.get()))->calcDiscardLevelBytes(load_size) : 0);
Expand All @@ -153,22 +153,22 @@ LLPointer<LLImageRaw> load_image(const std::string &src_filename, int discard_le
// Load the requested byte range
if (!image->load(src_filename, load_size))
{
return NULL;
return nullptr;
}
}
else
{
// This just loads the image file stream into a buffer. No decoding done.
if (!image->load(src_filename))
{
return NULL;
return nullptr;
}
}

if( (image->getComponents() != 3) && (image->getComponents() != 4) )
{
std::cout << "Image files with less than 3 or more than 4 components are not supported\n";
return NULL;
return nullptr;
}

if (output_stats)
Expand All @@ -179,7 +179,7 @@ LLPointer<LLImageRaw> load_image(const std::string &src_filename, int discard_le
LLPointer<LLImageRaw> raw_image = new LLImageRaw;

// Set the image restriction on load in the case of a j2c image
if ((image->getCodec() == IMG_CODEC_J2C) && ((discard_level != -1) || (region != NULL)))
if ((image->getCodec() == IMG_CODEC_J2C) && ((discard_level != -1) || (region != nullptr)))
{
// That method doesn't exist (and likely, doesn't make sense) for any other image file format
// hence the required cryptic cast.
Expand All @@ -188,7 +188,7 @@ LLPointer<LLImageRaw> load_image(const std::string &src_filename, int discard_le

if (!image->decode(raw_image, 0.0f))
{
return NULL;
return nullptr;
}

return raw_image;
Expand Down Expand Up @@ -356,7 +356,7 @@ int main(int argc, char** argv)
// Other optional parsed arguments
bool analyze_performance = false;
bool image_stats = false;
int* region = NULL;
int* region = nullptr;
int discard_level = -1;
int load_size = 0;
int precincts_size = -1;
Expand All @@ -368,7 +368,7 @@ int main(int argc, char** argv)
// Init whatever is necessary
ll_init_apr();
LLImage::initClass();
LogThread* fast_timer_log_thread = NULL; // For performance and metric gathering
LogThread* fast_timer_log_thread = nullptr; // For performance and metric gathering

// Analyze command line arguments
for (int arg = 1; arg < argc; ++arg)
Expand Down Expand Up @@ -425,7 +425,7 @@ int main(int argc, char** argv)
{
std::cout << "--region arguments invalid" << std::endl;
delete [] region;
region = NULL;
region = nullptr;
}
}
else if (!strcmp(argv[arg], "--discard_level") || !strcmp(argv[arg], "-d"))
Expand Down
2 changes: 1 addition & 1 deletion indra/integration_tests/llui_libtest/llui_libtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class TestUIImage : public LLUIImage
{
public:
TestUIImage()
: LLUIImage( std::string(), NULL ) // NULL ImageGL, don't deref!
: LLUIImage( std::string(), nullptr ) // NULL ImageGL, don't deref!
{ }

/*virtual*/ S32 getWidth() const
Expand Down
24 changes: 12 additions & 12 deletions indra/llappearance/llavatarappearance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ LLAvatarAppearance::LLAvatarXmlInfo::~LLAvatarXmlInfo()
//-----------------------------------------------------------------------------
// Static Data
//-----------------------------------------------------------------------------
LLAvatarSkeletonInfo* LLAvatarAppearance::sAvatarSkeletonInfo = NULL;
LLAvatarAppearance::LLAvatarXmlInfo* LLAvatarAppearance::sAvatarXmlInfo = NULL;
LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAvatarDictionary = NULL;
LLAvatarSkeletonInfo* LLAvatarAppearance::sAvatarSkeletonInfo = nullptr;
LLAvatarAppearance::LLAvatarXmlInfo* LLAvatarAppearance::sAvatarXmlInfo = nullptr;
LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAvatarDictionary = nullptr;


LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
Expand All @@ -180,7 +180,7 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
for (U32 i = 0; i < mBakedTextureDatas.size(); i++ )
{
mBakedTextureDatas[i].mLastTextureID = IMG_DEFAULT_AVATAR;
mBakedTextureDatas[i].mTexLayerSet = NULL;
mBakedTextureDatas[i].mTexLayerSet = nullptr;
mBakedTextureDatas[i].mIsLoaded = false;
mBakedTextureDatas[i].mIsUsed = false;
mBakedTextureDatas[i].mMaskTexName = 0;
Expand Down Expand Up @@ -601,7 +601,7 @@ bool LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTre
//-----------------------------------------------------------------------------
bool LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 &volume_num, S32 &joint_num)
{
LLJoint* joint = NULL;
LLJoint* joint = nullptr;

LL_DEBUGS("BVH") << "bone info: name " << info->mName
<< " isJoint " << info->mIsJoint
Expand Down Expand Up @@ -679,7 +679,7 @@ bool LLAvatarAppearance::allocateCharacterJoints( U32 num )
if (mSkeleton.size() != num)
{
clearSkeleton();
mSkeleton = avatar_joint_list_t(num,NULL);
mSkeleton = avatar_joint_list_t(num, nullptr);
mNumBones = num;
}

Expand Down Expand Up @@ -715,7 +715,7 @@ bool LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
S32 current_volume_num = 0;
for (LLAvatarBoneInfo* bone_info : info->mBoneInfoList)
{
if (!setupBone(bone_info, NULL, current_volume_num, current_joint_num))
if (!setupBone(bone_info, nullptr, current_volume_num, current_joint_num))
{
LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL;
return false;
Expand Down Expand Up @@ -796,7 +796,7 @@ void LLAvatarAppearance::buildCharacter()
{
for (LLAvatarJointMesh* mesh : joint->mMeshParts)
{
mesh->setMesh(NULL);
mesh->setMesh(nullptr);
}
}

Expand Down Expand Up @@ -1084,7 +1084,7 @@ bool LLAvatarAppearance::loadMeshNodes()
const std::string &type = info->mType;
S32 lod = info->mLOD;

LLAvatarJointMesh* mesh = NULL;
LLAvatarJointMesh* mesh = nullptr;
U8 mesh_id = 0;
bool found_mesh_id = false;

Expand Down Expand Up @@ -1128,7 +1128,7 @@ bool LLAvatarAppearance::loadMeshNodes()
// Do not touch!!!
mesh->setColor( LLColor4::white );

LLPolyMesh *poly_mesh = NULL;
LLPolyMesh *poly_mesh = nullptr;

if (!info->mReferenceMeshName.empty())
{
Expand Down Expand Up @@ -1265,7 +1265,7 @@ LLJoint *LLAvatarAppearance::getCharacterJoint( U32 num )
if ((S32)num >= mSkeleton.size()
|| (S32)num < 0)
{
return NULL;
return nullptr;
}
if (!mSkeleton[num])
{
Expand Down Expand Up @@ -1295,7 +1295,7 @@ LLJoint* LLAvatarAppearance::findCollisionVolume(S32 volume_id)
{
if ((volume_id < 0) || (volume_id >= mNumCollisionVolumes))
{
return NULL;
return nullptr;
}

return &mCollisionVolumes[volume_id];
Expand Down
2 changes: 1 addition & 1 deletion indra/llappearance/llavatarjoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class alignas(16) LLAvatarJoint :
LLAvatarJoint();
LLAvatarJoint(S32 joint_num);
// *TODO: Only used for LLVOAvatarSelf::mScreenp. *DOES NOT INITIALIZE mResetAfterRestoreOldXform*
LLAvatarJoint(const std::string &name, LLJoint *parent = NULL);
LLAvatarJoint(const std::string& name, LLJoint* parent = nullptr);
virtual ~LLAvatarJoint();

// Gets the validity of this joint
Expand Down
28 changes: 14 additions & 14 deletions indra/llappearance/llavatarjointmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ LLVector3 totalSkinOffset(LLAvatarJoint *joint)
//-----------------------------------------------------------------------------
LLSkinJoint::LLSkinJoint()
{
mJoint = NULL;
mJoint = nullptr;
}

//-----------------------------------------------------------------------------
// ~LLSkinJoint
//-----------------------------------------------------------------------------
LLSkinJoint::~LLSkinJoint()
{
mJoint = NULL;
mJoint = nullptr;
}


Expand Down Expand Up @@ -138,8 +138,8 @@ LLColor4 LLAvatarJointMesh::sClothingInnerColor;
//-----------------------------------------------------------------------------
LLAvatarJointMesh::LLAvatarJointMesh()
:
mTexture( NULL ),
mLayerSet( NULL ),
mTexture( nullptr ),
mLayerSet( nullptr ),
mTestImageName( 0 ),
mFaceIndexCount(0)
{
Expand All @@ -151,12 +151,12 @@ LLAvatarJointMesh::LLAvatarJointMesh()
mShiny = 0.0f;
mCullBackFaces = true;

mMesh = NULL;
mMesh = nullptr;

mNumSkinJoints = 0;
mSkinJoints = NULL;
mSkinJoints = nullptr;

mFace = NULL;
mFace = nullptr;

mMeshID = 0;
mUpdateXform = false;
Expand All @@ -173,8 +173,8 @@ LLAvatarJointMesh::LLAvatarJointMesh()
//-----------------------------------------------------------------------------
LLAvatarJointMesh::~LLAvatarJointMesh()
{
mMesh = NULL;
mTexture = NULL;
mMesh = nullptr;
mTexture = nullptr;
freeSkinData();
}

Expand All @@ -196,7 +196,7 @@ void LLAvatarJointMesh::freeSkinData()
{
mNumSkinJoints = 0;
delete [] mSkinJoints;
mSkinJoints = NULL;
mSkinJoints = nullptr;
}

//--------------------------------------------------------------------
Expand Down Expand Up @@ -245,7 +245,7 @@ void LLAvatarJointMesh::setTexture( LLGLTexture *texture )
// texture and dynamic_texture are mutually exclusive
if( texture )
{
mLayerSet = NULL;
mLayerSet = nullptr;
//texture->bindTexture(0);
//texture->setClamp(true, true);
}
Expand All @@ -268,7 +268,7 @@ void LLAvatarJointMesh::setLayerSet( LLTexLayerSet* layer_set )
// texture and dynamic_texture are mutually exclusive
if( layer_set )
{
mTexture = NULL;
mTexture = nullptr;
}
}

Expand Down Expand Up @@ -297,7 +297,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
// release any existing skin joints
freeSkinData();

if ( mMesh == NULL )
if ( mMesh == nullptr )
{
return;
}
Expand Down Expand Up @@ -371,7 +371,7 @@ void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
// otherwise add our ancestor and ourselves
else
{
jrd.push_back(new LLJointRenderData(&ancestor->getWorldMatrix(), NULL));
jrd.push_back(new LLJointRenderData(&ancestor->getWorldMatrix(), nullptr));
LL_DEBUGS("Avatar") << "add2 ancestor joint[" << (jrd.size()-1) << "] = " << ancestor->getName() << LL_ENDL;
jrd.push_back(new LLJointRenderData(&current_joint->getWorldMatrix(), &js));
LL_DEBUGS("Avatar") << "add2 joint[" << (jrd.size()-1) << "] = " << current_joint->getName() << LL_ENDL;
Expand Down
24 changes: 12 additions & 12 deletions indra/llappearance/lldriverparam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
//-----------------------------------------------------------------------------

LLDriverParamInfo::LLDriverParamInfo() :
mDriverParam(NULL)
mDriverParam(nullptr)
{
}

Expand Down Expand Up @@ -158,16 +158,16 @@ void LLDriverParamInfo::toStream(std::ostream &out)
// LLDriverParam
//-----------------------------------------------------------------------------

LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */)
LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = nullptr */)
: LLViewerVisualParam(),
mDefaultVec(),
mDriven(),
mCurrentDistortionParam( NULL ),
mCurrentDistortionParam( nullptr ),
mAvatarAppearance(appearance),
mWearablep(wearable)
{
llassert(mAvatarAppearance);
llassert((mWearablep == NULL) || mAvatarAppearance->isSelf());
llassert((mWearablep == nullptr) || mAvatarAppearance->isSelf());
mDefaultVec.clear();
}

Expand All @@ -180,7 +180,7 @@ LLDriverParam::LLDriverParam(const LLDriverParam& pOther)
mWearablep(pOther.mWearablep)
{
llassert(mAvatarAppearance);
llassert((mWearablep == NULL) || mAvatarAppearance->isSelf());
llassert((mWearablep == nullptr) || mAvatarAppearance->isSelf());
}

LLDriverParam::~LLDriverParam()
Expand All @@ -189,7 +189,7 @@ LLDriverParam::~LLDriverParam()

bool LLDriverParam::setInfo(LLDriverParamInfo *info)
{
llassert(mInfo == NULL);
llassert(mInfo == nullptr);
if (info->mID < 0)
return false;
mInfo = info;
Expand Down Expand Up @@ -357,8 +357,8 @@ LLVector4a LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)

const LLVector4a* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
{
mCurrentDistortionParam = NULL;
const LLVector4a* v = NULL;
mCurrentDistortionParam = nullptr;
const LLVector4a* v = nullptr;
for(LLDrivenEntry& driven : mDriven)
{
v = driven.mParam->getFirstDistortion(index, poly_mesh);
Expand All @@ -377,10 +377,10 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **po
llassert( mCurrentDistortionParam );
if( !mCurrentDistortionParam )
{
return NULL;
return nullptr;
}

LLDrivenEntry* driven = NULL;
LLDrivenEntry* driven = nullptr;
entry_list_t::iterator iter;

// Set mDriven iteration to the right point
Expand All @@ -396,7 +396,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **po
llassert(driven);
if (!driven)
{
return NULL; // shouldn't happen, but...
return nullptr; // shouldn't happen, but...
}

// We're already in the middle of a param's distortions, so get the next one.
Expand Down Expand Up @@ -429,7 +429,7 @@ const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
{
if (0 > index || index >= mDriven.size())
{
return NULL;
return nullptr;
}
return mDriven[index].mParam;
}
Expand Down
2 changes: 1 addition & 1 deletion indra/llappearance/lldriverparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class alignas(16) LLDriverParam : public LLViewerVisualParam
// Hide the default constructor. Force construction with LLAvatarAppearance.
LLDriverParam() {}
public:
LLDriverParam(LLAvatarAppearance* appearance, LLWearable* wearable = NULL);
LLDriverParam(LLAvatarAppearance* appearance, LLWearable* wearable = nullptr);
~LLDriverParam();

// Special: These functions are overridden by child classes
Expand Down
Loading