diff --git a/src/LercLib/fpl_EsriHuffman.cpp b/src/LercLib/fpl_EsriHuffman.cpp index 0869500..c9c1e4a 100644 --- a/src/LercLib/fpl_EsriHuffman.cpp +++ b/src/LercLib/fpl_EsriHuffman.cpp @@ -32,7 +32,7 @@ Original coding 2021 Yuriy Yakimenko USING_NAMESPACE_LERC -void _assert(bool v); +void lerc_assert(bool v); bool decodePackBits (const unsigned char *ptr, const size_t size, size_t expected, unsigned char **output) { @@ -332,7 +332,7 @@ int fpl_EsriHuffman::EncodeHuffman (const char *input, size_t input_len, unsigne ptr[0] = HUFFMAN_RLE; // RLE flag ptr[1] = input[0]; - _assert(input_len <= 0xffffffff); + lerc_assert(input_len <= 0xffffffff); uint32_t len = (uint32_t)input_len; @@ -498,7 +498,7 @@ bool fpl_EsriHuffman::DecodeHuffman(const unsigned char* inBytes, const size_t i { unsigned char *unpacked = NULL; - _assert (true == decodePackBits (ppByte + 1, inCount - 1, nBytesRemainingInOut, &unpacked)); + lerc_assert (true == decodePackBits (ppByte + 1, inCount - 1, nBytesRemainingInOut, &unpacked)); *output = unpacked; diff --git a/src/LercLib/fpl_Lerc2Ext.cpp b/src/LercLib/fpl_Lerc2Ext.cpp index 0f07642..878a335 100644 --- a/src/LercLib/fpl_Lerc2Ext.cpp +++ b/src/LercLib/fpl_Lerc2Ext.cpp @@ -32,7 +32,7 @@ Original coding 2021 Yuriy Yakimenko USING_NAMESPACE_LERC -void _assert(bool v) +void lerc_assert(bool v) { if (v == false) throw "Assertion failed"; @@ -65,7 +65,7 @@ static void generateListOfTestBlocks(const int width, const int height, std::vec { size_t size = (size_t)width * height; - _assert(size > 0); + lerc_assert(size > 0); const int block_target_size = 8 * 1024; @@ -614,11 +614,11 @@ bool restoreCrossBytes(std::vector >& output_buffers, cons //FILE* output, const UnitType unit_type, uint8_t** output_block) { - _assert(predictor == PREDICTOR_NONE || predictor == PREDICTOR_ROWS_COLS); + lerc_assert(predictor == PREDICTOR_NONE || predictor == PREDICTOR_ROWS_COLS); size_t unit_size = output_buffers.size(); - _assert(unit_size == UnitTypes::size(unit_type)); + lerc_assert(unit_size == UnitTypes::size(unit_type)); const int delta = Predictor::getIntDelta(predictor); @@ -670,11 +670,11 @@ bool restoreByteOrder(std::vector >& output_buffers, const size_t cols, const size_t rows, const PredictorType predictor, //FILE* output, const UnitType unit_type, uint8_t** output_block) { - _assert(predictor == PREDICTOR_NONE || predictor == PREDICTOR_DELTA1); + lerc_assert(predictor == PREDICTOR_NONE || predictor == PREDICTOR_DELTA1); size_t unit_size = output_buffers.size(); - _assert(unit_size == UnitTypes::size(unit_type)); + lerc_assert(unit_size == UnitTypes::size(unit_type)); const int delta = Predictor::getIntDelta(predictor); @@ -807,7 +807,7 @@ bool LosslessFPCompression::DecodeHuffmanFltSlice (const unsigned char** ppByte, size_t extracted_size = fpl_Compression::extract_buffer((const char *)compressed, compressed_size, expected_size, &uncompressed); - _assert(expected_size == extracted_size); + lerc_assert(expected_size == extracted_size); free(compressed); compressed = NULL;