src,test: clean up #include directives

This commit is contained in:
Bert Belder 2019-06-12 16:56:31 +02:00
parent 027fb4a419
commit a627f365fd
No known key found for this signature in database
GPG Key ID: 7A77887B2E2ED461
28 changed files with 23 additions and 48 deletions

View File

@ -1,12 +1,11 @@
#include <malloc.h> #include <assert.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include "afd.h" #include "afd.h"
#include "error.h" #include "error.h"
#include "nt.h" #include "nt.h"
#include "util.h"
#include "win.h" #include "win.h"
#include "ws.h"
#define IOCTL_AFD_POLL 0x00012024 #define IOCTL_AFD_POLL 0x00012024

View File

@ -3,7 +3,6 @@
#include "internal.h" #include "internal.h"
#include "nt.h" #include "nt.h"
#include "util.h"
#include "win.h" #include "win.h"
/* clang-format off */ /* clang-format off */

View File

@ -6,7 +6,6 @@
#include "init.h" #include "init.h"
#include "port.h" #include "port.h"
#include "thread-safe-tree.h" #include "thread-safe-tree.h"
#include "util.h"
#include "wepoll.h" #include "wepoll.h"
#include "win.h" #include "win.h"

View File

@ -1,11 +1,12 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h>
#include "afd.h"
#include "api.h" #include "api.h"
#include "init.h" #include "init.h"
#include "nt.h" #include "nt.h"
#include "reflock.h" #include "reflock.h"
#include "util.h" #include "util.h"
#include "win.h"
#include "ws.h" #include "ws.h"
static bool init__done = false; static bool init__done = false;

View File

@ -1,7 +1,8 @@
#include <assert.h> #include <assert.h>
#include <malloc.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "afd.h"
#include "error.h" #include "error.h"
#include "poll-group.h" #include "poll-group.h"
#include "port.h" #include "port.h"

View File

@ -1,13 +1,12 @@
#ifndef WEPOLL_POLL_GROUP_H_ #ifndef WEPOLL_POLL_GROUP_H_
#define WEPOLL_POLL_GROUP_H_ #define WEPOLL_POLL_GROUP_H_
#include "error.h"
#include "internal.h" #include "internal.h"
#include "queue.h"
#include "win.h" #include "win.h"
typedef struct port_state port_state_t;
typedef struct poll_group poll_group_t; typedef struct poll_group poll_group_t;
typedef struct port_state port_state_t;
typedef struct queue_node queue_node_t;
WEPOLL_INTERNAL poll_group_t* poll_group_acquire(port_state_t* port); WEPOLL_INTERNAL poll_group_t* poll_group_acquire(port_state_t* port);
WEPOLL_INTERNAL void poll_group_release(poll_group_t* poll_group); WEPOLL_INTERNAL void poll_group_release(poll_group_t* poll_group);

View File

@ -1,5 +1,5 @@
#include <assert.h> #include <assert.h>
#include <malloc.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -1,18 +1,14 @@
#ifndef WEPOLL_PORT_H_ #ifndef WEPOLL_PORT_H_
#define WEPOLL_PORT_H_ #define WEPOLL_PORT_H_
#include "afd.h"
#include "internal.h" #include "internal.h"
#include "poll-group.h" #include "wepoll.h"
#include "queue.h"
#include "sock.h"
#include "thread-safe-tree.h"
#include "tree.h"
#include "util.h"
#include "win.h" #include "win.h"
typedef struct port_state port_state_t; typedef struct port_state port_state_t;
typedef struct queue queue_t;
typedef struct sock_state sock_state_t; typedef struct sock_state sock_state_t;
typedef struct ts_tree_node ts_tree_node_t;
WEPOLL_INTERNAL port_state_t* port_new(HANDLE* iocp_handle_out); WEPOLL_INTERNAL port_state_t* port_new(HANDLE* iocp_handle_out);
WEPOLL_INTERNAL int port_close(port_state_t* port_state); WEPOLL_INTERNAL int port_close(port_state_t* port_state);

View File

@ -1,5 +1,4 @@
#include <assert.h> #include <assert.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include "error.h" #include "error.h"

View File

