Skip to content

Commit 0a6079b

Browse files
committed
compatible with VS2010
1 parent 81b8746 commit 0a6079b

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Sort
22

3-
[![Build Status](https://travis-ci.org/Baobaobear/sort.svg?branch=master)](https://travis-ci.org/Baobaobear/sort) [![Build status](https://ci.appveyor.com/api/projects/status/wtt8m5ss33jxl3og?svg=true)](https://ci.appveyor.com/project/Baobaobear/sort) [![Language](https://img.shields.io/badge/language-C++-blue.svg)](https://isocpp.org/) [![Standard](https://img.shields.io/badge/C++-03-orange.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
3+
[![Build Status]][Travis CI][![Appveyor status]][Appveyor] [![Language]](https://isocpp.org/)[![Standard]][Standard Cpp][![License]][MIT]
44

55
# Overview
66

@@ -122,6 +122,15 @@ The y-axis is `time / length * 1000000`
122122
123123
This project is licensed under the MIT License.
124124
125+
[Build Status]: https://travis-ci.org/Baobaobear/sort.svg?branch=master
126+
[Travis CI]: https://travis-ci.org/Baobaobear/sort
127+
[Appveyor status]: https://ci.appveyor.com/api/projects/status/wtt8m5ss33jxl3og?svg=true
128+
[Appveyor]: https://ci.appveyor.com/project/Baobaobear/sort
129+
[Language]: https://img.shields.io/badge/language-C++-blue.svg
130+
[Standard]: https://img.shields.io/badge/C++-03-orange.svg
131+
[Standard Cpp]: https://en.wikipedia.org/wiki/C%2B%2B#Standardization
132+
[License]: https://img.shields.io/badge/license-MIT-blue.svg
133+
[MIT]: https://opensource.org/licenses/MIT
125134
[sorttest.cpp]: sorttest.cpp
126135
[demo.cpp]: demo.cpp
127136
[Grailsort]: https://github.com/Mrrl/GrailSort

sortlib.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <ctime>
1414
#include <cstring>
1515

16-
#if __cplusplus >= 201103L || _MSC_VER >= 1700
16+
#if __cplusplus >= 201103L || _MSC_VER >= 1600
1717
#include <cstdint>
1818
#include <type_traits>
1919
#else
@@ -49,7 +49,7 @@ struct value_constant
4949
static const T value = V;
5050
};
5151

52-
#if __cplusplus >= 201103L || _MSC_VER >= 1700
52+
#if __cplusplus >= 201103L || _MSC_VER >= 1600
5353

5454
template< class T >
5555
struct is_integral
@@ -1148,7 +1148,7 @@ void quick_sort(RandomAccessIterator beg, RandomAccessIterator end, Comp compare
11481148
{
11491149
if (end - beg > 1)
11501150
{
1151-
double deep = log(end - beg) / log(1.5);
1151+
double deep = log((double)(end - beg)) / log(1.5);
11521152
quick_sort_loop(beg, end, (int)deep, compare, true);
11531153
}
11541154
}

sorttest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ void init_test_func_map(std::map<std::string, arrar_function_t> &test_func_map)
208208
{
209209
//test_func_map["grail_in"] = baobao_warp::grail_sort_in_place;
210210
//test_func_map["grail_buf"] = baobao_warp::grail_sort_buf;
211-
test_func_map["grail_dyn"] = baobao_warp::grail_sort_dynbuf;
211+
test_func_map["grail_sort"] = baobao_warp::grail_sort_dynbuf;
212212
}
213213
// https://github.com/BonzaiThePenguin/WikiSort
214214
{

sorttest.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <algorithm>
1414
#include <cstdlib>
15+
#include <functional>
1516

1617
#if __cplusplus >= 201103L || _MSC_VER >= 1700
1718
#define BAO_SORT_LIB_STD11

wikisort.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <limits>
1616

1717
// whether to give WikiSort a full-size cache, to see how it performs when given more memory
18-
#define DYNAMIC_CACHE false
18+
#define DYNAMIC_CACHE 0
1919

2020

2121
// structure to represent ranges within the array
@@ -547,7 +547,7 @@ namespace Wiki {
547547
// 7. sort the second internal buffer if it exists
548548
// 8. redistribute the two internal buffers back into the array
549549

550-
std::size_t block_size = static_cast<std::size_t>(std::sqrt(iterator.length()));
550+
std::size_t block_size = static_cast<std::size_t>(std::sqrt((double)iterator.length()));
551551
std::size_t buffer_size = iterator.length()/block_size + 1;
552552

553553
// as an optimization, we really only need to pull out the internal buffers once for each level of merges

0 commit comments

Comments
 (0)