diff --git a/src/bits_intern.h b/src/bits_intern.h index 15963cbf3b..c4ca683ccf 100644 --- a/src/bits_intern.h +++ b/src/bits_intern.h @@ -13,7 +13,7 @@ #include "system.h" -#include +#include // for memcpy #define ALL_BITS_UINT (~(UInt)0) diff --git a/src/debug.c b/src/debug.c index 31b0265f00..d0e981b4f3 100644 --- a/src/debug.c +++ b/src/debug.c @@ -30,12 +30,11 @@ #include "config.h" -#include -#include - #if defined(HAVE_BACKTRACE) && defined(GAP_PRINT_BACKTRACE) #include #include +#include // for fprintf, fileno +#include // for exit static void BacktraceHandler(int sig) NORETURN; diff --git a/src/error.c b/src/error.c index 2b9ff546d2..f0ecef874e 100644 --- a/src/error.c +++ b/src/error.c @@ -36,7 +36,7 @@ #include "hpc/thread.h" #endif -#include +#include // for fprintf static Obj ErrorInner; diff --git a/src/funcs.c b/src/funcs.c index e7ab735fb0..9937ad4699 100644 --- a/src/funcs.c +++ b/src/funcs.c @@ -37,10 +37,9 @@ #ifdef HPCGAP #include "hpc/guards.h" #include "hpc/thread.h" +#include // for alloca #endif -#include - static ModuleStateOffset FuncsStateOffset = -1; diff --git a/src/gvars.c b/src/gvars.c index c32dfa5bb9..40ba313bcd 100644 --- a/src/gvars.c +++ b/src/gvars.c @@ -46,11 +46,8 @@ #include "hpc/aobjects.h" #include "hpc/guards.h" #include "hpc/thread.h" -#include #endif -#include - #ifdef HPCGAP #define USE_GVAR_BUCKETS @@ -59,6 +56,8 @@ #ifdef USE_GVAR_BUCKETS +#include // for sprintf + #define GVAR_BUCKETS 1024 #define GVAR_BUCKET_SIZE 1024 diff --git a/src/hookintrprtr.c b/src/hookintrprtr.c index d8ca210cbf..459777545d 100644 --- a/src/hookintrprtr.c +++ b/src/hookintrprtr.c @@ -21,7 +21,7 @@ #include "hpc/thread.h" -#include +#include // for memcpy // List of active hooks diff --git a/src/hpc/aobjects.c b/src/hpc/aobjects.c index a8cd605387..abb467c9fa 100644 --- a/src/hpc/aobjects.c +++ b/src/hpc/aobjects.c @@ -32,7 +32,7 @@ #include "records.h" #include "stringobj.h" -#include +#include // for labs static Obj TYPE_ALIST; diff --git a/src/macfloat.c b/src/macfloat.c index 06f6e7f51d..10696e2477 100644 --- a/src/macfloat.c +++ b/src/macfloat.c @@ -35,8 +35,8 @@ #include "config.h" -#include -#include +#include // for snprintf +#include // for strtod #define RequireMacFloat(funcname, op) \ diff --git a/src/main.c b/src/main.c index d07bb2558a..ec2ee41d68 100644 --- a/src/main.c +++ b/src/main.c @@ -20,9 +20,9 @@ #include "config.h" -#include -#include -#include +#include // for getenv, realpath, ... +#include // for snprintf +#include // for access, readlink, ... #if defined(__APPLE__) && defined(__MACH__) // Workaround: TRUE / FALSE are also defined by the macOS Mach-O headers diff --git a/src/modules.c b/src/modules.c index 0f56c42618..c6bb9b1742 100644 --- a/src/modules.c +++ b/src/modules.c @@ -44,7 +44,7 @@ #include #endif -#include +#include // for fprintf, stderr /**************************************************************************** diff --git a/src/objects.c b/src/objects.c index 854f3c5230..062c865469 100644 --- a/src/objects.c +++ b/src/objects.c @@ -32,16 +32,14 @@ #include "hpc/guards.h" #include "hpc/thread.h" #include "hpc/traverse.h" +#include // for sprintf +#include // for getenv #endif #if defined(USE_THREADSAFE_COPYING) #include "hpc/traverse.h" #endif -#include -#include - - enum { MAXPRINTDEPTH = 64, }; diff --git a/src/opers.cc b/src/opers.cc index 911e8a02cc..e296f6b37f 100644 --- a/src/opers.cc +++ b/src/opers.cc @@ -46,8 +46,6 @@ extern "C" { #include #endif -#include - #include "config.h" } // extern "C" diff --git a/src/plist.h b/src/plist.h index 734fc62b78..52a9b2d87f 100644 --- a/src/plist.h +++ b/src/plist.h @@ -28,7 +28,7 @@ #include "objects.h" -#include +#include // for memcpy /**************************************************************************** ** diff --git a/src/precord.c b/src/precord.c index 90c413b3b7..d78601e7fa 100644 --- a/src/precord.c +++ b/src/precord.c @@ -47,7 +47,7 @@ #include "hpc/traverse.h" #endif -#include +#include // for qsort /**************************************************************************** ** diff --git a/src/profile.c b/src/profile.c index e4283cc2aa..daf61a4da4 100644 --- a/src/profile.c +++ b/src/profile.c @@ -34,10 +34,10 @@ #include "config.h" -#include +#include // for fprintf, fflush, popen, pclose, fopen, fclose #include // for gettimeofday -#include -#include +#include // for pid_t +#include // for getpid #ifdef HAVE_SYS_RESOURCE_H #include // definition of 'struct rusage' #endif diff --git a/src/stringobj.h b/src/stringobj.h index d456f8799c..9b28f61107 100644 --- a/src/stringobj.h +++ b/src/stringobj.h @@ -24,7 +24,7 @@ #include "objects.h" -#include +#include // for memcpy /**************************************************************************** diff --git a/src/symbols.c b/src/symbols.c index 8c20bd6f59..b4bd76be03 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -20,8 +20,6 @@ #include "hpc/thread.h" #endif -#include - void InitSymbolTableKernel(SymbolTable * symtab, const char * cookieCount, diff --git a/src/symbols.h b/src/symbols.h index 4f738d95a7..21ba53de4f 100644 --- a/src/symbols.h +++ b/src/symbols.h @@ -14,7 +14,7 @@ #include "common.h" #ifdef HPCGAP -#include +#include // for pthread_rwlock_t #endif // some auxiliary typedefs for SymbolTable diff --git a/src/sysfiles.c b/src/sysfiles.c index 2d4794acbf..1428e193be 100644 --- a/src/sysfiles.c +++ b/src/sysfiles.c @@ -31,7 +31,6 @@ #include "records.h" #include "stats.h" #include "stringobj.h" -#include "sysenv.h" #include "sysopt.h" #include "sysstr.h" #include "system.h" diff --git a/src/sysmem.c b/src/sysmem.c index b4342bd0b4..3f5cf0d68b 100644 --- a/src/sysmem.c +++ b/src/sysmem.c @@ -23,12 +23,11 @@ #ifdef GAP_MEM_CHECK #include +#include // for qsort +#include // for ftruncate, getpid, unlink #endif -#include -#include -#include -#include +#include // for fputs #ifdef HAVE_MADVISE #include @@ -36,6 +35,9 @@ #ifdef HAVE_VM_ALLOCATE #include +#elif defined(HAVE_SBRK) +#include // for memset +#include // for sbrk #endif diff --git a/src/trans.cc b/src/trans.cc index 8123923468..d8bd03a1a9 100644 --- a/src/trans.cc +++ b/src/trans.cc @@ -64,7 +64,7 @@ extern "C" { #include "plist.h" #include "saveload.h" -#include +#include // for snprintf } // extern "C" diff --git a/src/trycatch.c b/src/trycatch.c index f0569afccc..12a68deb2e 100644 --- a/src/trycatch.c +++ b/src/trycatch.c @@ -13,8 +13,6 @@ #include "gaputils.h" -#include - static ThrowObserver throwObservers[16]; int RegisterThrowObserver(ThrowObserver func) diff --git a/src/vars.c b/src/vars.c index f6df0687b8..2154fd245a 100644 --- a/src/vars.c +++ b/src/vars.c @@ -43,7 +43,7 @@ #include "hpc/guards.h" #endif -#include +#include // for snprintf /****************************************************************************