| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- Index: src/github.com/cockroachdb/cockroach/pkg/cli/start_jemalloc.go
- --- src/github.com/cockroachdb/cockroach/pkg/cli/start_jemalloc.go.orig 2016-11-27 12:13:10.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/pkg/cli/start_jemalloc.go 2016-11-27 12:21:20.407531382 +0100
- @@ -23,6 +23,7 @@
- // #cgo linux CPPFLAGS: -I../../vendor/github.com/cockroachdb/c-jemalloc/linux_includes/internal/include
- // #cgo darwin LDFLAGS: -Wl,-undefined -Wl,dynamic_lookup
- // #cgo linux LDFLAGS: -Wl,-unresolved-symbols=ignore-all
- +// #cgo freebsd LDFLAGS: -Wl,-unresolved-symbols=ignore-all
- //
- // #include <jemalloc/jemalloc.h>
- // #include <stddef.h>
- Index: src/github.com/cockroachdb/cockroach/pkg/server/config.go
- --- src/github.com/cockroachdb/cockroach/pkg/server/config.go.orig 2016-11-27 12:13:10.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/pkg/server/config.go 2016-11-27 12:21:20.407531382 +0100
- @@ -248,7 +248,7 @@
- }
-
- // The max open file descriptor limit is too low.
- - if rLimit.Max < minimumOpenFileLimit {
- + if uint64(rLimit.Max) < minimumOpenFileLimit {
- return 0, fmt.Errorf("hard open file descriptor limit of %d is under the minimum required %d\n%s",
- rLimit.Max,
- minimumOpenFileLimit,
- @@ -257,24 +257,24 @@
-
- // If current open file descriptor limit is higher than the recommended
- // value, we can just use the default value.
- - if rLimit.Cur > recommendedOpenFileLimit {
- + if uint64(rLimit.Cur) > recommendedOpenFileLimit {
- return engine.DefaultMaxOpenFiles, nil
- }
-
- // If the current limit is less than the recommended limit, set the current
- // limit to the minimum of the max limit or the recommendedOpenFileLimit.
- var newCurrent uint64
- - if rLimit.Max > recommendedOpenFileLimit {
- + if uint64(rLimit.Max) > recommendedOpenFileLimit {
- newCurrent = recommendedOpenFileLimit
- } else {
- - newCurrent = rLimit.Max
- + newCurrent = uint64(rLimit.Max)
- }
- - if rLimit.Cur < newCurrent {
- + if uint64(rLimit.Cur) < newCurrent {
- if log.V(1) {
- log.Infof(context.TODO(), "setting the soft limit for open file descriptors from %d to %d",
- rLimit.Cur, newCurrent)
- }
- - rLimit.Cur = newCurrent
- + rLimit.Cur = int64(newCurrent)
- if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit); err != nil {
- return 0, err
- }
- @@ -289,7 +289,7 @@
- }
-
- // The current open file descriptor limit is still too low.
- - if rLimit.Cur < minimumOpenFileLimit {
- + if uint64(rLimit.Cur) < minimumOpenFileLimit {
- return 0, fmt.Errorf("soft open file descriptor limit of %d is under the minimum required %d and cannot be increased\n%s",
- rLimit.Cur,
- minimumOpenFileLimit,
- @@ -297,7 +297,7 @@
- }
-
- // If we have the desired number, just use the default values.
- - if rLimit.Cur >= recommendedOpenFileLimit {
- + if uint64(rLimit.Cur) >= recommendedOpenFileLimit {
- return engine.DefaultMaxOpenFiles, nil
- }
-
- @@ -316,7 +316,7 @@
- // If we have more than enough file descriptors to hit the recommend number
- // for each store, than only constrain the network ones by giving the stores
- // their full recommended number.
- - if rLimit.Cur >= networkConstrainedFileLimit {
- + if uint64(rLimit.Cur) >= networkConstrainedFileLimit {
- return engine.DefaultMaxOpenFiles, nil
- }
-
- Index: src/github.com/cockroachdb/cockroach/pkg/server/status/runtime_jemalloc.go
- --- src/github.com/cockroachdb/cockroach/pkg/server/status/runtime_jemalloc.go.orig 2016-11-27 12:13:10.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/pkg/server/status/runtime_jemalloc.go 2016-11-27 12:21:20.407531382 +0100
- @@ -23,6 +23,7 @@
- // #cgo linux CPPFLAGS: -I../../../vendor/github.com/cockroachdb/c-jemalloc/linux_includes/internal/include
- // #cgo darwin LDFLAGS: -Wl,-undefined -Wl,dynamic_lookup
- // #cgo linux LDFLAGS: -Wl,-unresolved-symbols=ignore-all
- +// #cgo freebsd LDFLAGS: -Wl,-unresolved-symbols=ignore-all
- //
- // #include <jemalloc/jemalloc.h>
- //
- Index: src/github.com/cockroachdb/cockroach/pkg/storage/engine/rocksdb/db.cc
- --- src/github.com/cockroachdb/cockroach/pkg/storage/engine/rocksdb/db.cc.orig 2016-11-27 12:13:10.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/pkg/storage/engine/rocksdb/db.cc 2016-11-27 12:21:20.407531382 +0100
- @@ -1847,10 +1847,10 @@
- (int64_t)s->getTickerCount(rocksdb::BLOOM_FILTER_PREFIX_USEFUL);
- stats->memtable_hits = (int64_t)s->getTickerCount(rocksdb::MEMTABLE_HIT);
- stats->memtable_misses = (int64_t)s->getTickerCount(rocksdb::MEMTABLE_MISS);
- - stats->memtable_total_size = std::stoll(memtable_total_size);
- + stats->memtable_total_size = std::strtol(memtable_total_size.c_str(), NULL, 10);
- stats->flushes = (int64_t)event_listener->GetFlushes();
- stats->compactions = (int64_t)event_listener->GetCompactions();
- - stats->table_readers_mem_estimate = std::stoll(table_readers_mem_estimate);
- + stats->table_readers_mem_estimate = std::strtol(table_readers_mem_estimate.c_str(), NULL, 10);
- return kSuccess;
- }
-
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/map.h
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/map.h.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/map.h 2016-11-27 12:21:20.397573831 +0100
- @@ -613,10 +613,7 @@
- }
- }
-
- -#if __cplusplus >= 201103L && !defined(GOOGLE_PROTOBUF_OS_APPLE) && \
- - !defined(GOOGLE_PROTOBUF_OS_NACL) && \
- - !defined(GOOGLE_PROTOBUF_OS_ANDROID) && \
- - !defined(GOOGLE_PROTOBUF_OS_EMSCRIPTEN)
- +#if 0
- template<class NodeType, class... Args>
- void construct(NodeType* p, Args&&... args) {
- // Clang 3.6 doesn't compile static casting to void* directly. (Issue
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathlimits.h
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathlimits.h.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathlimits.h 2016-11-27 12:21:20.397573831 +0100
- @@ -48,7 +48,7 @@
- // include <cmath> because that breaks the definition of isinf with gcc 4.9.
- //
- // TODO(mec): after C++11 everywhere, use <cmath> and std::isinf in this file.
- -#include <math.h>
- +#include <cmath>
- #include <string.h>
-
- #include <cfloat>
- @@ -230,11 +230,11 @@
- static bool IsNegInf(const Type x) { return _fpclass(x) == _FPCLASS_NINF; }
- #else
- #define DECL_FP_LIMIT_FUNCS \
- - static bool IsFinite(const Type x) { return !isinf(x) && !isnan(x); } \
- - static bool IsNaN(const Type x) { return isnan(x); } \
- - static bool IsInf(const Type x) { return isinf(x); } \
- - static bool IsPosInf(const Type x) { return isinf(x) && x > 0; } \
- - static bool IsNegInf(const Type x) { return isinf(x) && x < 0; }
- + static bool IsFinite(const Type x) { return !std::isinf(x) && !std::isnan(x); } \
- + static bool IsNaN(const Type x) { return std::isnan(x); } \
- + static bool IsInf(const Type x) { return std::isinf(x); } \
- + static bool IsPosInf(const Type x) { return std::isinf(x) && x > 0; } \
- + static bool IsNegInf(const Type x) { return std::isinf(x) && x < 0; }
- #endif
-
- // We can't put floating-point constant values in the header here because
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathutil.h
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathutil.h.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathutil.h 2016-11-27 12:21:20.397573831 +0100
- @@ -31,7 +31,7 @@
- #define GOOGLE_PROTOBUF_STUBS_MATHUTIL_H_
-
- #include <float.h>
- -#include <math.h>
- +#include <cmath>
-
- #include <google/protobuf/stubs/common.h>
- #include <google/protobuf/stubs/logging.h>
- @@ -49,7 +49,7 @@
- #ifdef _MSC_VER
- return _isnan(value);
- #else
- - return isnan(value);
- + return std::isnan(value);
- #endif
- }
- template<>
- @@ -57,7 +57,7 @@
- #ifdef _MSC_VER
- return _isnan(value);
- #else
- - return isnan(value);
- + return std::isnan(value);
- #endif
- }
-
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/shared_ptr.h
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/shared_ptr.h.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/shared_ptr.h 2016-11-27 12:21:20.397573831 +0100
- @@ -50,7 +50,7 @@
- #define UTIL_GTL_USE_STD_SHARED_PTR 1
- #endif
-
- -#if defined(UTIL_GTL_USE_STD_SHARED_PTR) && UTIL_GTL_USE_STD_SHARED_PTR
- +#if 0
-
- // These are transitional. They will be going away soon.
- // Please just #include <memory> and just type std::shared_ptr yourself, instead
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/cgo_flags.go
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/cgo_flags.go.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/cgo_flags.go 2016-11-27 12:21:20.397573831 +0100
- @@ -11,9 +11,7 @@
- // #cgo linux CPPFLAGS: -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DROCKSDB_MALLOC_USABLE_SIZE
- // #cgo freebsd CPPFLAGS: -DOS_FREEBSD
- // #cgo dragonfly CPPFLAGS: -DOS_DRAGONFLY
- +// #cgo CXXFLAGS: -Wno-unused-parameter
- // #cgo CXXFLAGS: -std=c++11 -fno-omit-frame-pointer -momit-leaf-frame-pointer
- -// #cgo darwin CXXFLAGS: -Wshorten-64-to-32
- -// #cgo freebsd CXXFLAGS: -Wshorten-64-to-32
- -// #cgo dragonfly CXXFLAGS: -Wshorten-64-to-32
- // #cgo windows LDFLAGS: -lrpcrt4
- import "C"
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/build_detect_platform
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/build_detect_platform.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/build_detect_platform 2016-11-27 12:21:20.397573831 +0100
- @@ -374,18 +374,6 @@
- fi
- fi
-
- -# TODO(tec): Fix -Wshorten-64-to-32 errors on FreeBSD and enable the warning.
- -# -Wshorten-64-to-32 breaks compilation on FreeBSD i386
- -if ! [ "$TARGET_OS" = FreeBSD -a "$TARGET_ARCHITECTURE" = i386 ]; then
- - # Test whether -Wshorten-64-to-32 is available
- - $CXX $CFLAGS -x c++ - -o /dev/null -Wshorten-64-to-32 2>/dev/null <<EOF
- - int main() {}
- -EOF
- - if [ "$?" = 0 ]; then
- - COMMON_FLAGS="$COMMON_FLAGS -Wshorten-64-to-32"
- - fi
- -fi
- -
- # shall we use HDFS?
-
- if test "$USE_HDFS"; then
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/fbcode_config.sh
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/fbcode_config.sh.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/fbcode_config.sh 2016-11-27 12:21:20.397573831 +0100
- @@ -126,7 +126,7 @@
- EXEC_LDFLAGS+=" $LIBUNWIND"
- EXEC_LDFLAGS+=" -Wl,-rpath=/usr/local/fbcode/gcc-4.9-glibc-2.20/lib"
-
- -PLATFORM_LDFLAGS="$LIBGCC_LIBS $GLIBC_LIBS $STDLIBS -lgcc -lstdc++"
- +PLATFORM_LDFLAGS="$LIBGCC_LIBS $GLIBC_LIBS $STDLIBS -lstdc++"
-
- EXEC_LDFLAGS_SHARED="$SNAPPY_LIBS $ZLIB_LIBS $BZIP_LIBS $LZ4_LIBS $ZSTD_LIBS $GFLAGS_LIBS"
-
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/port/port_posix.h
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/port/port_posix.h.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/port/port_posix.h 2016-11-27 12:21:20.397573831 +0100
- @@ -27,7 +27,7 @@
- #define PLATFORM_IS_LITTLE_ENDIAN \
- (__DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN)
- #endif
- -#elif defined(OS_SOLARIS)
- +#elif defined(OS_SOLARIS) || defined(__sun)
- #include <sys/isa_defs.h>
- #ifdef _LITTLE_ENDIAN
- #define PLATFORM_IS_LITTLE_ENDIAN true
- @@ -35,7 +35,7 @@
- #define PLATFORM_IS_LITTLE_ENDIAN false
- #endif
- #elif defined(OS_FREEBSD) || defined(OS_OPENBSD) || defined(OS_NETBSD) || \
- - defined(OS_DRAGONFLYBSD) || defined(OS_ANDROID)
- + defined(OS_DRAGONFLYBSD) || defined(OS_ANDROID) || defined(__FreeBSD__)
- #include <sys/endian.h>
- #include <sys/types.h>
- #define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN)
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/env_posix.cc
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/env_posix.cc.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/env_posix.cc 2016-11-27 12:21:20.397573831 +0100
- @@ -52,6 +52,11 @@
- #include "util/thread_local.h"
- #include "util/thread_status_updater.h"
-
- +#if defined(OS_FREEBSD) || defined(__FreeBSD__)
- +#define fdatasync fsync
- +#define fread_unlocked fread
- +#endif
- +
- #if !defined(TMPFS_MAGIC)
- #define TMPFS_MAGIC 0x01021994
- #endif
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_builder.cc
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_builder.cc.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_builder.cc 2016-11-27 12:21:20.397573831 +0100
- @@ -26,7 +26,7 @@
- // Otherwise, calculate a score based on threshold and expected value of
- // two styles, weighing reads 4X important than writes.
- int expected_levels = static_cast<int>(ceil(
- - std::log(target_db_size / write_buffer_size) / std::log(kBytesForLevelMultiplier)));
- + log(target_db_size / write_buffer_size) / log(kBytesForLevelMultiplier)));
-
- int expected_max_files_universal =
- static_cast<int>(ceil(log2(target_db_size / write_buffer_size)));
- @@ -117,8 +117,8 @@
- int write_amplification_threshold,
- uint64_t target_db_size, Options* options) {
- int expected_levels_one_level0_file =
- - static_cast<int>(ceil(std::log(target_db_size / options->write_buffer_size) /
- - std::log(kBytesForLevelMultiplier)));
- + static_cast<int>(ceil(log(target_db_size / options->write_buffer_size) /
- + log(kBytesForLevelMultiplier)));
-
- int level0_stop_writes_trigger =
- read_amplification_threshold - expected_levels_one_level0_file;
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_helper.cc
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_helper.cc.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_helper.cc 2016-11-27 12:21:20.397573831 +0100
- @@ -160,7 +160,7 @@
-
- uint64_t ParseUint64(const std::string& value) {
- size_t endchar;
- -#ifndef CYGWIN
- +#if 0
- uint64_t num = std::stoull(value.c_str(), &endchar);
- #else
- char* endptr;
- @@ -198,7 +198,7 @@
-
- int ParseInt(const std::string& value) {
- size_t endchar;
- -#ifndef CYGWIN
- +#if 0
- int num = std::stoi(value.c_str(), &endchar);
- #else
- char* endptr;
- @@ -220,7 +220,7 @@
- }
-
- double ParseDouble(const std::string& value) {
- -#ifndef CYGWIN
- +#if 0
- return std::stod(value);
- #else
- return std::strtod(value.c_str(), 0);
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/string_util.h
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/string_util.h.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/string_util.h 2016-11-27 12:21:20.397573831 +0100
- @@ -16,15 +16,9 @@
-
- template <typename T>
- inline std::string ToString(T value) {
- -#if !(defined OS_ANDROID) && !(defined CYGWIN)
- - return std::to_string(value);
- -#else
- - // Andorid or cygwin doesn't support all of C++11, std::to_string() being
- - // one of the not supported features.
- std::ostringstream os;
- os << value;
- return os.str();
- -#endif
- }
-
- } // namespace rocksdb
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/thread_posix.cc
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/thread_posix.cc.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/thread_posix.cc 2016-11-27 12:21:20.397573831 +0100
- @@ -10,6 +10,7 @@
- #include "util/thread_posix.h"
- #include <atomic>
- #include <unistd.h>
- +#include <stdlib.h>
- #ifdef OS_LINUX
- #include <sys/syscall.h>
- #endif
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/transaction_test_util.cc
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/transaction_test_util.cc.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/transaction_test_util.cc 2016-11-27 12:21:20.407531382 +0100
- @@ -94,7 +94,7 @@
-
- if (s.ok()) {
- // Found key, parse its value
- - int_value = std::stoull(value);
- + int_value = strtol(value.c_str(), NULL, 10);
-
- if (int_value == 0 || int_value == ULONG_MAX) {
- unexpected_error = true;
- @@ -205,7 +205,7 @@
- }
-
- Slice value = iter->value();
- - uint64_t int_value = std::stoull(value.ToString());
- + uint64_t int_value = strtol(value.ToString().c_str(), NULL, 10);
- if (int_value == 0 || int_value == ULONG_MAX) {
- fprintf(stderr, "Iter returned unexpected value: %s\n",
- value.ToString().c_str());
- Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/utilities/geodb/geodb_impl.cc
- --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/utilities/geodb/geodb_impl.cc.orig 2016-11-27 12:13:18.000000000 +0100
- +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/utilities/geodb/geodb_impl.cc 2016-11-27 12:21:20.407531382 +0100
- @@ -354,7 +354,7 @@
-
- // how many level of details to look for
- int numberOfTilesAtMaxDepth = static_cast<int>(std::floor((bottomRight.x - topLeft.x) / 256));
- - int zoomLevelsToRise = static_cast<int>(std::floor(std::log(numberOfTilesAtMaxDepth) / std::log(2)));
- + int zoomLevelsToRise = static_cast<int>(std::floor(log(numberOfTilesAtMaxDepth) / log(2)));
- zoomLevelsToRise++;
- int levels = std::max(0, Detail - zoomLevelsToRise);
-
- @@ -391,7 +391,7 @@
- double latitude = clip(pos.latitude, MinLatitude, MaxLatitude);
- double x = (pos.longitude + 180) / 360;
- double sinLatitude = sin(latitude * PI / 180);
- - double y = 0.5 - std::log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * PI);
- + double y = 0.5 - log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * PI);
- double mapSize = MapSize(levelOfDetail);
- double X = std::floor(clip(x * mapSize + 0.5, 0, mapSize - 1));
- double Y = std::floor(clip(y * mapSize + 0.5, 0, mapSize - 1));
|