Skip to content

Commit 89a9a92

Browse files
committed
fix some comments
1 parent 1517b31 commit 89a9a92

File tree

4 files changed

+30
-40
lines changed

4 files changed

+30
-40
lines changed

benchrunner/benchrunner.cabal

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ executable benchrunner
3232
ghc-options: -Wall -Wcompat
3333
-threaded -rtsopts
3434
-fdefer-typed-holes
35-
-O2 -optl -lstdc++ -optl -lgcc_s
36-
37-
35+
-O2 -optl -optl-lstdc++
3836

37+
extra-libraries: stdc++
3938

4039
c-sources:
4140
csorts/insertionsort.c
@@ -50,16 +49,7 @@ executable benchrunner
5049
cxx/mergesort_int_wrapper.cpp
5150
cxx/quicksort_int_wrapper.cpp
5251

53-
if impl(ghc >= 9.4)
54-
build-depends: system-cxx-std-lib
55-
else
56-
if os(windows)
57-
extra-libraries: stdc++
58-
if os(linux)
59-
extra-libraries: stdc++
60-
if os(darwin)
61-
extra-libraries: stdc++
62-
52+
build-depends: system-cxx-std-lib
6353

6454
-- DNDEBUG disables asserts in cbits/
6555
cc-options: -std=c11 -O3 -DNDEBUG=1

benchrunner/cxx/Makefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ DEBUG := 0
77
CILK := 0
88

99
ifeq ($(CILK), 1)
10-
ifeq ($(USECLANG), 0)
11-
$(error cilk can only be used with an opencilk compiler!)
12-
endif
10+
ifeq ($(USECLANG), 0)
11+
$(error cilk can only be used with an opencilk compiler!)
12+
endif
1313
endif
1414

1515
OpenCILK_CLANG := clang-16
@@ -26,23 +26,23 @@ CDEBUG := -DCBENCH_DEBUG -O0 -g
2626
CFLAGS += -Wall -Wextra -Wpedantic -flto
2727

2828
ifeq ($(USECLANG), 1)
29-
CC = $(CLANG)
30-
CFLAGS = $(CLANG_FLAGS)
31-
LFLAGS := -fuse-ld=lld
29+
CC = $(CLANG)
30+
CFLAGS = $(CLANG_FLAGS)
31+
LFLAGS := -fuse-ld=lld
3232
endif
3333

3434
ifeq ($(CILK), 1)
35-
ifeq ($(USECLANG), 1)
36-
CC = $(OpenCILK_CLANG)
37-
CFLAGS = $(OpenCILK_CLANG_FLAGS)
38-
LFLAGS := -fuse-ld=lld
39-
endif
35+
ifeq ($(USECLANG), 1)
36+
CC = $(OpenCILK_CLANG)
37+
CFLAGS = $(OpenCILK_CLANG_FLAGS)
38+
LFLAGS := -fuse-ld=lld
39+
endif
4040
endif
4141

4242
ifeq ($(DEBUG), 1)
43-
CFLAGS += $(CDEBUG)
43+
CFLAGS += $(CDEBUG)
4444
else
45-
CFLAGS += -O3
45+
CFLAGS += -O3
4646
endif
4747

4848
all: $(OUT)
@@ -54,6 +54,6 @@ $(OUT): $(OBJFILES)
5454
$(CC) $(CFLAGS) -c -o $@ $^
5555

5656
clean:
57-
rm -f $(OBJFILES) $(OUT)
57+
rm -f $(OUT)
5858

5959
.PHONY: clean

benchrunner/cxx/insertionsort_glibc.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ void *insertionsort_glibc(void *const pbase, size_t total_elems, size_t size, __
4242
}
4343

4444
/* Byte-wise swap two items of size SIZE. */
45-
#define SWAP(a, b, size) \
46-
do \
47-
{ \
48-
size_t __size = (size); \
49-
char *__a = (a), *__b = (b); \
50-
do \
51-
{ \
52-
char __tmp = *__a; \
53-
*__a++ = *__b; \
54-
*__b++ = __tmp; \
55-
} while (--__size > 0); \
45+
#define SWAP(a, b, size) \
46+
do \
47+
{ \
48+
size_t __size = (size); \
49+
char *__a = (a), *__b = (b); \
50+
do \
51+
{ \
52+
char __tmp = *__a; \
53+
*__a++ = *__b; \
54+
*__b++ = __tmp; \
55+
} while (--__size > 0); \
5656
} while (0)
5757

5858
#define MAX_THRESH 4

benchrunner/cxx/quicksort.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// void quicksort_inplace_helper(void *_a, size_t n, size_t es);
1111

1212
template<typename T>
13-
void quicksort_inplace_helper(T *_a, size_t n);
13+
inline void quicksort_inplace_helper(T *_a, size_t n);
1414

1515
// void *quicksort_glibc(void *const pbase, size_t total_elems, size_t size, __compar_fn_t cmp)
1616
// {
@@ -121,7 +121,7 @@ T *quicksort_inplace(T *_a, size_t n){
121121
}
122122

123123
template<typename T>
124-
void quicksort_inplace_helper(T *_a, size_t n)
124+
inline void quicksort_inplace_helper(T *_a, size_t n)
125125
{
126126
T *a = (T *) _a;
127127
int j;

0 commit comments

Comments
 (0)