diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2022-07-23 09:49:41 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2022-07-24 20:32:49 -0700 |
commit | 02cdfa5b754f00c860b56bf0571caec5a094492c (patch) | |
tree | 5f051f3575746b97b2c0ff3ea7039d78e63365c3 | |
parent | da30e55dfd514dbe14ece3bcf3eaec794ca8d892 (diff) | |
download | gjs-02cdfa5b754f00c860b56bf0571caec5a094492c.tar.gz |
maint: Fix IWYU includes in files that previously failed
Due to the bug fixed by the previous commit, many files' includes had
gotten out of sync. This fixes all of the IWYU complaints.
We need to add some lines to the mapping file, either due to an IWYU
upgrade or changes in the header files; I'm not sure. It's annoying that
we have to list all the glib/*.h files separately, but that is for two
reasons: there is no glob for glib/* that can leave out <glib/gstdio.h>
and other public GLib headers; and glib/galloca.h should redirect to the
system alloca.h.
-rw-r--r-- | gi/arg-cache.cpp | 2 | ||||
-rw-r--r-- | gi/arg.cpp | 1 | ||||
-rw-r--r-- | gi/boxed.cpp | 3 | ||||
-rw-r--r-- | gi/enumeration.cpp | 1 | ||||
-rw-r--r-- | gi/function.cpp | 1 | ||||
-rw-r--r-- | gi/fundamental.cpp | 1 | ||||
-rw-r--r-- | gi/gerror.cpp | 1 | ||||
-rw-r--r-- | gi/gtype.cpp | 1 | ||||
-rw-r--r-- | gi/interface.cpp | 1 | ||||
-rw-r--r-- | gi/object.cpp | 2 | ||||
-rw-r--r-- | gi/param.cpp | 1 | ||||
-rw-r--r-- | gi/private.cpp | 1 | ||||
-rw-r--r-- | gi/repo.cpp | 1 | ||||
-rw-r--r-- | gi/union.cpp | 1 | ||||
-rw-r--r-- | gi/value.cpp | 1 | ||||
-rw-r--r-- | gjs/byteArray.cpp | 1 | ||||
-rw-r--r-- | gjs/global.cpp | 1 | ||||
-rw-r--r-- | gjs/importer.cpp | 1 | ||||
-rw-r--r-- | gjs/jsapi-util.cpp | 1 | ||||
-rw-r--r-- | gjs/module.cpp | 1 | ||||
-rw-r--r-- | gjs/objectbox.cpp | 2 | ||||
-rw-r--r-- | modules/console.cpp | 1 | ||||
-rw-r--r-- | modules/print.cpp | 1 | ||||
-rw-r--r-- | modules/system.cpp | 1 | ||||
-rw-r--r-- | tools/gjs-private-iwyu.imp | 38 | ||||
-rwxr-xr-x | tools/process_iwyu.py | 10 | ||||
-rw-r--r-- | util/log.cpp | 1 |
27 files changed, 77 insertions, 1 deletions
diff --git a/gi/arg-cache.cpp b/gi/arg-cache.cpp index 707f2978..7c269468 100644 --- a/gi/arg-cache.cpp +++ b/gi/arg-cache.cpp @@ -48,7 +48,9 @@ #include "gi/value.h" #include "gi/wrapperutils.h" // for GjsTypecheckNoThrow #include "gjs/byteArray.h" +#include "gjs/enum-utils.h" // for operator&, operator|=, operator| #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "util/log.h" enum ExpectedType { @@ -51,6 +51,7 @@ #include "gjs/byteArray.h" #include "gjs/context-private.h" #include "gjs/enum-utils.h" +#include "gjs/macros.h" #include "gjs/jsapi-util.h" #include "util/log.h" #include "util/misc.h" diff --git a/gi/boxed.cpp b/gi/boxed.cpp index bc005a54..ea146a91 100644 --- a/gi/boxed.cpp +++ b/gi/boxed.cpp @@ -28,7 +28,6 @@ #include <jsapi.h> // for IdVector #include <mozilla/HashTable.h> -#include "gi/arg-cache.h" #include "gi/arg-inl.h" #include "gi/arg.h" #include "gi/boxed.h" @@ -39,6 +38,8 @@ #include "gjs/atoms.h" #include "gjs/context-private.h" #include "gjs/jsapi-class.h" +#include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/mem-private.h" #include "util/log.h" diff --git a/gi/enumeration.cpp b/gi/enumeration.cpp index 117bfc3e..62090ce4 100644 --- a/gi/enumeration.cpp +++ b/gi/enumeration.cpp @@ -16,6 +16,7 @@ #include "gi/enumeration.h" #include "gi/wrapperutils.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "util/log.h" GJS_JSAPI_RETURN_CONVENTION diff --git a/gi/function.cpp b/gi/function.cpp index ef885729..abb8b2c8 100644 --- a/gi/function.cpp +++ b/gi/function.cpp @@ -48,6 +48,7 @@ #include "gjs/context.h" #include "gjs/global.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/mem-private.h" #include "gjs/profiler-private.h" #include "util/log.h" diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp index 956b7303..dcaf3914 100644 --- a/gi/fundamental.cpp +++ b/gi/fundamental.cpp @@ -28,6 +28,7 @@ #include "gjs/atoms.h" #include "gjs/context-private.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/mem-private.h" #include "util/log.h" diff --git a/gi/gerror.cpp b/gi/gerror.cpp index 06ea2635..5aba318f 100644 --- a/gi/gerror.cpp +++ b/gi/gerror.cpp @@ -33,6 +33,7 @@ #include "gjs/context-private.h" #include "gjs/error-types.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/mem-private.h" #include "util/log.h" diff --git a/gi/gtype.cpp b/gi/gtype.cpp index d6589250..7e4c39f7 100644 --- a/gi/gtype.cpp +++ b/gi/gtype.cpp @@ -26,6 +26,7 @@ #include "gjs/context-private.h" #include "gjs/global.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "util/log.h" /* diff --git a/gi/interface.cpp b/gi/interface.cpp index dc6c018d..9d0f14f7 100644 --- a/gi/interface.cpp +++ b/gi/interface.cpp @@ -19,6 +19,7 @@ #include "gi/repo.h" #include "gjs/atoms.h" #include "gjs/context-private.h" +#include "gjs/jsapi-util.h" #include "gjs/mem-private.h" InterfacePrototype::InterfacePrototype(GIInterfaceInfo* info, GType gtype) diff --git a/gi/object.cpp b/gi/object.cpp index 6c85631c..aa961d60 100644 --- a/gi/object.cpp +++ b/gi/object.cpp @@ -61,8 +61,10 @@ #include "gjs/context.h" #include "gjs/deprecation.h" #include "gjs/jsapi-class.h" +#include "gjs/jsapi-util.h" #include "gjs/jsapi-util-args.h" #include "gjs/jsapi-util-root.h" +#include "gjs/macros.h" #include "gjs/mem-private.h" #include "gjs/profiler-private.h" #include "util/log.h" diff --git a/gi/param.cpp b/gi/param.cpp index 7a3f8817..7ad31334 100644 --- a/gi/param.cpp +++ b/gi/param.cpp @@ -25,6 +25,7 @@ #include "gjs/context-private.h" #include "gjs/jsapi-class.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/mem-private.h" #include "util/log.h" diff --git a/gi/private.cpp b/gi/private.cpp index a2aecfb9..85001cb6 100644 --- a/gi/private.cpp +++ b/gi/private.cpp @@ -30,6 +30,7 @@ #include "gjs/context-private.h" #include "gjs/jsapi-util-args.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" /* gi/private.cpp - private "imports._gi" module with operations that we need * to use from JS in order to create GObject classes, but should not be exposed diff --git a/gi/repo.cpp b/gi/repo.cpp index 9f5d4e1f..55c443e4 100644 --- a/gi/repo.cpp +++ b/gi/repo.cpp @@ -46,6 +46,7 @@ #include "gjs/context-private.h" #include "gjs/global.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/module.h" #include "util/log.h" diff --git a/gi/union.cpp b/gi/union.cpp index dca23592..0b310ed1 100644 --- a/gi/union.cpp +++ b/gi/union.cpp @@ -19,6 +19,7 @@ #include "gi/repo.h" #include "gi/union.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/mem-private.h" #include "util/log.h" diff --git a/gi/value.cpp b/gi/value.cpp index f53ff75e..bd2def88 100644 --- a/gi/value.cpp +++ b/gi/value.cpp @@ -46,6 +46,7 @@ #include "gjs/context-private.h" #include "gjs/context.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/objectbox.h" #include "util/log.h" diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp index 9853ba6d..9380c3d3 100644 --- a/gjs/byteArray.cpp +++ b/gjs/byteArray.cpp @@ -26,6 +26,7 @@ #include "gjs/deprecation.h" #include "gjs/jsapi-util-args.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/text-encoding.h" #include "util/misc.h" // for _gjs_memdup2 diff --git a/gjs/global.cpp b/gjs/global.cpp index 56fe8602..dae759cf 100644 --- a/gjs/global.cpp +++ b/gjs/global.cpp @@ -35,6 +35,7 @@ #include "gjs/global.h" #include "gjs/internal.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/native.h" namespace mozilla { diff --git a/gjs/importer.cpp b/gjs/importer.cpp index c8bc553e..04a4a108 100644 --- a/gjs/importer.cpp +++ b/gjs/importer.cpp @@ -44,6 +44,7 @@ #include "gjs/global.h" #include "gjs/importer.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/module.h" #include "gjs/native.h" #include "util/log.h" diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp index 4ac9782b..4dc44270 100644 --- a/gjs/jsapi-util.cpp +++ b/gjs/jsapi-util.cpp @@ -41,6 +41,7 @@ #include "gjs/atoms.h" #include "gjs/context-private.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" namespace js { class SystemAllocPolicy; diff --git a/gjs/module.cpp b/gjs/module.cpp index 3b54a3fc..bcff321a 100644 --- a/gjs/module.cpp +++ b/gjs/module.cpp @@ -43,6 +43,7 @@ #include "gjs/global.h" #include "gjs/jsapi-util-args.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/mem-private.h" #include "gjs/module.h" #include "gjs/native.h" diff --git a/gjs/objectbox.cpp b/gjs/objectbox.cpp index 99b2c665..8a3288f9 100644 --- a/gjs/objectbox.cpp +++ b/gjs/objectbox.cpp @@ -10,6 +10,7 @@ #include <js/AllocPolicy.h> #include <js/ComparisonOperators.h> +#include <js/ErrorReport.h> // for JS_ReportOutOfMemory #include <js/GCPolicyAPI.h> // for GCPolicy (ptr only), NonGCPointe... #include <js/GCVector.h> #include <js/RootingAPI.h> @@ -17,6 +18,7 @@ #include <js/TypeDecls.h> #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/objectbox.h" #include "util/log.h" diff --git a/modules/console.cpp b/modules/console.cpp index f92d63d0..33c189f9 100644 --- a/modules/console.cpp +++ b/modules/console.cpp @@ -46,6 +46,7 @@ #include "gjs/context-private.h" #include "gjs/global.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "modules/console.h" namespace mozilla { diff --git a/modules/print.cpp b/modules/print.cpp index 6454a526..e483446c 100644 --- a/modules/print.cpp +++ b/modules/print.cpp @@ -22,6 +22,7 @@ #include "gjs/global.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "modules/print.h" GJS_JSAPI_RETURN_CONVENTION diff --git a/modules/system.cpp b/modules/system.cpp index 9152cfe3..0f441096 100644 --- a/modules/system.cpp +++ b/modules/system.cpp @@ -32,6 +32,7 @@ #include "gjs/context-private.h" #include "gjs/jsapi-util-args.h" #include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/profiler-private.h" #include "modules/system.h" #include "util/log.h" diff --git a/tools/gjs-private-iwyu.imp b/tools/gjs-private-iwyu.imp index 502e6b43..a5695102 100644 --- a/tools/gjs-private-iwyu.imp +++ b/tools/gjs-private-iwyu.imp @@ -4,6 +4,10 @@ # IWYU mapping file for files that are part of libgjs [ {"include": ["<bits/this_thread_sleep.h>", "private", "<thread>", "public"]}, + {"include": ["<bits/sigevent-consts.h>", "private", "<signal.h>", "public"]}, + {"include": ["<bits/siginfo-consts.h>", "private", "<signal.h>", "public"]}, + {"include": ["<bits/signum-arch.h>", "private", "<signal.h>", "public"]}, + {"include": ["<bits/signum-generic.h>", "private", "<signal.h>", "public"]}, {"include": ["<bits/types/sigevent_t.h>", "private", "<signal.h>", "public"]}, {"include": ["<bits/types/siginfo_t.h>", "private", "<signal.h>", "public"]}, {"include": ["<bits/types/struct_itimerspec.h>", "private", "<time.h>", "public"]}, @@ -12,7 +16,41 @@ {"include": ["@<ffi.*>", "private", "<ffi.h>", "public"]}, {"include": ["@\"gio/.*\"", "private", "<gio/gio.h>", "public"]}, {"include": ["@<gio/.*>", "private", "<gio/gio.h>", "public"]}, + {"include": ["\"gitypes.h\"", "private", "<girepository.h>", "public"]}, + {"include": ["<gitypes.h>", "private", "<girepository.h>", "public"]}, + {"include": ["\"giversion.h\"", "private", "<girepository.h>", "public"]}, + {"include": ["@\"gi.*info.h\"", "private", "<girepository.h>", "public"]}, + {"include": ["\"glib/galloca.h\"", "private", "<alloca.h>", "public"]}, + {"include": ["\"glib/garray.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gbacktrace.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gbytes.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gconvert.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/genviron.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gerror.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gfileutils.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/ghash.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/glist.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gmacros.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gmain.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gmem.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gmessages.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gquark.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/grcbox.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/grefcount.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gslist.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gstrfuncs.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gstring.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gtestutils.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gthread.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gtimer.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gtypes.h\"", "private", "<glib.h>", "public"]}, {"include": ["<glib/gtypes.h>", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gunicode.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/guri.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gutils.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gvariant.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glib/gversion.h\"", "private", "<glib.h>", "public"]}, + {"include": ["\"glibconfig.h\"", "private", "<glib.h>", "public"]}, {"include": ["@\"gobject/.*\"", "private", "<glib-object.h>", "public"]}, {"include": ["@<gobject/.*>", "private", "<glib-object.h>", "public"]}, {"include": ["<libintl.h>", "private", "<glib/gi18n.h>", "public"]}, diff --git a/tools/process_iwyu.py b/tools/process_iwyu.py index 56bd230f..4d5288ec 100755 --- a/tools/process_iwyu.py +++ b/tools/process_iwyu.py @@ -115,6 +115,16 @@ FALSE_POSITIVES = ( # Weird false positive on some versions of IWYU ('gi/arg.cpp', 'struct _GVariant;', ''), + ('util/log.cpp', '#include <algorithm>', 'for copy'), + + # For some reason IWYU wants these with angle brackets when they are + # already present with quotes + # https://github.com/include-what-you-use/include-what-you-use/issues/1087 + ('gjs/context.cpp', '#include <gjs/context.h>', ''), + ('gjs/coverage.cpp', '#include <gjs/coverage.h>', ''), + ('gjs/error-types.cpp', '#include <gjs/error-types.h>', ''), + ('gjs/jsapi-util.cpp', '#include <gjs/jsapi-util.h>', ''), + ('gjs/mem.cpp', '#include <gjs/mem.h>', ''), ('gjs/profiler.cpp', '#include <gjs/profiler.h>', ''), ) diff --git a/util/log.cpp b/util/log.cpp index 3f5b52d4..410b6a2c 100644 --- a/util/log.cpp +++ b/util/log.cpp @@ -8,6 +8,7 @@ #include <type_traits> // for remove_reference<>::type #include <errno.h> +#include <fcntl.h> // for SEEK_END #include <stdarg.h> #include <stdio.h> // for FILE, fprintf, fflush, fopen, fputs, fseek #include <string.h> // for strchr, strcmp |