Skip to content

Commit

Permalink
iwyu: optimise #includes
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed Mar 16, 2021
1 parent 052516f commit ff8f46a
Show file tree
Hide file tree
Showing 204 changed files with 208 additions and 309 deletions.
1 change: 1 addition & 0 deletions address/address.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <stddef.h>
#include <stdbool.h>
#include <stdio.h>
#include "mutt/lib.h"

/**
Expand Down
1 change: 1 addition & 0 deletions address/idna.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/

#include "config.h"
#include <stdint.h>
#include <stdio.h>
#include "mutt/lib.h"
#include "idna2.h"
Expand Down
2 changes: 2 additions & 0 deletions alias/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
*/

#include "config.h"
#include <stddef.h>
#include <config/lib.h>
#include <stdbool.h>
#include "mutt/lib.h"

/**
* SortAliasMethods - Sort methods for email aliases
Expand Down
1 change: 0 additions & 1 deletion alias/dlgalias.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mutt/lib.h"
#include "address/lib.h"
Expand Down
2 changes: 2 additions & 0 deletions alias/dlgquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@

#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
Expand Down
3 changes: 0 additions & 3 deletions alias/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@
#include <stdlib.h>
#include <string.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "gui.h"
#include "lib.h"
#include "alias.h"
#include "mutt_menu.h"
#include "sort.h"

/**
* alias_config_observer - Listen for `sort_alias` configuration changes and reorders menu items accordingly
Expand Down
4 changes: 1 addition & 3 deletions alias/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
#define MUTT_ALIAS_GUI_H

#include <stdbool.h>
#include "sort.h"
#include "core/neomutt.h"
#include "mutt/array.h"
#include "mutt/lib.h"

struct Alias;

Expand Down
4 changes: 1 addition & 3 deletions alias/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@
#include <stdbool.h>
#include <stdint.h>
#include "mutt_commands.h"
#include "sort.h"
#include "gui.h"

struct Address;
struct AddressList;
struct AliasViewArray;
struct Buffer;
struct ConfigSet;
struct ConfigSubset;
struct Envelope;

void alias_init (void);
Expand Down
5 changes: 4 additions & 1 deletion autocrypt/autocrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,20 @@
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/mxapi.h"
#include "gui/lib.h"
#include "lib.h"
#include "hcache/lib.h"
#include "ncrypt/lib.h"
#include "send/lib.h"
#include "context.h"
#include "browser.h"
#include "mutt_globals.h"
#include "muttlib.h"
#include "mx.h"
#include "options.h"

struct Mailbox;

/**
* autocrypt_dir_init - Initialise an Autocrypt directory
* @param can_create If true, the directory may be created
Expand Down
2 changes: 0 additions & 2 deletions autocrypt/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#include <stddef.h>
#include <config/lib.h>
#include <stdbool.h>
#include "private.h"
#include "mutt/lib.h"

// clang-format off
bool C_Autocrypt; ///< Config: Enables the Autocrypt feature
Expand Down
2 changes: 2 additions & 0 deletions autocrypt/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include "address/lib.h"
#include "lib.h"

struct Mailbox;

/* Prepared statements */
static sqlite3_stmt *AccountGetStmt;
static sqlite3_stmt *AccountInsertStmt;
Expand Down
4 changes: 2 additions & 2 deletions autocrypt/dlgautocrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
#include "address/lib.h"
#include "config/lib.h"
#include "gui/lib.h"
#include "mutt.h"
#include "lib.h"
#include "format_flags.h"
#include "keymap.h"
#include "mutt_globals.h"
#include "mutt_menu.h"
#include "muttlib.h"
#include "opcodes.h"

struct Mailbox;

/**
* struct AccountEntry - An entry in the Autocrypt account Menu
*/
Expand Down
1 change: 0 additions & 1 deletion autocrypt/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
#include <sqlite3.h>
#include <stdio.h>

struct ConfigSet;
struct Email;
struct Envelope;
struct Mailbox;
Expand Down
1 change: 0 additions & 1 deletion autocrypt/schema.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <sqlite3.h>
#include "private.h"
#include "mutt/lib.h"
#include "lib.h"

/**
* mutt_autocrypt_schema_init - Set up an Autocrypt database
Expand Down
1 change: 1 addition & 0 deletions bcache/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#define MUTT_BCACHE_LIB_H

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

struct ConnAccount;
struct BodyCache;
Expand Down
6 changes: 2 additions & 4 deletions browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <pwd.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "mutt/lib.h"
Expand All @@ -48,7 +47,6 @@
#include "mutt.h"
#include "browser.h"
#include "send/lib.h"
#include "context.h"
#include "format_flags.h"
#include "keymap.h"
#include "mutt_attach.h"
Expand All @@ -64,8 +62,8 @@
#endif
#ifdef USE_NNTP
#include "nntp/lib.h"
#include "nntp/adata.h"
#include "nntp/mdata.h"
#include "nntp/adata.h" // IWYU pragma: keep
#include "nntp/mdata.h" // IWYU pragma: keep
#endif

/* These Config Variables are only used in browser.c */
Expand Down
2 changes: 1 addition & 1 deletion browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include <stdint.h>
#include <sys/types.h>
#include <time.h>
#include "mutt/lib.h"

