diff --git a/3party/3party.pro b/3party/3party.pro index 3a3989772c..687903d946 100644 --- a/3party/3party.pro +++ b/3party/3party.pro @@ -2,7 +2,7 @@ TEMPLATE = subdirs -SUBDIRS = freetype fribidi zlib bzip2 jansson tomcrypt protobuf osrm expat \ +SUBDIRS = freetype fribidi zlib jansson tomcrypt protobuf osrm expat \ succinct \ !linux* { diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 46d5b6953a..d42bdd0d1e 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -25,7 +25,7 @@ define add_prebuild_static_lib include $(PREBUILT_STATIC_LIBRARY) endef -prebuild_static_libs := osrm protobuf tomcrypt jansson bzip2 zlib fribidi freetype expat base coding geometry anim platform graphics indexer storage search routing gui render map stats_client succinct +prebuild_static_libs := osrm protobuf tomcrypt jansson zlib fribidi freetype expat base coding geometry anim platform graphics indexer storage search routing gui render map stats_client succinct $(foreach item,$(prebuild_static_libs),$(eval $(call add_prebuild_static_lib,$(item)))) @@ -40,7 +40,7 @@ LOCAL_CPP_FEATURES += exceptions rtti LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../ LOCAL_MODULE := mapswithme -LOCAL_STATIC_LIBRARIES := map render gui routing search storage indexer graphics platform anim geometry coding base expat freetype fribidi zlib bzip2 jansson tomcrypt protobuf osrm stats_client succinct +LOCAL_STATIC_LIBRARIES := map render gui routing search storage indexer graphics platform anim geometry coding base expat freetype fribidi zlib jansson tomcrypt protobuf osrm stats_client succinct LOCAL_CFLAGS := -ffunction-sections -fdata-sections -Wno-extern-c-compat ifneq ($(NDK_DEBUG),1) diff --git a/coding/bzip2_compressor.cpp b/coding/bzip2_compressor.cpp deleted file mode 100644 index 3f81988a20..0000000000 --- a/coding/bzip2_compressor.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "coding/bzip2_compressor.hpp" -#include "coding/coder_util.hpp" - -#include "base/assert.hpp" - -#include "std/vector.hpp" - -#include "3party/bzip2/bzlib.h" - -size_t DecompressBZip2IntoFixedSize(char const * pSrc, size_t srcSize, char * pDst, size_t dstSize) -{ - // TODO: Remove unnecessary copying. - vector src(pSrc, pSrc + srcSize); - unsigned int dstUsed = static_cast(dstSize); - int error = BZ2_bzBuffToBuffDecompress(pDst, &dstUsed, &src[0], static_cast(srcSize), 0, 0); - switch (error) - { - case BZ_OK: - return dstUsed; - case BZ_OUTBUFF_FULL: - return size_t(-1); - default: - MYTHROW(DecompressBZip2Exception, (error, srcSize, dstSize, dstUsed)); - } -} - -void DecompressBZip2(char const * pSrc, size_t srcSize, string & dst) -{ - FixedDstSizeCodeToString(&DecompressBZip2IntoFixedSize, pSrc, srcSize, dst); -} - -void CompressBZip2(int level, char const * pSrc, size_t srcSize, string & dst) -{ - ASSERT(level >= 1 && level <= 9, (level)); - dst.resize(srcSize + srcSize / 100 + 699); - unsigned int dstUsed = static_cast(dst.size()); - // TODO: Remove unnecessary copying. - vector src(pSrc, pSrc + srcSize); - int error = BZ2_bzBuffToBuffCompress(&dst[0], &dstUsed, &src[0], static_cast(srcSize), level, 0, 0); - if (error == BZ_OK) - dst.resize(dstUsed); - else - MYTHROW(CompressBZip2Exception, (error, srcSize, dst.size(), dstUsed)); -} diff --git a/coding/bzip2_compressor.hpp b/coding/bzip2_compressor.hpp deleted file mode 100644 index 0f56646103..0000000000 --- a/coding/bzip2_compressor.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include "coding/coder.hpp" -#include "base/base.hpp" -#include "base/exception.hpp" - -DECLARE_EXCEPTION(CompressBZip2Exception, StringCodingException); -DECLARE_EXCEPTION(DecompressBZip2Exception, StringCodingException); - -// Throws CompressBZip2Exception on error. -void CompressBZip2(int level, char const * pSrc, size_t srcSize, string & dst); - -// Throws DecompressBZip2Exception on error. -void DecompressBZip2(char const * pSrc, size_t srcSize, string & dst); - -// Returns -1 if dstSize is too small, otherwise the size of pDst used. -// Throws DecompressBZip2Exception on error. -size_t DecompressBZip2IntoFixedSize(char const * pSrc, size_t srcSize, char * pDst, size_t dstSize); diff --git a/coding/coding.pro b/coding/coding.pro index b4980f9289..d96d71eee1 100644 --- a/coding/coding.pro +++ b/coding/coding.pro @@ -14,7 +14,6 @@ SOURCES += \ base64.cpp \ # blob_indexer.cpp \ # blob_storage.cpp \ - bzip2_compressor.cpp \ compressed_bit_vector.cpp \ # compressed_varnum_vector.cpp \ file_container.cpp \ @@ -47,7 +46,6 @@ HEADERS += \ # blob_storage.hpp \ buffer_reader.hpp \ byte_stream.hpp \ - bzip2_compressor.hpp \ coder.hpp \ coder_util.hpp \ compressed_bit_vector.hpp \ diff --git a/coding/coding_tests/bzip2_test.cpp b/coding/coding_tests/bzip2_test.cpp deleted file mode 100644 index 03ac284dbe..0000000000 --- a/coding/coding_tests/bzip2_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "base/SRC_FIRST.hpp" -#include "testing/testing.hpp" - -#include "coding/coding_tests/coder_test.hpp" -#include "coding/bzip2_compressor.hpp" - -namespace -{ - void CompressBZip2Level1(char const * pSrc, size_t srcSize, string & dst) - { - return CompressBZip2(1, pSrc, srcSize, dst); - } - void CompressBZip2Level9(char const * pSrc, size_t srcSize, string & dst) - { - return CompressBZip2(1, pSrc, srcSize, dst); - } -} - -UNIT_TEST(AaaaBZip2CompressionLevel1) -{ - CoderAaaaTest(&CompressBZip2Level1, &DecompressBZip2); -} - -UNIT_TEST(AaaaBZip2CompressionLevel9) -{ - CoderAaaaTest(&CompressBZip2Level9, &DecompressBZip2); -} diff --git a/coding/coding_tests/coding_tests.pro b/coding/coding_tests/coding_tests.pro index a8f5845170..6ef69ca27f 100644 --- a/coding/coding_tests/coding_tests.pro +++ b/coding/coding_tests/coding_tests.pro @@ -5,7 +5,7 @@ CONFIG -= app_bundle TEMPLATE = app ROOT_DIR = ../.. -DEPENDENCIES = coding base bzip2 zlib tomcrypt +DEPENDENCIES = coding base zlib tomcrypt include($$ROOT_DIR/common.pri) @@ -17,7 +17,6 @@ SOURCES += ../../testing/testingmain.cpp \ base64_test.cpp \ bit_streams_test.cpp \ # blob_storage_test.cpp \ - bzip2_test.cpp \ coder_util_test.cpp \ compressed_bit_vector_test.cpp \ # compressed_varnum_vector_test.cpp \ diff --git a/qt/qt.pro b/qt/qt.pro index ec63f53831..ab27b82eef 100644 --- a/qt/qt.pro +++ b/qt/qt.pro @@ -1,7 +1,7 @@ # Main application in qt. ROOT_DIR = .. DEPENDENCIES = map render gui routing search storage indexer graphics platform anim geometry coding base \ - bzip2 freetype expat fribidi tomcrypt jansson protobuf osrm stats_client zlib succinct + freetype expat fribidi tomcrypt jansson protobuf osrm stats_client zlib succinct drape { DEPENDENCIES *= drape_frontend drape