From f5c112eefc4ad76ded8e477404b319032178213a Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 20 Mar 2016 16:31:17 -0400 Subject: [PATCH] remove remaining references to storage_mode_compact (since it's been deprecated for quite a while now, and no longer implemented) --- bindings/c/libtorrent.h | 5 ++--- bindings/python/src/session.cpp | 3 --- include/libtorrent/storage_defs.hpp | 11 ++--------- test/test_storage.cpp | 18 +++++++----------- test/test_transfer.cpp | 11 ----------- test/web_seed_suite.cpp | 3 --- 6 files changed, 11 insertions(+), 40 deletions(-) diff --git a/bindings/c/libtorrent.h b/bindings/c/libtorrent.h index d90ade47c..f761cae6e 100644 --- a/bindings/c/libtorrent.h +++ b/bindings/c/libtorrent.h @@ -129,8 +129,7 @@ enum proxy_type_t enum storage_mode_t { storage_mode_allocate = 0, - storage_mode_sparse, - storage_mode_compact + storage_mode_sparse }; enum state_t @@ -144,7 +143,7 @@ enum state_t allocating, checking_resume_data }; - + struct torrent_status { enum state_t state; diff --git a/bindings/python/src/session.cpp b/bindings/python/src/session.cpp index ac011917e..3aca92eb7 100644 --- a/bindings/python/src/session.cpp +++ b/bindings/python/src/session.cpp @@ -663,9 +663,6 @@ void bind_session() enum_("storage_mode_t") .value("storage_mode_allocate", storage_mode_allocate) .value("storage_mode_sparse", storage_mode_sparse) -#ifndef TORRENT_NO_DEPRECATE - .value("storage_mode_compact", storage_mode_compact) -#endif ; enum_("options_t") diff --git a/include/libtorrent/storage_defs.hpp b/include/libtorrent/storage_defs.hpp index 3d47280ad..ed870c7f4 100644 --- a/include/libtorrent/storage_defs.hpp +++ b/include/libtorrent/storage_defs.hpp @@ -55,14 +55,7 @@ namespace libtorrent // All pieces will be written to the place where they belong and sparse files // will be used. This is the recommended, and default mode. - storage_mode_sparse, - - // internal - internal_storage_mode_compact_deprecated -#ifndef TORRENT_NO_DEPRECATE - , // comma here to avoid compiler warning - storage_mode_compact = internal_storage_mode_compact_deprecated -#endif + storage_mode_sparse }; // see default_storage::default_storage() @@ -78,7 +71,7 @@ namespace libtorrent std::vector const* priorities; // optional torrent_info const* info; // optional }; - + typedef boost::function storage_constructor_type; // the constructor function for the regular file storage. This is the diff --git a/test/test_storage.cpp b/test/test_storage.cpp index d4c2b255a..0a898e3d5 100644 --- a/test/test_storage.cpp +++ b/test/test_storage.cpp @@ -478,10 +478,6 @@ void test_check_files(std::string const& test_path io.set_num_threads(0); } -#ifdef TORRENT_NO_DEPRECATE -#define storage_mode_compact storage_mode_sparse -#endif - // TODO: 2 split this test up into smaller parts void run_test(bool unbuffered) { @@ -531,7 +527,7 @@ void run_test(bool unbuffered) std::cerr << "=== test 1 === " << (unbuffered?"unbuffered":"buffered") << std::endl; // run_storage_tests writes piece 0, 1 and 2. not 3 - run_storage_tests(info, fs, test_path, storage_mode_compact, unbuffered); + run_storage_tests(info, fs, test_path, storage_mode_sparse, unbuffered); // make sure the files have the correct size std::string base = combine_path(test_path, "temp_storage"); @@ -575,7 +571,7 @@ void run_test(bool unbuffered) std::cerr << "=== test 3 ===" << std::endl; - run_storage_tests(info, fs, test_path, storage_mode_compact, unbuffered); + run_storage_tests(info, fs, test_path, storage_mode_sparse, unbuffered); TEST_EQUAL(file_size(combine_path(test_path, combine_path("temp_storage", "test1.tmp"))), piece_size * 3); remove_all(combine_path(test_path, "temp_storage"), ec); @@ -608,7 +604,7 @@ void run_test(bool unbuffered) std::cerr << "=== test 6 ===" << std::endl; test_check_files(test_path, storage_mode_sparse, unbuffered); - test_check_files(test_path, storage_mode_compact, unbuffered); + test_check_files(test_path, storage_mode_sparse, unbuffered); std::cerr << "=== test 7 ===" << std::endl; test_rename(test_path); @@ -653,7 +649,7 @@ TORRENT_TEST(fastresume) add_torrent_params p; p.ti = boost::make_shared(boost::cref(*t)); p.save_path = combine_path(test_path, "tmp1"); - p.storage_mode = storage_mode_compact; + p.storage_mode = storage_mode_sparse; torrent_handle h = ses.add_torrent(p, ec); TEST_CHECK(exists(combine_path(p.save_path, "temporary"))); if (!exists(combine_path(p.save_path, "temporary"))) @@ -714,7 +710,7 @@ TORRENT_TEST(fastresume) p.flags &= ~add_torrent_params::flag_auto_managed; p.ti = boost::make_shared(boost::cref(*t)); p.save_path = combine_path(test_path, "tmp1"); - p.storage_mode = storage_mode_compact; + p.storage_mode = storage_mode_sparse; bencode(std::back_inserter(p.resume_data), resume); torrent_handle h = ses.add_torrent(p, ec); @@ -769,7 +765,7 @@ TORRENT_TEST(rename_file_fastresume) add_torrent_params p; p.ti = boost::make_shared(boost::cref(*t)); p.save_path = combine_path(test_path, "tmp2"); - p.storage_mode = storage_mode_compact; + p.storage_mode = storage_mode_sparse; torrent_handle h = ses.add_torrent(p, ec); h.rename_file(0, "testing_renamed_files"); @@ -817,7 +813,7 @@ TORRENT_TEST(rename_file_fastresume) add_torrent_params p; p.ti = boost::make_shared(boost::cref(*t)); p.save_path = combine_path(test_path, "tmp2"); - p.storage_mode = storage_mode_compact; + p.storage_mode = storage_mode_sparse; bencode(std::back_inserter(p.resume_data), resume); torrent_handle h = ses.add_torrent(p, ec); diff --git a/test/test_transfer.cpp b/test/test_transfer.cpp index cb00755da..c13e253fb 100644 --- a/test/test_transfer.cpp +++ b/test/test_transfer.cpp @@ -431,14 +431,3 @@ TORRENT_TEST(allocate) cleanup(); } -#ifndef TORRENT_NO_DEPRECATE -TORRENT_TEST(compact) -{ - using namespace libtorrent; - fprintf(stderr, "compact mode\n"); - test_transfer(0, settings_pack(), false, storage_mode_compact); - - cleanup(); -} -#endif - diff --git a/test/web_seed_suite.cpp b/test/web_seed_suite.cpp index cc2c7141b..55d674c8e 100644 --- a/test/web_seed_suite.cpp +++ b/test/web_seed_suite.cpp @@ -139,9 +139,6 @@ void test_transfer(lt::session& ses, boost::shared_ptr torrent_fil p.flags |= add_torrent_params::flag_sequential_download; p.ti = torrent_file; p.save_path = save_path; -#ifndef TORRENT_NO_DEPRECATE - p.storage_mode = storage_mode_compact; -#endif torrent_handle th = ses.add_torrent(p, ec); printf("adding torrent, save_path = \"%s\" cwd = \"%s\" torrent = \"%s\"\n" , save_path.c_str(), current_working_directory().c_str()