Skip to content

Commit f63e4f0

Browse files
authored
Merge pull request #715 from FtZPetruska/rdatawad-includes
rdatawad: Cleanup header inclusion
2 parents 5038350 + 56f7c33 commit f63e4f0

File tree

11 files changed

+53
-21
lines changed

11 files changed

+53
-21
lines changed

prboom2/data/rd_graphic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
// Convert portable pixmap to Doom patch format
55

6+
#include "rd_graphic.h"
7+
8+
#include <ctype.h>
69
#include <stdlib.h>
7-
#include <stdio.h>
810
#include <string.h>
9-
#include <ctype.h>
1011

11-
#include "rd_util.h"
1212
#include "rd_palette.h"
13-
#include "rd_graphic.h"
13+
#include "rd_util.h"
1414

1515
//
1616
// parseppm

prboom2/data/rd_graphic.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// Copyright (c) 1993-2011 PrBoom developers (see AUTHORS)
22
// Licence: GPLv2 or later (see COPYING)
33

4+
#ifndef RD_GRAPHIC_H
5+
#define RD_GRAPHIC_H
6+
7+
#include <stddef.h>
8+
49
// Convert portable pixmap to Doom format
510

611
// convert ppm to doom patch format, with insertion point
@@ -9,3 +14,5 @@ size_t ppm_to_patch(void **lumpdata, const char *filename,
914

1015
// convert ppm to raw bitmap (for use with flats)
1116
size_t ppm_to_bitmap(void **lumpdata, const char *filename);
17+
18+
#endif /* RD_GRAPHIC_H */

prboom2/data/rd_main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33

44
// Main program, parse command line arguments
55

6-
#include <stdlib.h>
6+
#include <ctype.h>
77
#include <stdio.h>
8+
#include <stdlib.h>
89
#include <string.h>
9-
#include <ctype.h>
1010

11-
#include "rd_util.h"
11+
#include "rd_graphic.h"
1212
#include "rd_output.h"
13-
#include "rd_sound.h"
1413
#include "rd_palette.h"
15-
#include "rd_graphic.h"
14+
#include "rd_sound.h"
15+
#include "rd_util.h"
1616

1717
enum argtype
1818
{

prboom2/data/rd_output.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
// Output wad construction - add lump data, build wad directory
55

6-
#include <stdlib.h>
6+
#include "rd_output.h"
7+
8+
#include <ctype.h>
79
#include <stdio.h>
810
#include <string.h>
9-
#include <ctype.h>
1011

1112
#include "rd_util.h"
12-
#include "rd_output.h"
1313

1414
struct lump
1515
{

prboom2/data/rd_output.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
// Copyright (c) 1993-2011 PrBoom developers (see AUTHORS)
22
// Licence: GPLv2 or later (see COPYING)
33

4+
#ifndef RD_OUTPUT_H
5+
#define RD_OUTPUT_H
6+
7+
#include <stddef.h>
8+
49
// Output wad construction - add lump data, build wad directory
510

611
// append lump to output wad
712
void output_add(const char *filename, const void *data, size_t size);
813

914
// write output file to filename
1015
void output_write(const char *filename);
16+
17+
#endif /* RD_OUTPUT_H */

prboom2/data/rd_palette.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33

44
// Chained hash lookup to convert rgb triples to palette indices
55

6-
#include <stdlib.h>
7-
#include <stdio.h>
6+
#include "rd_palette.h"
7+
88
#include <string.h>
99

1010
#include "rd_util.h"
11-
#include "rd_palette.h"
1211

1312
static unsigned char *palette_data;
1413

prboom2/data/rd_palette.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
// Copyright (c) 1993-2011 PrBoom developers (see AUTHORS)
22
// Licence: GPLv2 or later (see COPYING)
33

4+
#ifndef RD_PALETTE_H
5+
#define RD_PALETTE_H
6+
47
// Chained hash lookup to convert rgb triples to palette indices
58

69
// load raw palette, create hash table etc.
710
void palette_init(const char *filename);
811

912
// lookup colour index of rgb triple
1013
int palette_getindex(const unsigned char *rgb);
14+
15+
#endif /* RD_PALETTE_H */

prboom2/data/rd_sound.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
// Convert WAVE files to Doom sound format
55

6+
#include "rd_sound.h"
7+
68
#include <stdlib.h>
7-
#include <stdio.h>
89
#include <string.h>
910

1011
#include "rd_util.h"
11-
#include "rd_sound.h"
1212

1313
//
1414
// wav_to_doom

prboom2/data/rd_sound.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
// Copyright (c) 1993-2011 PrBoom developers (see AUTHORS)
22
// Licence: GPLv2 or later (see COPYING)
33

4+
#ifndef RD_SOUND_H
5+
#define RD_SOUND_H
6+
7+
#include <stddef.h>
8+
49
// Convert WAVE files to Doom sound format
510

611
// convert wav file to doom sound format
712
size_t wav_to_doom(void **lumpdata, const char *filename);
13+
14+
#endif /* RD_SOUND_H */

prboom2/data/rd_util.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
// Useful utility functions
55

6-
#include <stdlib.h>
6+
#include "rd_util.h"
7+
8+
#include <stdarg.h>
79
#include <stdio.h>
10+
#include <stdlib.h>
811
#include <string.h>
9-
#include <stdarg.h>
10-
11-
#include "rd_util.h"
1212

1313
void ATTR((noreturn)) die(const char *error, ...)
1414
{

0 commit comments

Comments
 (0)