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 11SHELL = /bin/sh
22CC = clang-10
33
4- FLAGS = -std=c11 -fsanitize=cfi -fvisibility=hidden
4+ FLAGS = -std=c11 -fsanitize=cfi -fvisibility=hidden -D_POSIX_C_SOURCE=200809L
55CFLAGS = -pedantic-errors -Wall -Wextra -Werror -Wthread-safety
66DEBUGFLAGS = -O0 -Wno-unused -Wno-unused-parameter -fno-omit-frame-pointer -fno-sanitize-recover=all -g -D _DEBUG
77RELEASEFLAGS = -O3 -fsanitize=safe-stack -D NDEBUG
5454 cpplint src/* .[ch] src/* /* .[ch]
5555
5656format :
57- clang-format-10 -i src/* .[ch]
57+ clang-format-10 -i src/* .[ch] src/ * / * .[ch]
5858
5959tidy :
6060 clang-tidy-10 src/* .[ch] src/* /* .[ch]
Original file line number Diff line number Diff line change 1+ // Copyright 2020 Dale Alleshouse
12#include "./closest_pair.h"
23
34#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) {
9797
9898 // clang-format off
9999 for (size_t i = 0 ; i < sizeof (uint32_t )>> 1 ; i ++ ) {
100+ // clang-format on
100101 uint32_t d = sizeof (uint32_t ) - i - 1 ;
101102
102103 uint32_t mh = ((uint32_t )0xff ) << (d << 3 );
@@ -109,15 +110,16 @@ static inline uint32_t bswap32(const uint32_t x) {
109110
110111 y = t | (y & ~(mh | ml ));
111112 }
112- // clang-format on
113113
114114 return y ;
115115}
116116
117117static inline uint64_t bswap64 (const uint64_t x ) {
118118 uint64_t y = x ;
119119
120+ // clang-format off
120121 for (size_t i = 0 ; i < sizeof (uint64_t )>> 1 ; i ++ ) {
122+ // clang-format on
121123 uint64_t d = sizeof (uint64_t ) - i - 1 ;
122124
123125 uint64_t mh = ((uint64_t )0xff ) << (d << 3 );
Original file line number Diff line number Diff line change 1+ // Copyright 2020 Dale Alleshouse
12#include "./array.h"
23
34#include <stdbool.h>
Original file line number Diff line number Diff line change 1+ // Copyright 2020 Dale Alleshouse
12#include "./sorted_array.h"
23
4+ #include <pthread.h>
35#include <stdlib.h>
6+ #include <time.h>
7+ #include <unistd.h>
48
59#include "../utils/error_reporter.h"
610#include "../utils/math.h"
@@ -151,7 +155,9 @@ static void SortedArray_Max_standard() {
151155 Array * sut = CreateSut (10 );
152156
153157 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 );
155161
156162 Array_Destroy (sut );
157163}
You can’t perform that action at this time.
0 commit comments