Skip to content

Commit 7090366

Browse files
committed
vdisp/dummy, x11_common: IWYU
1 parent d31f1e2 commit 7090366

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

src/video_display/dummy.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,17 @@
3535
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3636
*/
3737

38-
#include "config.h"
39-
#include "config_unix.h"
40-
#include "config_win32.h"
41-
4238
#include <assert.h>
4339
#include <stdbool.h>
40+
#include <stdio.h> // for printf
4441
#include <stdlib.h>
4542
#include <string.h>
4643

4744
#include "debug.h"
4845
#include "host.h"
4946
#include "lib_common.h"
5047
#include "pixfmt_conv.h"
48+
#include "types.h" // for codec_t, R10k, RGBA, UYVY, tile, v210
5149
#include "utils/color_out.h"
5250
#include "utils/macros.h"
5351
#include "utils/misc.h"
@@ -56,6 +54,8 @@
5654
#include "video_codec.h"
5755
#include "video_display.h"
5856

57+
struct module;
58+
5959
#define DEFAULT_DUMP_LEN 32
6060
#define MOD_NAME "[dummy] "
6161

@@ -179,7 +179,7 @@ static void *display_dummy_init(struct module *parent, const char *cfg, unsigned
179179
memcpy(s.codecs, default_codecs, sizeof default_codecs);
180180
int rgb_shift_init[] = DEFAULT_RGB_SHIFT_INIT;
181181
memcpy(s.rgb_shift, &rgb_shift_init, sizeof s.rgb_shift);
182-
char *ccpy = alloca(strlen(cfg) + 1);
182+
char ccpy[strlen(cfg) + 1];
183183
strcpy(ccpy, cfg);
184184

185185
if (!dummy_parse_opts(&s, ccpy)) {

src/x11_common.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,16 @@
4444
* connection and XInitThreads() is called (this also may not be required).
4545
*/
4646

47-
#ifdef HAVE_CONFIG_H
48-
#include "config.h"
49-
#include "config_unix.h"
50-
#include "config_win32.h"
51-
#endif
52-
5347
#include "x11_common.h"
5448

49+
#include <X11/Xlib.h> // for Display, XInternAtom, False, XCh...
50+
#include <limits.h> // for LONG_MAX
5551
#include <pthread.h>
56-
#include <X11/Xlib.h>
57-
#include <X11/Xutil.h>
52+
#include <stdbool.h> // for bool, true
53+
#include <stdio.h> // for NULL, fprintf, stderr, size_t
54+
#include <stdlib.h> // for calloc, abort, free
55+
#include <string.h> // for memcpy
5856

59-
#include "debug.h"
6057
#include "utils/resource_manager.h"
6158

6259
#define resource_symbol "X11-state"
@@ -80,7 +77,7 @@ struct x11_state *get_state() {
8077
if(!state->initialized) {
8178
state->display = NULL;
8279
pthread_mutex_init(&state->lock, NULL);
83-
state->display_opened_here = TRUE;
80+
state->display_opened_here = true;
8481
state->ref_num = 0;
8582
state->initialized = true;
8683
}
@@ -101,7 +98,7 @@ void x11_set_display(void *disp)
10198
abort();
10299
}
103100
s->display = d;
104-
s->display_opened_here = FALSE;
101+
s->display_opened_here = false;
105102
pthread_mutex_unlock(&s->lock);
106103
}
107104

@@ -110,7 +107,7 @@ void * x11_acquire_display(void)
110107
struct x11_state *s = get_state();
111108
if(!s->display) {
112109
s->display = XOpenDisplay(0);
113-
s->display_opened_here = TRUE;
110+
s->display_opened_here = true;
114111
}
115112

116113
if ( !s->display )

src/x11_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3636
*/
3737

38+
#include <X11/X.h> // for Window
3839
#include <X11/Xlib.h>
3940

4041
#ifdef __cplusplus

0 commit comments

Comments
 (0)