Skip to content

Commit

Permalink
Apply suggestions from include-what-you-use
Browse files Browse the repository at this point in the history
  • Loading branch information
fragglet committed Oct 13, 2024
1 parent 55e383d commit 8921f87
Show file tree
Hide file tree
Showing 80 changed files with 310 additions and 161 deletions.
14 changes: 11 additions & 3 deletions src/browser/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,38 @@
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//

#include "browser/actions.h"

#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <assert.h>
#include <curses.h>
#include <stdint.h>
#include <strings.h>

#include "browser/actions.h"
#include "browser/browser.h"
#include "common.h"
#include "conv/error.h"
#include "conv/import.h"
#include "ui/dialog.h"
#include "conv/export.h"
#include "ui/pane.h"
#include "pager/pager.h"
#include "pager/help.h"
#include "pager/hexdump.h"
#include "palette/palfs.h"
#include "stringlib.h"
#include "ui/title_bar.h"
#include "ui/ui.h"
#include "fs/vfs.h"
#include "textures/textures.h"
#include "view.h"
#include "browser/directory_pane.h"
#include "fs/vfile.h"
#include "fs/wad_file.h"
#include "ui/actions_bar.h"
#include "ui/list_pane.h"

#define WAD_JUNK_THRESHOLD_KB 500

Expand Down
4 changes: 4 additions & 0 deletions src/browser/actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
#ifndef BROWSER__ACTIONS_H_INCLUDED
#define BROWSER__ACTIONS_H_INCLUDED

#include <stdbool.h>

#include "browser/directory_pane.h"
#include "ui/actions_bar.h"

struct directory;

extern const struct action copy_action;
extern const struct action copy_noconv_action;
extern const struct action export_action;
Expand Down
5 changes: 2 additions & 3 deletions src/browser/actions_pane.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//

#include "browser/actions_pane.h"

#include <string.h>
#include <limits.h>
#include <stdbool.h>

#include "browser/actions_pane.h"
#include "ui/colors.h"
#include "common.h"
#include "stringlib.h"
#include "ui/ui.h"

