mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-16 17:31:51 +03:00
cStyleCasts
This commit is contained in:
@@ -51,7 +51,7 @@ TEST(Uniform, Sizes) {
|
||||
TEST(Uniform, loadstore_u8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
u8 in = 1 << i;
|
||||
const char *cin = (const char *)(&in);
|
||||
const char *cin = reinterpret_cast<const char *>(&in);
|
||||
u8 out = load_u8(cin);
|
||||
EXPECT_EQ(in, out);
|
||||
char ALIGN_DIRECTIVE stored[1];
|
||||
@@ -63,7 +63,7 @@ TEST(Uniform, loadstore_u8) {
|
||||
TEST(Uniform, loadstore_u16) {
|
||||
for (int i = 0; i < 16; i++) {
|
||||
u16 in = 1 << i;
|
||||
const char *cin = (const char *)(&in);
|
||||
const char *cin = reinterpret_cast<const char *>(&in);
|
||||
u16 out = load_u16(cin);
|
||||
EXPECT_EQ(in, out);
|
||||
void *stored = aligned_zmalloc(2);
|
||||
@@ -76,7 +76,7 @@ TEST(Uniform, loadstore_u16) {
|
||||
TEST(Uniform, loadstore_u32) {
|
||||
for (int i = 0; i < 32; i++) {
|
||||
u32 in = 1U << i;
|
||||
const char *cin = (const char *)(&in);
|
||||
const char *cin = reinterpret_cast<const char *>(&in);
|
||||
u32 out = load_u32(cin);
|
||||
EXPECT_EQ(in, out);
|
||||
void *stored = aligned_zmalloc(32/8);
|
||||
@@ -89,7 +89,7 @@ TEST(Uniform, loadstore_u32) {
|
||||
TEST(Uniform, loadstore_u64a) {
|
||||
for (int i = 0; i < 64; i++) {
|
||||
u64a in = 1ULL << i;
|
||||
const char *cin = (const char *)(&in);
|
||||
const char *cin = reinterpret_cast<const char *>(&in);
|
||||
u64a out = load_u64a(cin);
|
||||
EXPECT_EQ(in, out);
|
||||
void *stored = aligned_zmalloc(64/8);
|
||||
@@ -107,7 +107,7 @@ TEST(Uniform, loadstore_m128) {
|
||||
for (int i = 0; i < 128; i++) {
|
||||
memset(&in, 0, sizeof(in));
|
||||
in.words[i/32] = 1U << (i % 32);
|
||||
const char *cin = (const char *)(&in);
|
||||
const char *cin = reinterpret_cast<const char *>(&in);
|
||||
m128 out = load_m128(cin);
|
||||
EXPECT_EQ(0, memcmp(&out, &in, sizeof(out)));
|
||||
void *stored = aligned_zmalloc(128/8);
|
||||
@@ -125,7 +125,7 @@ TEST(Uniform, loadstore_m256) {
|
||||
for (int i = 0; i < 256; i++) {
|
||||
memset(&in, 0, sizeof(in));
|
||||
in.words[i/32] = 1U << (i % 32);
|
||||
const char *cin = (const char *)(&in);
|
||||
const char *cin = reinterpret_cast<const char *>(&in);
|
||||
m256 out = load_m256(cin);
|
||||
EXPECT_EQ(0, memcmp(&out, &in, sizeof(out)));
|
||||
void *stored = aligned_zmalloc(256/8);
|
||||
@@ -143,7 +143,7 @@ TEST(Uniform, loadstore_m512) {
|
||||
for (int i = 0; i < 512; i++) {
|
||||
memset(&in, 0, sizeof(in));
|
||||
in.words[i/32] = 1U << (i % 32);
|
||||
const char *cin = (const char *)(&in);
|
||||
const char *cin = reinterpret_cast<const char *>(&in);
|
||||
m512 out = load_m512(cin);
|
||||
EXPECT_EQ(0, memcmp(&out, &in, sizeof(out)));
|
||||
void *stored = aligned_zmalloc(512/8);
|
||||
|
||||
Reference in New Issue
Block a user