Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #8 from drfie/master

msvc build merge from drfie
  • Loading branch information...
commit ac282953896de70e4771fb93ddfc91b6c5f7f60e 2 parents c89ac9b + 0ad65f0
@swenson authored
Showing with 6 additions and 4 deletions.
  1. +5 −3 sort.h
  2. +1 −1  sort_common.h
View
8 sort.h
@@ -22,7 +22,7 @@
#endif
-#define SORT_SWAP(x,y) ({SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;})
+#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
#define SORT_CONCAT(x, y) x ## _ ## y
#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
@@ -320,7 +320,7 @@ void MERGE_SORT_IN_PLACE_RMERGE(SORT_TYPE *dst, size_t len, size_t lp, size_t r)
}
/* In-place Merge Sort implementation. (c)2012, Andrey Astrelin, astrelin@tochka.ru */
-void MERGE_SORT_IN_PLACE(SORT_TYPE *dst, size_t len)
+void MERGE_SORT_IN_PLACE(SORT_TYPE *dst, const size_t len)
{
size_t r = rbnd(len);
size_t lr = (len / r - 1) * r, p, m, q, q1, p0;
@@ -543,7 +543,9 @@ if (run > len)\
BINARY_INSERTION_SORT_START(&dst[curr], len, run);\
len = run;\
}\
-run_stack[stack_curr++] = (TIM_SORT_RUN_T) {curr, len};\
+run_stack[stack_curr].start = curr;\
+run_stack[stack_curr].length = len;\
+stack_curr++;\
curr += len;\
if (curr == size)\
{\
View
2  sort_common.h
@@ -13,7 +13,7 @@
#define MIN(x,y) (((x) < (y) ? (x) : (y)))
#endif
-__inline int compute_minrun(uint64_t);
+__inline int compute_minrun(const uint64_t);
/* From http://oeis.org/classic/A102549 */
static const uint64_t shell_gaps[48] = {1, 4, 10, 23, 57, 132, 301, 701, 1750, 4376, 10941, 27353, 68383, 170958, 427396, 1068491, 2671228, 6678071, 16695178, 41737946, 104344866, 260862166, 652155416, 1630388541, 4075971353LL, 10189928383LL, 25474820958LL, 63687052396LL, 159217630991LL, 398044077478LL, 995110193696LL, 2487775484241LL, 6219438710603LL, 15548596776508LL, 38871491941271LL, 97178729853178LL, 242946824632946LL, 607367061582366LL, 1518417653955916LL, 3796044134889791LL, 9490110337224478LL, 23725275843061196LL, 59313189607652991LL, 148282974019132478LL, 370707435047831196LL, 926768587619577991LL, 2316921469048944978LL, 5792303672622362446LL};
Please sign in to comment.
Something went wrong with that request. Please try again.