static const int key_ordering[] = {
Expand Down
3 changes: 3 additions & 0 deletions src/browser/actions_pane.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#ifndef BROWSER__ACTIONS_PANE_H_INCLUDED
#define BROWSER__ACTIONS_PANE_H_INCLUDED

#include <curses.h>
#include <stdbool.h>

#include "ui/actions_bar.h"
#include "ui/pane.h"

Expand Down
15 changes: 7 additions & 8 deletions src/browser/browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,31 @@
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//

#include "browser/browser.h"

#include <curses.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>

#include "common.h"
#include "fs/vfs.h"
#include "lump_info.h"
#include "sixel_display.h"
#include "stringlib.h"
#include "termfuncs.h"
#include "textures/textures.h"
#include "ui/actions_bar.h"
#include "ui/colors.h"
#include "ui/dialog.h"
#include "ui/stack.h"
#include "ui/title_bar.h"
#include "ui/ui.h"
#include "view.h"

#include "browser/actions_pane.h"
#include "browser/actions.h"
#include "browser/directory_pane.h"
#include "browser/browser.h"

#include "palette/actions.h"
#include "ui/list_pane.h"
#include "ui/pane.h"
#include "ui/text_input.h"

#define INFO_PANE_WIDTH 30

Expand Down
4 changes: 4 additions & 0 deletions src/browser/browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#ifndef BROWSER__BROWSER_H_INCLUDED
#define BROWSER__BROWSER_H_INCLUDED

#include <stdbool.h>

struct directory_pane;

void B_SwitchToPane(struct directory_pane *pane);
void B_ReplacePane(struct directory_pane *old_pane,
struct directory_pane *new_pane);
Expand Down
9 changes: 4 additions & 5 deletions src/browser/directory_pane.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//

#include "browser/directory_pane.h"

#include <curses.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <strings.h>

#include "ui/colors.h"
#include "browser/directory_pane.h"
#include "common.h"
#include "ui/dialog.h"
#include "stringlib.h"
#include "ui/ui.h"
#include "ui/pane.h"

static int HeaderEntries(struct directory_pane *dp)
{
Expand Down
4 changes: 4 additions & 0 deletions src/browser/directory_pane.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#ifndef BROWSER__DIRECTORY_PANE_H_INCLUDED
#define BROWSER__DIRECTORY_PANE_H_INCLUDED

#include <curses.h>
#include <stdbool.h>
#include <stdint.h>

#include "ui/list_pane.h"
#include "fs/vfs.h"

Expand Down
2 changes: 2 additions & 0 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#define COMMON_H_INCLUDED

#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#define CTRL_(x) ((x) & 0x1f)
Expand Down
5 changes: 4 additions & 1 deletion src/conv/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//

#include "conv/audio.h"

#include <stdlib.h>
#include <sndfile.h>
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>

#include "conv/audio.h"
#include "conv/error.h"
#include "common.h"

Expand Down
2 changes: 2 additions & 0 deletions src/conv/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#ifndef CONV__AUDIO_H_INCLUDED
#define CONV__AUDIO_H_INCLUDED

#include <stdint.h>

#include "fs/vfile.h"

struct sound_header {
Expand Down
4 changes: 2 additions & 2 deletions src/conv/endoom.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//

#include "conv/endoom.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <curses.h>
#include <sys/time.h>

#include "common.h"
#include "conv/endoom.h"
#include "termfuncs.h"

static const char *cp437_to_utf8[256] = {
Expand Down
5 changes: 2 additions & 3 deletions src/conv/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//

#include "conv/error.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdbool.h>

#include "conv/error.h"

#define MAX_ERROR_LEN 256

static bool have_error;
Expand Down
12 changes: 8 additions & 4 deletions src/conv/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,27 @@
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//

#include <curses.h>
#include "conv/export.h"

#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "conv/audio.h"
#include "conv/error.h"
#include "ui/dialog.h"
#include "conv/export.h"
#include "conv/graphic.h"
#include "conv/palette.h"
#include "lump_info.h"
#include "conv/mus2mid.h"
#include "stringlib.h"
#include "textures/textures.h"
#include "ui/title_bar.h"
#include "ui/ui.h"
#include "fs/vfile.h"
#include "fs/vfs.h"
#include "palette/palette.h"

struct lump_type;

static VFILE *ConvertPnames(VFILE *input)
{
Expand Down
7 changes: 7 additions & 0 deletions src/conv/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@
#ifndef CONV__EXPORT_H_INCLUDED
#define CONV__EXPORT_H_INCLUDED

#include <stdbool.h>

#include "lump_info.h"
#include "fs/vfs.h"

struct directory;
struct directory_entry;
struct file_set;
struct lump_type;

bool ExportToFile(struct directory *from, struct directory_entry *ent,
const struct lump_type *lt, const char *to_filename,
bool convert);
Expand Down
6 changes: 5 additions & 1 deletion src/conv/graphic.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//

#include "conv/graphic.h"

#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>

#include "common.h"
#include "fs/vfile.h"
#include "palette/palette.h"
#include "conv/error.h"
#include "conv/graphic.h"
#include "conv/vpng.h"

// Hexen loading screen
Expand Down
4 changes: 4 additions & 0 deletions src/conv/graphic.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
#ifndef CONV__GRAPHIC_H_INCLUDED
#define CONV__GRAPHIC_H_INCLUDED

#include <stdint.h>

#include "fs/vfile.h"
#include "palette/palette.h"

struct palette;

struct patch_header {
uint16_t width, height;
int16_t leftoffset, topoffset;
Expand Down
11 changes: 6 additions & 5 deletions src/conv/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//

#include "conv/import.h"

#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
#include <strings.h>

#include "common.h"
#include "conv/audio.h"
#include "conv/error.h"
#include "conv/graphic.h"
#include "conv/import.h"
#include "conv/palette.h"
#include "lump_info.h"
#include "stringlib.h"
#include "textures/textures.h"
#include "ui/dialog.h"
#include "fs/vfs.h"
#include "fs/wad_file.h"
#include "palette/palette.h"

static void LumpNameForEntry(char *namebuf, struct directory_entry *ent)
{
Expand Down
6 changes: 6 additions & 0 deletions src/conv/import.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
#ifndef CONV__IMPORT_H_INCLUDED
#define CONV__IMPORT_H_INCLUDED

#include <stdbool.h>

#include "fs/vfs.h"
#include "fs/vfile.h"

struct directory;
struct file_set;

bool ImportFromFile(VFILE *from_file, const char *src_name,
struct directory *to_wad, int lumpnum, bool convert);
Expand Down
4 changes: 2 additions & 2 deletions src/conv/mus2mid.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
// mus2mid.c - Ben Ryves 2006 - http://benryves.com - [email protected]
// Use to convert a MUS file into a single track, type 0 MIDI file.

#include "conv/mus2mid.h"

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>

#include "common.h"
#include "conv/mus2mid.h"
#include "fs/vfile.h"

// TODO
Expand Down
2 changes: 2 additions & 0 deletions src/conv/mus2mid.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#ifndef CONV__MUS2MID_H_INCLUDED
#define CONV__MUS2MID_H_INCLUDED

#include <stdbool.h>

#include "fs/vfile.h"

bool mus2mid(VFILE *musinput, VFILE *midioutput);
Expand Down
Loading

0 comments on commit 8921f87

Please sign in to comment.