struct Buffer;
struct Mailbox;

/* These Config Variables are only used in browser.c */
Expand Down
5 changes: 1 addition & 4 deletions command_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "alias/lib.h"
#include "gui/lib.h"
#include "mutt.h"
#include "command_parse.h"
Expand All @@ -51,8 +50,6 @@
#include "monitor.h"
#include "mutt_commands.h"
#include "mutt_globals.h"
#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_parse.h"
#include "muttlib.h"
#include "mx.h"
Expand Down
1 change: 1 addition & 0 deletions commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "ncrypt/lib.h"
#include "pager/lib.h"
#include "send/lib.h"
#include "browser.h"
#include "context.h"
#include "copy.h"
#include "format_flags.h"
Expand Down
2 changes: 0 additions & 2 deletions compmbox/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
#include <stdio.h>
#include "core/lib.h"

struct Mailbox;

/**
* struct CompressInfo - Private data for compress
*
Expand Down
5 changes: 2 additions & 3 deletions compose/compose.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
Expand All @@ -55,7 +56,6 @@
#include "context.h"
#include "format_flags.h"
#include "hook.h"
#include "init.h"
#include "keymap.h"
#include "mutt_attach.h"
#include "mutt_globals.h"
Expand All @@ -69,7 +69,6 @@
#include "protos.h"
#include "recvattach.h"
#include "rfc3676.h"
#include "sort.h"
#ifdef ENABLE_NLS
#include <libintl.h>
#endif
Expand All @@ -78,7 +77,7 @@
#endif
#ifdef USE_NNTP
#include "nntp/lib.h"
#include "nntp/adata.h"
#include "nntp/adata.h" // IWYU pragma: keep
#endif
#ifdef USE_POP
#include "pop/lib.h"
Expand Down
1 change: 1 addition & 0 deletions compose/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Config used by libcompose
*/

#include <stddef.h>
#include <stdbool.h>
#include "config/lib.h"

Expand Down
1 change: 1 addition & 0 deletions compose/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <stdint.h>

struct Buffer;
struct ConfigSubset;
struct Email;

/* flags for mutt_compose_menu() */
Expand Down
1 change: 0 additions & 1 deletion compress/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "config.h"
#include <stdio.h>
#include <string.h>
#include "private.h"
#include "mutt/lib.h"
#include "lib.h"

Expand Down
1 change: 0 additions & 1 deletion compress/lz4.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "private.h"
#include "mutt/lib.h"
#include "lib.h"
#include "hcache/lib.h"

#define MIN_COMP_LEVEL 1 ///< Minimum compression level for lz4
#define MAX_COMP_LEVEL 12 ///< Maximum compression level for lz4
Expand Down
1 change: 0 additions & 1 deletion compress/zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "private.h"
#include "mutt/lib.h"
#include "lib.h"
#include "hcache/lib.h"

#define MIN_COMP_LEVEL 1 ///< Minimum compression level for zlib
#define MAX_COMP_LEVEL 9 ///< Maximum compression level for zlib
Expand Down
1 change: 0 additions & 1 deletion compress/zstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "private.h"
#include "mutt/lib.h"
#include "lib.h"
#include "hcache/lib.h"

#define MIN_COMP_LEVEL 1 ///< Minimum compression level for zstd
#define MAX_COMP_LEVEL 22 ///< Maximum compression level for zstd
Expand Down
1 change: 0 additions & 1 deletion config/address.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

#include "config.h"
#include <stddef.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include "mutt/lib.h"
Expand Down
1 change: 0 additions & 1 deletion config/address.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#define MUTT_CONFIG_ADDRESS_H

struct Address;
struct ConfigSet;

void address_free(struct Address **addr);
struct Address *address_new (const char *addr);
Expand Down
1 change: 0 additions & 1 deletion config/bool.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#define MUTT_CONFIG_BOOL_H

struct Buffer;
struct ConfigSet;
struct ConfigSubset;
struct HashElem;

Expand Down
2 changes: 0 additions & 2 deletions config/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#ifndef MUTT_CONFIG_ENUM_H
#define MUTT_CONFIG_ENUM_H

struct ConfigSet;

/**
* struct EnumDef - An enumeration
*/
Expand Down
1 change: 1 addition & 0 deletions config/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#ifndef MUTT_CONFIG_HELPERS_H
#define MUTT_CONFIG_HELPERS_H

#include <stdbool.h>
#include "quad.h"

struct ConfigSubset;
Expand Down
1 change: 1 addition & 0 deletions config/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#ifndef MUTT_CONFIG_LIB_H
#define MUTT_CONFIG_LIB_H

#include <stdbool.h>
// IWYU pragma: begin_exports
#include "address.h"
#include "bool.h"
Expand Down
1 change: 0 additions & 1 deletion config/long.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

#include "config.h"
#include <stddef.h>
#include <limits.h>
#include <stdint.h>
#include "mutt/lib.h"
#include "set.h"
Expand Down
1 change: 0 additions & 1 deletion config/mbtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
*/

#include "config.h"
#include <limits.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
Expand Down
Loading

0 comments on commit ff8f46a

Please sign in to comment.