Skip to content
Snippets Groups Projects
Commit 49247ea3 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

I hate reinterpret_cast. Especially when its not needed.

parent 7043fa37
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,7 @@ BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dp
S32 LLFontGL::getNumFaces(const std::string& filename)
{
if (mFontFreetype == reinterpret_cast<LLFontFreetype*>(NULL))
if (!mFontFreetype)
{
mFontFreetype = new LLFontFreetype;
}
......
......@@ -962,7 +962,7 @@ bool LLXUIParser::writeStringValue(Parser& parser, const void* val_ptr, name_sta
LLXMLNodePtr node = self.getNode(stack);
if (node.notNull())
{
const std::string* string_val = reinterpret_cast<const std::string*>(val_ptr);
const std::string* string_val = static_cast<const std::string*>(val_ptr);
if (string_val->find('\n') != std::string::npos
|| string_val->size() > MAX_STRING_ATTRIBUTE_SIZE)
{
......
......@@ -128,7 +128,7 @@ class OnIdleCallbackOneTime
static void onIdle(void *data)
{
gIdleCallbacks.deleteFunction(onIdle, data);
OnIdleCallbackOneTime* self = reinterpret_cast<OnIdleCallbackOneTime*>(data);
OnIdleCallbackOneTime* self = static_cast<OnIdleCallbackOneTime*>(data);
self->call();
delete self;
}
......@@ -159,7 +159,7 @@ class OnIdleCallbackRepeating
// Will keep getting called until the callable returns true.
static void onIdle(void *data)
{
OnIdleCallbackRepeating* self = reinterpret_cast<OnIdleCallbackRepeating*>(data);
OnIdleCallbackRepeating* self = static_cast<OnIdleCallbackRepeating*>(data);
bool done = self->call();
if (done)
{
......
......@@ -463,7 +463,7 @@ void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group)
// static
void LLFloaterPay::onCancel(void* data)
{
LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data);
LLFloaterPay* self = static_cast<LLFloaterPay*>(data);
if(self)
{
self->closeFloater();
......@@ -473,7 +473,7 @@ void LLFloaterPay::onCancel(void* data)
// static
void LLFloaterPay::onKeystroke(LLLineEditor*, void* data)
{
LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data);
LLFloaterPay* self = static_cast<LLFloaterPay*>(data);
if(self)
{
// enable the Pay button when amount is non-empty and positive, disable otherwise
......
......@@ -618,7 +618,7 @@ void LLToolBrushLand::determineAffectedRegions(region_list_t& regions,
// static
void LLToolBrushLand::onIdle( void* brush_tool )
{
LLToolBrushLand* self = reinterpret_cast<LLToolBrushLand*>(brush_tool);
LLToolBrushLand* self = static_cast<LLToolBrushLand*>(brush_tool);
if( LLToolMgr::getInstance()->getCurrentTool() == self )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment