Skip to content

Commit 6a90ddf

Browse files
committed
cleanup: Run clang-tidy on headers, as well.
1 parent bd930cc commit 6a90ddf

File tree

12 files changed

+31
-31
lines changed

12 files changed

+31
-31
lines changed

.clang-tidy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# vim:ft=yaml
2+
HeaderFilterRegex: "/c-toxcore/[^/]+/[^.].+"
23
CheckOptions:
34
- key: readability-identifier-naming.ClassCase
45
value: Camel_Snake_Case
@@ -35,7 +36,7 @@ CheckOptions:
3536
value: lower_case
3637

3738
- key: llvmlibc-restrict-system-libc-headers.Includes
38-
value: "arpa/inet.h,assert.h,ctype.h,errno.h,fcntl.h,getopt.h,libconfig.h,limits.h,linux/if.h,math.h,netdb.h,netinet/in.h,opus.h,pthread.h,signal.h,sodium/crypto_scalarmult_curve25519.h,sodium.h,sodium/randombytes.h,stdarg.h,stdbool.h,stdint.h,stdio.h,stdlib.h,string.h,sys/ioctl.h,syslog.h,sys/resource.h,sys/socket.h,sys/stat.h,sys/time.h,sys/types.h,time.h,unistd.h,vpx/vp8cx.h,vpx/vp8dx.h,vpx/vpx_decoder.h,vpx/vpx_encoder.h,vpx/vpx_image.h"
39+
value: "arpa/inet.h,assert.h,ctype.h,errno.h,fcntl.h,getopt.h,libconfig.h,limits.h,linux/if.h,math.h,netdb.h,netinet/in.h,opus.h,pthread.h,signal.h,sodium/crypto_scalarmult_curve25519.h,sodium.h,sodium/randombytes.h,stdarg.h,stdbool.h,stddef.h,stdint.h,stdio.h,stdlib.h,string.h,sys/ioctl.h,syslog.h,sys/resource.h,sys/socket.h,sys/stat.h,sys/time.h,sys/types.h,time.h,unistd.h,vpx/vp8cx.h,vpx/vp8dx.h,vpx/vpx_decoder.h,vpx/vpx_encoder.h,vpx/vpx_image.h"
3940
- key: hicpp-signed-bitwise.IgnorePositiveIntegerLiterals
4041
value: true
4142
- key: concurrency-mt-unsafe.FunctionSet

.github/settings.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ branches:
1414
contexts:
1515
- "bazel-dbg"
1616
- "bazel-opt"
17-
- "build-alpine-s390x"
1817
- "build-android"
1918
- "build-autotools"
2019
- "build-compcert"

other/analysis/run-clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ run() {
168168
if ! find "${DIRS[@]}" \
169169
-maxdepth 1 -name "*.c" -print0 \
170170
| xargs -0 -n15 -P"$(nproc)" clang-tidy \
171-
-p=_build \
171+
-p="$PWD/_build" \
172172
--extra-arg=-DMIN_LOGGER_LEVEL=LOGGER_LEVEL_TRACE \
173173
"${EXTRA_ARGS[@]}" \
174174
--fix \

other/docker/clang-tidy/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ RUN ["apk", "add", "--no-cache", \
1616

1717
ENV CC=clang CXX=clang++
1818

19-
COPY . /src/workspace/c-toxcore/
20-
WORKDIR /src/workspace/c-toxcore
19+
COPY . /c-toxcore/
20+
WORKDIR /c-toxcore
2121
RUN other/analysis/run-clang-tidy

toxcore/DHT.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ int unpack_ip_port(IP_Port *ip_port, const uint8_t *data, uint16_t length, bool
232232
non_null()
233233
int dht_create_packet(const Memory *mem, const Random *rng,
234234
const uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE],
235-
const uint8_t *shared_key, const uint8_t type,
235+
const uint8_t *shared_key, uint8_t type,
236236
const uint8_t *plain, size_t plain_length,
237237
uint8_t *packet, size_t length);
238238

toxcore/events/events_alloc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Copyright © 2022 The TokTok team.
33
*/
44

5-
#ifndef C_TOXCORE_TOXCORE_TOX_EVENTS_INTERNAL_H
6-
#define C_TOXCORE_TOXCORE_TOX_EVENTS_INTERNAL_H
5+
#ifndef C_TOXCORE_TOXCORE_EVENTS_EVENTS_ALLOC_H
6+
#define C_TOXCORE_TOXCORE_EVENTS_EVENTS_ALLOC_H
77

88
#include "../attributes.h"
99
#include "../bin_pack.h"
@@ -213,4 +213,4 @@ Tox_Events_State *tox_events_alloc(void *user_data);
213213
}
214214
#endif
215215

216-
#endif // C_TOXCORE_TOXCORE_TOX_EVENTS_INTERNAL_H
216+
#endif // C_TOXCORE_TOXCORE_EVENTS_EVENTS_ALLOC_H

toxcore/group_announce.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
/**
77
* Similar to ping.h, but designed for group chat purposes
88
*/
9-
#ifndef GROUP_ANNOUNCE_H
10-
#define GROUP_ANNOUNCE_H
9+
#ifndef C_TOXCORE_TOXCORE_GROUP_ANNOUNCE_H
10+
#define C_TOXCORE_TOXCORE_GROUP_ANNOUNCE_H
1111

1212
#include <stdbool.h>
1313

@@ -215,4 +215,4 @@ bool gca_is_valid_announce(const GC_Announce *announce);
215215
} // extern "C"
216216
#endif
217217

