Skip to content

Commit

Permalink
#164 iwyu
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-courtis committed Dec 23, 2024
1 parent 97815b2 commit 5bc00bb
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .iwyu.mappings
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{ symbol: [ va_start, private, <stdarg.h>, public] },
{ symbol: [ va_end, private, <stdarg.h>, public] }
]
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ man: doc/way-displays.1.pandoc
iwyu: override CC = $(IWYU) -Xiwyu --check_also="inc/*h"
iwyu: override CXX = $(IWYU) -Xiwyu --check_also="inc/marshalling.h"
iwyu: clean $(SRC_O) $(TST_O) $(EXAMPLE_O)
IWYU = include-what-you-use -Xiwyu --no_fwd_decls -Xiwyu --error=1 -Xiwyu --verbose=3
IWYU = include-what-you-use -Xiwyu --no_fwd_decls -Xiwyu --error=1 -Xiwyu --verbose=3 -Xiwyu --mapping_file=.iwyu.mappings

cppcheck: $(SRC_C) $(SRC_CXX) $(INC_H) $(EXAMPLE_C) $(TST_H) $(TST_C)
# TODO: add --check-level=exhaustive when cppcheck ~2.14 is availble for CI
Expand Down
2 changes: 1 addition & 1 deletion examples/poke-server.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>

#include "process.h"
#include "sockets.h"
Expand Down
1 change: 1 addition & 0 deletions inc/displ.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// IWYU pragma: end_keep

#include "cfg.h"
#include "head.h"

enum ConfigState {
IDLE = 0,
Expand Down
1 change: 0 additions & 1 deletion inc/mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <stdint.h>

#include "cfg.h"
#include "global.h"
#include "slist.h"
#include "wlr-output-management-unstable-v1.h"

Expand Down
1 change: 1 addition & 0 deletions inc/sockets.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef SOCKETS_H
#define SOCKETS_H

#include <stddef.h>
#include <sys/types.h>
#include <sys/un.h>

Expand Down
2 changes: 2 additions & 0 deletions src/displ.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

#include "displ.h"

#include "cfg.h"
#include "global.h"
#include "head.h"
#include "listeners.h"
#include "log.h"
#include "output.h"
Expand Down
1 change: 1 addition & 0 deletions src/fds.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdlib.h>
#include <sys/inotify.h>
#include <sys/signalfd.h>
#include <sys/types.h>
#include <unistd.h>
#include <wayland-client-core.h>

Expand Down
2 changes: 0 additions & 2 deletions src/global.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include <stddef.h>

#include "global.h"

struct Displ *displ = NULL;
struct Lid *lid = NULL;
struct Cfg *cfg = NULL;
Expand Down
1 change: 1 addition & 0 deletions src/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "cfg.h"
#include "convert.h"
#include "displ.h"
#include "head.h"
#include "lid.h"
#include "log.h"
Expand Down
2 changes: 1 addition & 1 deletion src/layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "cfg.h"
#include "displ.h"
#include "fs.h"
#include "global.h"
#include "head.h"
#include "info.h"
Expand All @@ -18,6 +17,7 @@
#include "log.h"
#include "mode.h"
#include "process.h"
#include "stable.h"
#include "wlr-output-management-unstable-v1.h"

void position_heads(struct SList *heads) {
Expand Down
1 change: 0 additions & 1 deletion src/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "log.h"

#include "fs.h"
#include "slist.h"

#define LS 16384
Expand Down
2 changes: 2 additions & 0 deletions src/marshalling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <yaml-cpp/emitter.h>
#include <yaml-cpp/emittermanip.h>
#include <yaml-cpp/exceptions.h>
#include <yaml-cpp/node/detail/impl.h>
#include <yaml-cpp/node/detail/iterator.h>
#include <yaml-cpp/node/detail/iterator_fwd.h>
#include <yaml-cpp/node/impl.h>
Expand All @@ -23,6 +24,7 @@
extern "C" {
#include "cfg.h"
#include "convert.h"
#include "fn.h"
#include "global.h"
#include "head.h"
#include "ipc.h"
Expand Down
1 change: 0 additions & 1 deletion src/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/types.h>
Expand Down
1 change: 1 addition & 0 deletions src/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>

Expand Down
6 changes: 5 additions & 1 deletion tst/tst-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
#include <wayland-client-protocol.h>

#include "cfg.h"
#include "slist.h"
#include "displ.h"
#include "head.h"
#include "log.h"
#include "mode.h"
#include "slist.h"
#include "wlr-output-management-unstable-v1.h"

#include "info.h"

Expand Down
10 changes: 4 additions & 6 deletions tst/tst-listener_zwlr_output_mode.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
#include "tst.h"
#include "asserts.h"
#include "util.h"

#include <cmocka.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <wayland-client-protocol.h>

#include "cfg.h"
#include "slist.h"
#include "head.h"
#include "log.h"
#include "info.h"
#include "mode.h"
#include "slist.h"
#include "wlr-output-management-unstable-v1.h"

#include "listeners.h"

Expand Down

0 comments on commit 5bc00bb

Please sign in to comment.