Replace uses of cassert with Common/Assert.h

This commit is contained in:
Pokechu22
2021-04-01 14:30:01 -07:00
parent a2fa9aab5b
commit 004dfd1586
20 changed files with 66 additions and 63 deletions

View File

@ -6,6 +6,10 @@
#include <cmath>
#include <cstring>
#ifdef CHECK
#include "Common/Assert.h"
#endif
#include "Common/CPUDetect.h"
#include "Common/CommonTypes.h"
#include "Common/Intrinsics.h"
@ -1362,8 +1366,8 @@ static void TexDecoder_DecodeImpl_CMPR(u32* dst, const u8* src, int width, int h
dst32[(width * 0) + 6] = colors1[(dxt1sel >> ((0 * 8) + 2)) & 3];
dst32[(width * 0) + 7] = colors1[(dxt1sel >> ((0 * 8) + 0)) & 3];
#ifdef CHECK
assert(memcmp(&(tmp0[0]), &dst32[(width * 0)], 16) == 0);
assert(memcmp(&(tmp1[0]), &dst32[(width * 0) + 4], 16) == 0);
ASSERT(memcmp(&(tmp0[0]), &dst32[(width * 0)], 16) == 0);
ASSERT(memcmp(&(tmp1[0]), &dst32[(width * 0) + 4], 16) == 0);
#endif
// Row 1:
dst32[(width * 1) + 0] = colors0[(dxt0sel >> ((1 * 8) + 6)) & 3];
@ -1375,8 +1379,8 @@ static void TexDecoder_DecodeImpl_CMPR(u32* dst, const u8* src, int width, int h
dst32[(width * 1) + 6] = colors1[(dxt1sel >> ((1 * 8) + 2)) & 3];
dst32[(width * 1) + 7] = colors1[(dxt1sel >> ((1 * 8) + 0)) & 3];
#ifdef CHECK
assert(memcmp(&(tmp0[1]), &dst32[(width * 1)], 16) == 0);
assert(memcmp(&(tmp1[1]), &dst32[(width * 1) + 4], 16) == 0);
ASSERT(memcmp(&(tmp0[1]), &dst32[(width * 1)], 16) == 0);
ASSERT(memcmp(&(tmp1[1]), &dst32[(width * 1) + 4], 16) == 0);
#endif
// Row 2:
dst32[(width * 2) + 0] = colors0[(dxt0sel >> ((2 * 8) + 6)) & 3];
@ -1388,8 +1392,8 @@ static void TexDecoder_DecodeImpl_CMPR(u32* dst, const u8* src, int width, int h
dst32[(width * 2) + 6] = colors1[(dxt1sel >> ((2 * 8) + 2)) & 3];
dst32[(width * 2) + 7] = colors1[(dxt1sel >> ((2 * 8) + 0)) & 3];
#ifdef CHECK
assert(memcmp(&(tmp0[2]), &dst32[(width * 2)], 16) == 0);
assert(memcmp(&(tmp1[2]), &dst32[(width * 2) + 4], 16) == 0);
ASSERT(memcmp(&(tmp0[2]), &dst32[(width * 2)], 16) == 0);
ASSERT(memcmp(&(tmp1[2]), &dst32[(width * 2) + 4], 16) == 0);
#endif
// Row 3:
dst32[(width * 3) + 0] = colors0[(dxt0sel >> ((3 * 8) + 6)) & 3];
@ -1401,8 +1405,8 @@ static void TexDecoder_DecodeImpl_CMPR(u32* dst, const u8* src, int width, int h
dst32[(width * 3) + 6] = colors1[(dxt1sel >> ((3 * 8) + 2)) & 3];
dst32[(width * 3) + 7] = colors1[(dxt1sel >> ((3 * 8) + 0)) & 3];
#ifdef CHECK
assert(memcmp(&(tmp0[3]), &dst32[(width * 3)], 16) == 0);
assert(memcmp(&(tmp1[3]), &dst32[(width * 3) + 4], 16) == 0);
ASSERT(memcmp(&(tmp0[3]), &dst32[(width * 3)], 16) == 0);
ASSERT(memcmp(&(tmp1[3]), &dst32[(width * 3) + 4], 16) == 0);
#endif
}
}