218-
#endif // GROUP_ANNOUNCE_H
218+
#endif // C_TOXCORE_TOXCORE_GROUP_ANNOUNCE_H

toxcore/group_chats.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* An implementation of massive text only group chats.
88
*/
99

10-
#ifndef GROUP_CHATS_H
11-
#define GROUP_CHATS_H
10+
#ifndef C_TOXCORE_TOXCORE_GROUP_CHATS_H
11+
#define C_TOXCORE_TOXCORE_GROUP_CHATS_H
1212

1313
#include <stdbool.h>
1414
#include <stdint.h>
@@ -805,4 +805,4 @@ GC_Chat *gc_get_group_by_public_key(const GC_Session *c, const uint8_t *public_k
805805
non_null()
806806
int gc_add_peers_from_announces(GC_Chat *chat, const GC_Announce *announces, uint8_t gc_announces_count);
807807

808-
#endif // GROUP_CHATS_H
808+
#endif // C_TOXCORE_TOXCORE_GROUP_CHATS_H

toxcore/group_common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* Common groupchat data structures.
77
*/
88

9-
#ifndef GROUP_COMMON_H
10-
#define GROUP_COMMON_H
9+
#ifndef C_TOXCORE_TOXCORE_GROUP_COMMON_H
10+
#define C_TOXCORE_TOXCORE_GROUP_COMMON_H
1111

1212
#include <stdbool.h>
1313
#include <stdint.h>
@@ -410,4 +410,4 @@ int unpack_gc_saved_peers(GC_Chat *chat, const uint8_t *data, uint16_t length);
410410
non_null(1, 2) nullable(4)
411411
int pack_gc_saved_peers(const GC_Chat *chat, uint8_t *data, uint16_t length, uint16_t *processed);
412412

413-
#endif // GROUP_COMMON_H
413+
#endif // C_TOXCORE_TOXCORE_GROUP_COMMON_H

toxcore/group_connection.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* An implementation of massive text only group chats.
88
*/
99

10-
#ifndef GROUP_CONNECTION_H
11-
#define GROUP_CONNECTION_H
10+
#ifndef C_TOXCORE_TOXCORE_GROUP_CONNECTION_H
11+
#define C_TOXCORE_TOXCORE_GROUP_CONNECTION_H
1212

1313
#include "group_common.h"
1414

@@ -186,4 +186,4 @@ void gcc_peer_cleanup(GC_Connection *gconn);
186186
non_null()
187187
void gcc_cleanup(const GC_Chat *chat);
188188

189-
#endif // GROUP_CONNECTION_H
189+
#endif // C_TOXCORE_TOXCORE_GROUP_CONNECTION_H

0 commit comments

Comments
 (0)