Skip to content

Commit c8001d8

Browse files
committed
Fixed MSVC compilation error.
1 parent ed1c874 commit c8001d8

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/game/components/CCChampion.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -586,24 +586,24 @@ void CCChampion::InitializeLists()
586586
_MonstersList.clear();
587587
_CandleList.clear();
588588

589-
uchar ucPerc = 100 / _iLevelMax;
590-
uchar ucMonsterTotal = 0;
591-
uchar ucCandleTotal = 0;
589+
uchar uiPerc = 100 / _iLevelMax;
590+
uchar uiMonsterTotal = 0;
591+
uchar uiCandleTotal = 0;
592592
for (uchar i = (_iLevelMax - 2); i > 0; --i)
593593
{
594-
uchar ucMonster = (ucPerc / i) + (_iLevelMax - (i + 1));
595-
_MonstersList.insert(_MonstersList.begin(), ucMonster); // Push the value from beginning.
596-
ucMonsterTotal += ucMonster;
594+
uchar uiMonster = (uiPerc / i) + (_iLevelMax - (i + 1));
595+
_MonstersList.insert(_MonstersList.begin(), uiMonster); // Push the value from beginning.
596+
uiMonsterTotal += uiMonster;
597597
}
598-
_MonstersList.insert(_MonstersList.begin(), (100 - ucMonsterTotal)); // Push the left over as first element.
598+
_MonstersList.insert(_MonstersList.begin(), (100 - uiMonsterTotal)); // Push the left over as first element.
599599

600600
for (uchar i = (_iLevelMax - 1); i > 1; --i)
601601
{
602-
uchar ucCandle = ((16 - ucCandleTotal) / i);
603-
_CandleList.insert(_CandleList.begin(), ucCandle);
604-
ucCandleTotal += ucCandle;
602+
uchar uiCandle = ((16 - uiCandleTotal) / i);
603+
_CandleList.insert(_CandleList.begin(), uiCandle);
604+
uiCandleTotal += uiCandle;
605605
}
606-
_CandleList.insert(_CandleList.begin(), (16 - ucCandleTotal));
606+
_CandleList.insert(_CandleList.begin(), (16 - uiCandleTotal));
607607
}
608608

609609
uchar CCChampion::GetCandlesCount()
@@ -656,7 +656,7 @@ void CCChampion::DelWhiteCandle(CANDLEDELREASON_TYPE reason)
656656

657657
CItem* pCandle;
658658
CUID uidLastWhiteCandle = _pWhiteCandles.back();
659-
if (pCandle = uidLastWhiteCandle.ItemFind())
659+
if ((pCandle = uidLastWhiteCandle.ItemFind()))
660660
{
661661
if (IsTrigUsed(TRIGGER_DELWHITECANDLE))
662662
{
@@ -667,7 +667,7 @@ void CCChampion::DelWhiteCandle(CANDLEDELREASON_TYPE reason)
667667
return;
668668
}
669669

670-
if (pCandle = uidLastWhiteCandle.ItemFind()) // Does the candle still exist after the trigger?
670+
if ((pCandle = uidLastWhiteCandle.ItemFind())) // Does the candle still exist after the trigger?
671671
pCandle->Delete();
672672
}
673673
_pWhiteCandles.pop_back();
@@ -682,7 +682,7 @@ void CCChampion::DelRedCandle(CANDLEDELREASON_TYPE reason)
682682

683683
CItem* pCandle;
684684
CUID uidLastRedCandle = _pRedCandles.back();
685-
if (pCandle = uidLastRedCandle.ItemFind())
685+
if ((pCandle = uidLastRedCandle.ItemFind()))
686686
{
687687
if (IsTrigUsed(TRIGGER_DELREDCANDLE))
688688
{
@@ -693,7 +693,7 @@ void CCChampion::DelRedCandle(CANDLEDELREASON_TYPE reason)
693693
return;
694694
}
695695

696-
if (pCandle = uidLastRedCandle.ItemFind()) // Does the candle still exist after trigger?
696+
if ((pCandle = uidLastRedCandle.ItemFind())) // Does the candle still exist after trigger?
697697
pCandle->Delete();
698698
}
699699
_pRedCandles.pop_back();

src/sphere/threads.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -938,11 +938,10 @@ void AbstractSphereThread::printStackTrace() noexcept
938938
freezeCallStack(true);
939939

940940
uint64_t threadId = // static_cast<uint64_t>(getId());
941-
// Use reinterpret_cast because it will fail if the types are different and not just an alias.
942941
#if defined(_WIN32) || defined(__APPLE__)
943-
reinterpret_cast<uint64_t>(getId() ? getId() : os_current_tid());
942+
n_alias_cast<uint64_t>(getId() ? getId() : os_current_tid());
944943
#else
945-
reinterpret_cast<uint64_t>(getId() ? getId() : os_current_tid());
944+
n_alias_cast<uint64_t>(getId() ? getId() : os_current_tid());
946945
#endif
947946

948947
const lpctstr threadName = getName();

0 commit comments

Comments
 (0)