libsepol: include header files in source files when matching declarations

It is good practise in C to include the header file that specifies the
prototype of functions which are defined in the source file. Otherwise,
the function prototypes which be different, which could cause unexpected
issues.

Add the include directives to do this.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2021-01-31 21:57:13 +01:00
parent 1f1fa9d47e
commit 1b36ace21b
No known key found for this signature in database
GPG key ID: C191415F340DAAA0
9 changed files with 9 additions and 0 deletions

View file

@ -30,6 +30,7 @@
#include <sepol/policydb/ebitmap.h>
#include "cil_internal.h"
#include "cil_find.h"
#include "cil_flavor.h"
#include "cil_list.h"
#include "cil_log.h"

View file

@ -31,6 +31,7 @@
#include <stdio.h>
#include <string.h>
#include "cil_fqn.h"
#include "cil_internal.h"
#include "cil_log.h"
#include "cil_strpool.h"

View file

@ -33,6 +33,7 @@
#include <string.h>
#include "cil_log.h"
#include "cil_mem.h"
void *cil_malloc(size_t size)
{

View file

@ -38,6 +38,7 @@
#include "cil_mem.h"
#include "cil_tree.h"
#include "cil_lexer.h"
#include "cil_parser.h"
#include "cil_strpool.h"
#include "cil_stack.h"

View file

@ -41,6 +41,7 @@
#include "cil_flavor.h"
#include "cil_find.h"
#include "cil_mem.h"
#include "cil_policy.h"
#include "cil_tree.h"
#include "cil_list.h"
#include "cil_symtab.h"

View file

@ -2,6 +2,7 @@
#include "cil_internal.h"
#include "cil_log.h"
#include "cil_list.h"
#include "cil_reset_ast.h"
#include "cil_symtab.h"
static inline void cil_reset_classperms_list(struct cil_list *cp_list);

View file

@ -16,6 +16,7 @@
#define IPPROTO_SCTP 132
#endif
#include <sepol/kernel_to_cil.h>
#include <sepol/policydb/avtab.h>
#include <sepol/policydb/conditional.h>
#include <sepol/policydb/hashtab.h>

View file

@ -15,6 +15,7 @@
#define IPPROTO_SCTP 132
#endif
#include <sepol/kernel_to_conf.h>
#include <sepol/policydb/avtab.h>
#include <sepol/policydb/conditional.h>
#include <sepol/policydb/hashtab.h>

View file

@ -59,6 +59,7 @@
#include <sepol/policydb/services.h>
#include <sepol/policydb/conditional.h>
#include <sepol/policydb/util.h>
#include <sepol/sepol.h>
#include "debug.h"
#include "private.h"