diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6652095 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.o +crnlib/crunch diff --git a/crnlib/crn_image_utils.cpp b/crnlib/crn_image_utils.cpp index 409e675..0ffac1f 100644 --- a/crnlib/crn_image_utils.cpp +++ b/crnlib/crn_image_utils.cpp @@ -1305,7 +1305,7 @@ namespace crnlib *pActualComps = 0; if ((req_comps < 1) || (req_comps > 4)) - return false; + return NULL; mipmapped_texture tex; diff --git a/crnlib/crn_sparse_array.h b/crnlib/crn_sparse_array.h index 62a93a7..f7c3fcf 100644 --- a/crnlib/crn_sparse_array.h +++ b/crnlib/crn_sparse_array.h @@ -355,7 +355,7 @@ namespace crnlib inline T* alloc_group(bool nofail = false) { - T* p = static_cast(alloc_space(N * sizeof(T))); + T* p = static_cast(this->alloc_space(N * sizeof(T))); if (!p) { @@ -365,7 +365,7 @@ namespace crnlib CRNLIB_FAIL("Out of memory"); } - construct_group(p); + this->construct_group(p); m_num_active_groups++; @@ -379,20 +379,20 @@ namespace crnlib CRNLIB_ASSERT(m_num_active_groups); m_num_active_groups--; - destruct_group(p); + this->destruct_group(p); - free_space(p); + this->free_space(p); } } inline void init_default() { - construct_element(reinterpret_cast(m_default)); + this->construct_element(reinterpret_cast(m_default)); } inline void deinit_default() { - destruct_element(reinterpret_cast(m_default)); + this->destruct_element(reinterpret_cast(m_default)); } }; diff --git a/crnlib/crn_vector.cpp b/crnlib/crn_vector.cpp index 8c21125..98931d6 100644 --- a/crnlib/crn_vector.cpp +++ b/crnlib/crn_vector.cpp @@ -21,7 +21,7 @@ namespace crnlib if (m_capacity >= min_new_capacity) return true; - size_t new_capacity = min_new_capacity; + uint new_capacity = min_new_capacity; if ((grow_hint) && (!math::is_power_of_2(new_capacity))) new_capacity = math::next_pow2(new_capacity); diff --git a/crnlib/crnlib.cpp b/crnlib/crnlib.cpp index ac485d0..682efad 100644 --- a/crnlib/crnlib.cpp +++ b/crnlib/crnlib.cpp @@ -172,7 +172,7 @@ void *crn_compress(const crn_comp_params &comp_params, crn_uint32 &compressed_si if (pActual_bitrate) *pActual_bitrate = 0.0f; if (!comp_params.check()) - return false; + return NULL; crnlib::vector crn_file_data; if (!create_compressed_texture(comp_params, crn_file_data, pActual_quality_level, pActual_bitrate)) @@ -189,7 +189,7 @@ void *crn_compress(const crn_comp_params &comp_params, const crn_mipmap_params & if (pActual_bitrate) *pActual_bitrate = 0.0f; if ((!comp_params.check()) || (!mip_params.check())) - return false; + return NULL; crnlib::vector crn_file_data; if (!create_compressed_texture(comp_params, mip_params, crn_file_data, pActual_quality_level, pActual_bitrate)) @@ -456,4 +456,4 @@ bool crn_decompress_block(const void *pSrc_block, crn_uint32 *pDst_pixels_u32, c } return true; -} \ No newline at end of file +} diff --git a/inc/crn_decomp.h b/inc/crn_decomp.h index 4d81928..680beb1 100644 --- a/inc/crn_decomp.h +++ b/inc/crn_decomp.h @@ -377,7 +377,11 @@ namespace crnd #ifdef _WIN64 typedef uint64 ptr_bits; #else - typedef uint32 ptr_bits; + #ifdef __x86_64__ + typedef uint64 ptr_bits; + #else + typedef uint32 ptr_bits; + #endif #endif template struct int_traits { enum { cMin = crnd::cINT32_MIN, cMax = crnd::cINT32_MAX, cSigned = true }; }; @@ -2819,15 +2823,15 @@ namespace crnd *pSize = 0; if ((!pData) || (data_size < cCRNHeaderMinSize)) - return false; + return NULL; crn_header tmp_header; const crn_header* pHeader = crnd_get_header(tmp_header, pData, data_size); if (!pHeader) - return false; + return NULL; if (level_index >= pHeader->m_levels) - return false; + return NULL; uint32 cur_level_ofs = pHeader->m_level_ofs[level_index];