File tree Expand file tree Collapse file tree 5 files changed +14
-4
lines changed Expand file tree Collapse file tree 5 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
1
SHELL = /bin/sh
2
2
CC = clang-10
3
3
4
- FLAGS = -std=c11 -fsanitize=cfi -fvisibility=hidden
4
+ FLAGS = -std=c11 -fsanitize=cfi -fvisibility=hidden -D_POSIX_C_SOURCE=200809L
5
5
CFLAGS = -pedantic-errors -Wall -Wextra -Werror -Wthread-safety
6
6
DEBUGFLAGS = -O0 -Wno-unused -Wno-unused-parameter -fno-omit-frame-pointer -fno-sanitize-recover=all -g -D _DEBUG
7
7
RELEASEFLAGS = -O3 -fsanitize=safe-stack -D NDEBUG
54
54
cpplint src/* .[ch] src/* /* .[ch]
55
55
56
56
format :
57
- clang-format-10 -i src/* .[ch]
57
+ clang-format-10 -i src/* .[ch] src/ * / * .[ch]
58
58
59
59
tidy :
60
60
clang-tidy-10 src/* .[ch] src/* /* .[ch]
Original file line number Diff line number Diff line change
1
+ // Copyright 2020 Dale Alleshouse
1
2
#include "./closest_pair.h"
2
3
3
4
#include <float.h>
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ static inline uint32_t bswap32(const uint32_t x) {
97
97
98
98
// clang-format off
99
99
for (size_t i = 0 ; i < sizeof (uint32_t )>> 1 ; i ++ ) {
100
+ // clang-format on
100
101
uint32_t d = sizeof (uint32_t ) - i - 1 ;
101
102
102
103
uint32_t mh = ((uint32_t )0xff ) << (d << 3 );
@@ -109,15 +110,16 @@ static inline uint32_t bswap32(const uint32_t x) {
109
110
110
111
y = t | (y & ~(mh | ml ));
111
112
}
112
- // clang-format on
113
113
114
114
return y ;
115
115
}
116
116
117
117
static inline uint64_t bswap64 (const uint64_t x ) {
118
118
uint64_t y = x ;
119
119
120
+ // clang-format off
120
121
for (size_t i = 0 ; i < sizeof (uint64_t )>> 1 ; i ++ ) {
122
+ // clang-format on
121
123
uint64_t d = sizeof (uint64_t ) - i - 1 ;
122
124
123
125
uint64_t mh = ((uint64_t )0xff ) << (d << 3 );
Original file line number Diff line number Diff line change
1
+ // Copyright 2020 Dale Alleshouse
1
2
#include "./array.h"
2
3
3
4
#include <stdbool.h>
Original file line number Diff line number Diff line change
1
+ // Copyright 2020 Dale Alleshouse
1
2
#include "./sorted_array.h"
2
3
4
+ #include <pthread.h>
3
5
#include <stdlib.h>
6
+ #include <time.h>
7
+ #include <unistd.h>
4
8
5
9
#include "../utils/error_reporter.h"
6
10
#include "../utils/math.h"
@@ -151,7 +155,9 @@ static void SortedArray_Max_standard() {
151
155
Array * sut = CreateSut (10 );
152
156
153
157
void * result = SortedArray_Max (sut );
154
- CU_ASSERT_EQUAL (& ((int * )sut -> array )[9 ], result );
158
+ int * arr = sut -> array ;
159
+
160
+ CU_ASSERT_EQUAL (& arr [9 ], result );
155
161
156
162
Array_Destroy (sut );
157
163
}
You can’t perform that action at this time.
0 commit comments