Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions encoder/basisu_enc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2164,10 +2164,9 @@ namespace basisu
uint32_t max_threads, job_pool *pJob_pool,
bool even_odd_input_pairs_equal)
{
typedef bit_hasher<typename Quantizer::training_vec_type> training_vec_bit_hasher;

// rg 6/24/2025 - Cross platform determinism
#if 0
typedef bit_hasher<typename Quantizer::training_vec_type> training_vec_bit_hasher;
typedef std::unordered_map < typename Quantizer::training_vec_type, weighted_block_group,
training_vec_bit_hasher> group_hash;
#else
Expand Down
13 changes: 1 addition & 12 deletions encoder/basisu_pvrtc1_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,7 @@ namespace basisu

inline void set_to_black()
{
#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#endif
memset(m_blocks.get_ptr(), 0, m_blocks.size_in_bytes());
#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif
memset((void *)m_blocks.get_ptr(), 0, m_blocks.size_in_bytes());
}

inline bool get_block_uses_transparent_modulation(uint32_t bx, uint32_t by) const
Expand Down
13 changes: 0 additions & 13 deletions transcoder/basisu.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,8 @@ namespace basisu
debug_puts(res.c_str());
}

#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#endif

template <typename T> inline void clear_obj(T& obj) { memset((void *)&obj, 0, sizeof(obj)); }

#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif

constexpr double cPiD = 3.14159265358979323846264338327950288;
constexpr float REALLY_SMALL_FLOAT_VAL = .000000125f;
constexpr float SMALL_FLOAT_VAL = .0000125f;
Expand Down
50 changes: 4 additions & 46 deletions transcoder/basisu_containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1503,22 +1503,10 @@ namespace basisu

if (BASISU_IS_BITWISE_COPYABLE(T))
{

#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#endif
if ((m_p) && (other.m_p))
{
memcpy(m_p, other.m_p, m_size * sizeof(T));
memcpy((void *)m_p, other.m_p, m_size * sizeof(T));
}
#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif
}
else
{
Expand Down Expand Up @@ -1649,19 +1637,8 @@ namespace basisu

if (BASISU_IS_BITWISE_COPYABLE(T))
{
#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#endif
if ((m_p) && (other.m_p))
memcpy((void *)m_p, other.m_p, other.m_size * sizeof(T));
#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif
}
else
{
Expand Down Expand Up @@ -2233,21 +2210,7 @@ namespace basisu
}

// Copy "down" the objects to preserve, filling in the empty slots.

#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#endif

memmove((void *)pDst, pSrc, num_to_move * sizeof(T));

#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif
}
else
{
Expand Down Expand Up @@ -2492,18 +2455,13 @@ namespace basisu
{
if ((sizeof(T) == 1) && (scalar_type<T>::cFlag))
{
#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
memset(m_p, *reinterpret_cast<const uint8_t*>(&o), m_size);

#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
#endif
}
else
Expand Down