diff --git a/appveyor.yml b/appveyor.yml index 7bcfb699d..bff8df7c6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ image: Visual Studio 2015 before_build: - md %APPVEYOR_BUILD_FOLDER%\build - cd %APPVEYOR_BUILD_FOLDER%\build -- cmake -G "Visual Studio 14 2015 Win64" -DOPTDBG=1 -DXPRESS=1 .. +- cmake -G "Visual Studio 14 2015 Win64" -DOPTDBG=1 -DXPRESS=1 -DPORTABLE=1 .. - cd .. build: project: build\rocksdb.sln diff --git a/cache/lru_cache.cc b/cache/lru_cache.cc index 268378b9d..d29e70934 100644 --- a/cache/lru_cache.cc +++ b/cache/lru_cache.cc @@ -465,14 +465,7 @@ LRUCache::LRUCache(size_t capacity, int num_shard_bits, bool strict_capacity_limit, double high_pri_pool_ratio) : ShardedCache(capacity, num_shard_bits, strict_capacity_limit) { num_shards_ = 1 << num_shard_bits; -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable: 4316) // We've validated the alignment with the new operators -#endif shards_ = new LRUCacheShard[num_shards_]; -#if defined(_MSC_VER) -#pragma warning(pop) -#endif SetCapacity(capacity); SetStrictCapacityLimit(strict_capacity_limit); for (int i = 0; i < num_shards_; i++) { diff --git a/port/win/port_win.h b/port/win/port_win.h index 1ec090683..408bc63db 100644 --- a/port/win/port_win.h +++ b/port/win/port_win.h @@ -242,7 +242,7 @@ extern void InitOnce(OnceType* once, void (*initializer)()); inline void *cacheline_aligned_alloc(size_t size) { - return _aligned_malloc(CACHE_LINE_SIZE, size); + return _aligned_malloc(size, CACHE_LINE_SIZE); } inline void cacheline_aligned_free(void *memblock) { diff --git a/utilities/transactions/write_prepared_transaction_test.cc b/utilities/transactions/write_prepared_transaction_test.cc index 0015ac14f..d6ee15da6 100644 --- a/utilities/transactions/write_prepared_transaction_test.cc +++ b/utilities/transactions/write_prepared_transaction_test.cc @@ -339,7 +339,7 @@ TEST_P(WritePreparedTransactionTest, CheckAgainstSnapshotsTest) { } // Return true if the ith bit is set in combination represented by comb -bool IsInCombination(size_t i, size_t comb) { return comb & (1 << i); } +bool IsInCombination(size_t i, size_t comb) { return comb & (size_t(1) << i); } // Test that CheckAgainstSnapshots will not miss a live snapshot if it is run in // parallel with UpdateSnapshots. @@ -367,7 +367,7 @@ TEST_P(WritePreparedTransactionTest, SnapshotConcurrentAccessTest) { // Each member of old snapshot might or might not appear in the new list. We // create a common_snapshots for each combination. - size_t new_comb_cnt = static_cast(1 << old_size); + size_t new_comb_cnt = size_t(1) << old_size; for (size_t new_comb = 0; new_comb < new_comb_cnt; new_comb++) { std::vector common_snapshots; for (size_t i = 0; i < old_snapshots.size(); i++) {