Skip to content

Commit

Permalink
Use static_cast<> rather than C-style casts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHarker committed Dec 2, 2018
1 parent 5400e9f commit 996085a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions IPlug/IPlugParameter.cpp
Expand Up @@ -213,8 +213,8 @@ void IParam::Init(const IParam& p, const char* searchStr, const char* replaceStr

if(pos)
{
int insertionPos = (int) (str.Get() - pos);
str.DeleteSub(insertionPos, (int) strlen(searchStr));
int insertionPos = static_cast<int>(str.Get() - pos);
str.DeleteSub(insertionPos, static_cast<int>(strlen(searchStr)));
str.Insert(replaceStr, insertionPos);
}
}
Expand Down Expand Up @@ -274,7 +274,7 @@ void IParam::GetDisplayForHost(double value, bool normalized, WDL_String& str, b

if (mDisplayPrecision == 0)
{
str.SetFormatted(MAX_PARAM_DISPLAY_LEN, "%d", int(round(displayValue)));
str.SetFormatted(MAX_PARAM_DISPLAY_LEN, "%d", static_cast<int>(round(displayValue)));
}
else if ((mFlags & kFlagSignDisplay) && displayValue)
{
Expand All @@ -295,7 +295,7 @@ const char* IParam::GetNameForHost() const

const char* IParam::GetLabelForHost() const
{
return (CStringHasContents(GetDisplayText((int) mValue))) ? "" : mLabel;
return (CStringHasContents(GetDisplayText(static_cast<int>(mValue.load())))) ? "" : mLabel;
}

const char* IParam::GetGroupForHost() const
Expand Down

0 comments on commit 996085a

Please sign in to comment.