@ -19,8 +19,6 @@
* should use another lock to guarantee that this can't happen. * should use another lock to guarantee that this can't happen.
*/ */
#include <stdint.h>
#include "internal.h" #include "internal.h"
typedef struct reflock { typedef struct reflock {

View File

@ -1,14 +1,17 @@
#include <assert.h> #include <assert.h>
#include <malloc.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include "afd.h" #include "afd.h"
#include "error.h" #include "error.h"
#include "poll-group.h" #include "poll-group.h"
#include "port.h" #include "port.h"
#include "queue.h"
#include "sock.h" #include "sock.h"
#include "tree.h"
#include "util.h"
#include "wepoll.h" #include "wepoll.h"
#include "ws.h" #include "ws.h"

View File

@ -1,17 +1,14 @@
#ifndef WEPOLL_SOCK_H_ #ifndef WEPOLL_SOCK_H_
#define WEPOLL_SOCK_H_ #define WEPOLL_SOCK_H_
#include <stdint.h>
#include "internal.h" #include "internal.h"
#include "queue.h"
#include "tree.h"
#include "util.h"
#include "wepoll.h" #include "wepoll.h"
#include "win.h" #include "win.h"
typedef struct port_state port_state_t; typedef struct port_state port_state_t;
typedef struct queue_node queue_node_t;
typedef struct sock_state sock_state_t; typedef struct sock_state sock_state_t;
typedef struct tree_node tree_node_t;
WEPOLL_INTERNAL sock_state_t* sock_new(port_state_t* port_state, WEPOLL_INTERNAL sock_state_t* sock_new(port_state_t* port_state,
SOCKET socket); SOCKET socket);

View File

@ -4,6 +4,7 @@
#include <string.h> #include <string.h>
#include "tree.h" #include "tree.h"
#include "util.h"
void tree_init(tree_t* tree) { void tree_init(tree_t* tree) {
memset(tree, 0, sizeof *tree); memset(tree, 0, sizeof *tree);

View File

@ -5,7 +5,6 @@
#include <stdint.h> #include <stdint.h>
#include "internal.h" #include "internal.h"
#include "util.h"
/* N.b.: the tree functions do not set errno or LastError when they fail. Each /* N.b.: the tree functions do not set errno or LastError when they fail. Each
* of the API functions has at most one failure mode. It is up to the caller to * of the API functions has at most one failure mode. It is up to the caller to

View File

@ -1,12 +1,9 @@
#ifndef WEPOLL_UTIL_H_ #ifndef WEPOLL_UTIL_H_
#define WEPOLL_UTIL_H_ #define WEPOLL_UTIL_H_
#include <assert.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "internal.h"
#define array_count(a) (sizeof(a) / (sizeof((a)[0]))) #define array_count(a) (sizeof(a) / (sizeof((a)[0])))
/* clang-format off */ /* clang-format off */

View File

@ -1,8 +1,6 @@
#include <malloc.h>
#include <stdlib.h> #include <stdlib.h>
#include "error.h" #include "error.h"
#include "util.h"
#include "win.h" #include "win.h"
#include "ws.h" #include "ws.h"

View File

@ -2,7 +2,6 @@
#define WEPOLL_WS_H_ #define WEPOLL_WS_H_
#include "internal.h" #include "internal.h"
#include "util.h"
#include "win.h" #include "win.h"
WEPOLL_INTERNAL int ws_global_init(void); WEPOLL_INTERNAL int ws_global_init(void);

View File

@ -10,6 +10,7 @@
*/ */
#include <errno.h> #include <errno.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include "test-util.h" #include "test-util.h"

View File

@ -2,7 +2,6 @@
#include <stdlib.h> #include <stdlib.h>
#include "test-util.h" #include "test-util.h"
#include "util.h"
#include "wepoll.h" #include "wepoll.h"
#include "win.h" #include "win.h"

View File

@ -8,6 +8,7 @@
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "test-util.h" #include "test-util.h"
#include "util.h" #include "util.h"

View File

@ -1,4 +1,3 @@
#include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -1,10 +1,6 @@
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "test-util.h" #include "test-util.h"
#include "util.h"
#include "wepoll.h" #include "wepoll.h"
#include "win.h" #include "win.h"

View File

@ -1,7 +1,5 @@
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "error.h"
#include "test-util.h" #include "test-util.h"
#include "wepoll.h" #include "wepoll.h"
#include "win.h" #include "win.h"

View File

@ -4,7 +4,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "init.h"
#include "test-util.h" #include "test-util.h"
#include "util.h" #include "util.h"
#include "wepoll.h" #include "wepoll.h"

View File

@ -1,6 +1,5 @@
#include <errno.h> #include <errno.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -1,5 +1,6 @@
#include <process.h> #include <process.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -1,8 +1,5 @@
#include <malloc.h>
#include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "test-util.h" #include "test-util.h"
#include "tree.h" #include "tree.h"

View File

@ -1,7 +1,7 @@
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "error.h"
#include "test-util.h" #include "test-util.h"
#include "wepoll.h" #include "wepoll.h"
#include "win.h" #include "win.h"