Skip to content

Commit 6f4e19b

Browse files
committed
Refactor: replace assert() to R_ASSERT()
1 parent 7da1ad0 commit 6f4e19b

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

src/Layers/xrRender/NvTriStrip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void GenerateStrips(const u16* in_indices, const s32 in_numIndices, xr_vector<Pr
123123
stripifier.CreateStrips(tempStrips, stripIndices, bStitchStrips, numSeparateStrips);
124124

125125
// if we're stitching strips together, we better get back only one strip from CreateStrips()
126-
assert((bStitchStrips && (numSeparateStrips == 1)) || !bStitchStrips);
126+
R_ASSERT((bStitchStrips && (numSeparateStrips == 1)) || !bStitchStrips);
127127

128128
// convert to output format
129129
int numGroups = u16(numSeparateStrips); // for the strips

src/Layers/xrRender/NvTriStripObjects.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ NvEdgeInfo* NvStripifier::FindEdgeInfo(NvEdgeInfoVec& edgeInfos, int v0, int v1)
3434
}
3535
else
3636
{
37-
assert(infoIter->m_v1 == v0);
37+
R_ASSERT(infoIter->m_v1 == v0);
3838
if (infoIter->m_v0 == v1)
3939
return infoIter;
4040
else
@@ -53,7 +53,7 @@ NvEdgeInfo* NvStripifier::FindEdgeInfo(NvEdgeInfoVec& edgeInfos, int v0, int v1)
5353
NvFaceInfo* NvStripifier::FindOtherFace(NvEdgeInfoVec& edgeInfos, int v0, int v1, NvFaceInfo* faceInfo)
5454
{
5555
NvEdgeInfo* edgeInfo = FindEdgeInfo(edgeInfos, v0, v1);
56-
assert(edgeInfo != NULL);
56+
R_ASSERT(edgeInfo != NULL);
5757
return (edgeInfo->m_face0 == faceInfo ? edgeInfo->m_face1 : edgeInfo->m_face0);
5858
}
5959

@@ -315,7 +315,7 @@ int NvStripifier::GetSharedVertex(NvFaceInfo* faceA, NvFaceInfo* faceB)
315315
IC int NvStripifier::GetNextIndex(const WordVec& indices, NvFaceInfo* face)
316316
{
317317
int numIndices = indices.size();
318-
assert(numIndices >= 2);
318+
R_ASSERT(numIndices >= 2);
319319

320320
int v0 = indices[numIndices - 2];
321321
int v1 = indices[numIndices - 1];
@@ -376,15 +376,15 @@ IC bool NvStripInfo::IsMarked(NvFaceInfo* faceInfo)
376376
//
377377
IC void NvStripInfo::MarkTriangle(NvFaceInfo* faceInfo)
378378
{
379-
assert(!IsMarked(faceInfo));
379+
R_ASSERT(!IsMarked(faceInfo));
380380
if (IsExperiment())
381381
{
382382
faceInfo->m_experimentId = m_experimentId;
383383
faceInfo->m_testStripId = m_stripId;
384384
}
385385
else
386386
{
387-
assert(faceInfo->m_stripId == -1);
387+
R_ASSERT(faceInfo->m_stripId == -1);
388388
faceInfo->m_experimentId = -1;
389389
faceInfo->m_stripId = m_stripId;
390390
}
@@ -743,11 +743,11 @@ bool NvStripifier::IsCW(NvFaceInfo* faceInfo, int v0, int v1)
743743
void NvStripifier::CreateStrips(
744744
const NvStripInfoVec& allStrips, IntVec& stripIndices, const bool bStitchStrips, unsigned int& numSeparateStrips)
745745
{
746-
assert(numSeparateStrips == 0);
746+
R_ASSERT(numSeparateStrips == 0);
747747

748748
NvFaceInfo tLastFace(0, 0, 0);
749749
int nStripCount = allStrips.size();
750-
assert(nStripCount > 0);
750+
R_ASSERT(nStripCount > 0);
751751

752752
// we infer the cw/ccw ordering depending on the number of indices
753753
// this is screwed up by the fact that we insert -1s to denote changing strips
@@ -758,7 +758,7 @@ void NvStripifier::CreateStrips(
758758
{
759759
NvStripInfo* strip = allStrips[i];
760760
int nStripFaceCount = strip->m_faces.size();
761-
assert(nStripFaceCount > 0);
761+
R_ASSERT(nStripFaceCount > 0);
762762

763763
// Handle the first face in the strip
764764
{
@@ -1228,7 +1228,7 @@ void NvStripifier::FindAllStrips(
12281228
resetPoints.insert(nextFace);
12291229

12301230
// otherwise, we shall now try experiments for starting on the 01,12, and 20 edges
1231-
assert(nextFace->m_stripId < 0);
1231+
R_ASSERT(nextFace->m_stripId < 0);
12321232

12331233
// build the strip off of this face's 0-1 edge
12341234
NvEdgeInfo* edge01 = FindEdgeInfo(allEdgeInfos, nextFace->m_v0, nextFace->m_v1);

src/utils/xrQSlim/src/MxPropSlim.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ unsigned int MxPropSlim::check_local_validity(unsigned int v, const float* vnew)
342342
mxv_cross3(n, f_n, d_yx); // n = ((y-x)^(v-x))^(y-x)
343343
mxv_unitize(n, 3);
344344

345-
// assert( mxv_dot(d_vx, n, 3) > -FEQ_EPS );
345+
// R_ASSERT( mxv_dot(d_vx, n, 3) > -FEQ_EPS );
346346
if (mxv_dot(d_vnew, n, 3) < local_validity_threshold * mxv_dot(d_vx, n, 3))
347347
nfailed++;
348348
}

src/utils/xrQSlim/src/MxQSlim.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ unsigned int MxEdgeQSlim::check_local_validity(unsigned int v1, unsigned int /*v
226226
mxv_cross3(n, f_n, d_yx); // n = ((y-x)^(v-x))^(y-x)
227227
mxv_unitize(n, 3);
228228

229-
// assert( mxv_dot(d_vx, n, 3) > -FEQ_EPS );
229+
// R_ASSERT( mxv_dot(d_vx, n, 3) > -FEQ_EPS );
230230
if (mxv_dot(d_vnew, n, 3) < local_validity_threshold * mxv_dot(d_vx, n, 3))
231231
nfailed++;
232232
}

src/xrCore/Compression/Coder.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class RangeCoder
3232
}
3333
3434
void Encode (uint cumFreq, uint freq, uint totFreq) {
35-
assert(cumFreq+freq<totFreq && freq && totFreq<=BOT);
35+
R_ASSERT(cumFreq+freq<totFreq && freq && totFreq<=BOT);
3636
low += cumFreq * (range/= totFreq);
3737
range*= freq;
3838
while ((low ^ low+range)<TOP || range<BOT && ((range= -low & BOT-1),1))
@@ -46,7 +46,7 @@ class RangeCoder
4646
}
4747
4848
void Decode (uint cumFreq, uint freq, uint totFreq) {
49-
assert(cumFreq+freq<totFreq && freq && totFreq<=BOT);
49+
R_ASSERT(cumFreq+freq<totFreq && freq && totFreq<=BOT);
5050
low += cumFreq*range;
5151
range*= freq;
5252
while ((low ^ low+range)<TOP || range<BOT && ((range= -low & BOT-1),1))

src/xrGame/Level.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ void CLevel::OnFrame()
441441
{
442442
if (g_mt_config.test(mtMap))
443443
{
444-
assert(m_map_manager);
444+
R_ASSERT(m_map_manager);
445445
Device.seqParallel.push_back(fastdelegate::FastDelegate0<>(m_map_manager, &CMapManager::Update));
446446
}
447447
else
@@ -552,7 +552,7 @@ void CLevel::OnFrame()
552552
{
553553
if (g_mt_config.test(mtLevelSounds))
554554
{
555-
assert(m_level_sound_manager);
555+
R_ASSERT(m_level_sound_manager);
556556
Device.seqParallel.push_back(
557557
fastdelegate::FastDelegate0<>(m_level_sound_manager, &CLevelSoundManager::Update));
558558
}

src/xrGame/ui/UIPdaWnd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void CUIPdaWnd::Update()
165165
m_clock->TextItemControl().SetText(
166166
InventoryUtilities::GetGameTimeAsString(InventoryUtilities::etpTimeToMinutes).c_str());
167167

168-
assert(pUILogsWnd);
168+
R_ASSERT(pUILogsWnd);
169169
Device.seqParallel.push_back(fastdelegate::FastDelegate0<>(pUILogsWnd, &CUILogsWnd::PerformWork));
170170
}
171171

0 commit comments

Comments
 (0)