diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2019-05-31 23:40:53 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2019-06-08 23:11:29 -0700 |
commit | 01920362be26a2cb4e38b55cc211351391885d1d (patch) | |
tree | e82cc9c7af565610eb756ea5a561dbd83359d9a0 /gi | |
parent | e9d108c4a67a45bc2caf5429736f164956f6c9dc (diff) | |
download | gjs-01920362be26a2cb4e38b55cc211351391885d1d.tar.gz |
maint: Fix header includes once and for all
Previously #include statements were a bit of a mess across the codebase.
This commit is the result of a pass by the IWYU (Include What You Use)
tool, which suggests headers to add or remove based on what is in the
file, and can also suggest forward-declaring classes instead of
including their headers, if they are only used as a pointer in a
particular file. Cleaning this up should in general speed up compile
times.
IWYU isn't perfect, it produces a number of false positives, so we don't
try to automate this process and we don't accept all of its
recommendations. We do add a script and configuration file to the tools/
directory so that IWYU can be every so often in the future.
We also clean up all the includes according to a consistent style, which
is now described clearly in the C++ style guide.
Diffstat (limited to 'gi')
41 files changed, 314 insertions, 259 deletions
@@ -21,25 +21,35 @@ * IN THE SOFTWARE. */ -#include <config.h> - -#include <cmath> -#include <cstdlib> - -#include "arg.h" -#include "gtype.h" -#include "object.h" -#include "interface.h" -#include "foreign.h" -#include "fundamental.h" -#include "boxed.h" -#include "union.h" -#include "param.h" -#include "value.h" -#include "gerror.h" -#include "gjs/byteArray.h" +#include <string.h> // for strcmp, strlen, memcpy + +#include <cmath> // for std::abs +#include <limits> // for numeric_limits +#include <string> + +#include <girepository.h> +#include <glib-object.h> +#include <glib.h> + #include "gjs/jsapi-wrapper.h" -#include <util/log.h> + +#include "gi/arg.h" +#include "gi/boxed.h" +#include "gi/foreign.h" +#include "gi/fundamental.h" +#include "gi/gerror.h" +#include "gi/gtype.h" +#include "gi/interface.h" +#include "gi/object.h" +#include "gi/param.h" +#include "gi/union.h" +#include "gi/value.h" +#include "gi/wrapperutils.h" +#include "gjs/atoms.h" +#include "gjs/byteArray.h" +#include "gjs/context-private.h" +#include "gjs/jsapi-util.h" +#include "util/log.h" bool _gjs_flags_value_is_valid(JSContext* context, GType gtype, int64_t value) { GFlagsValue *v; @@ -24,13 +24,15 @@ #ifndef GI_ARG_H_ #define GI_ARG_H_ -#include <stdbool.h> -#include <glib.h> - -#include "gjs/jsapi-util.h" -#include "gjs/macros.h" +#include <stddef.h> // for size_t +#include <stdint.h> #include <girepository.h> +#include <glib-object.h> + +#include "gjs/jsapi-wrapper.h" + +#include "gjs/macros.h" // Different roles for a GIArgument; currently used only in exception and debug // messages. diff --git a/gi/boxed.cpp b/gi/boxed.cpp index f6db484a..9e196abd 100644 --- a/gi/boxed.cpp +++ b/gi/boxed.cpp @@ -21,29 +21,30 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <stdint.h> +#include <string.h> // for memcpy, size_t, strcmp -#include <string.h> +#include <string> // for string +#include <type_traits> // for remove_reference +#include <utility> // for move, forward -#include <utility> +#include <girepository.h> +#include <glib-object.h> #include "gjs/jsapi-wrapper.h" -#include "js/GCHashTable.h" +#include "js/GCHashTable.h" // for GCHashMap -#include "arg.h" -#include "boxed.h" -#include "function.h" +#include "gi/arg.h" +#include "gi/boxed.h" +#include "gi/function.h" #include "gi/gerror.h" +#include "gi/repo.h" #include "gi/wrapperutils.h" +#include "gjs/atoms.h" +#include "gjs/context-private.h" #include "gjs/jsapi-class.h" #include "gjs/mem-private.h" -#include "gtype.h" -#include "object.h" -#include "repo.h" - -#include <util/log.h> - -#include <girepository.h> +#include "util/log.h" BoxedInstance::BoxedInstance(JSContext* cx, JS::HandleObject obj) : GIWrapperInstance(cx, obj), m_owning_ptr(false) { @@ -24,17 +24,20 @@ #ifndef GI_BOXED_H_ #define GI_BOXED_H_ +#include <stdint.h> + #include <girepository.h> +#include <glib-object.h> #include <glib.h> +#include "gjs/jsapi-wrapper.h" +#include "js/GCHashTable.h" // for GCHashMap + #include "gi/wrapperutils.h" #include "gjs/jsapi-util.h" -#include "gjs/jsapi-wrapper.h" #include "gjs/macros.h" #include "util/log.h" -#include "js/GCHashTable.h" - class BoxedPrototype; class BoxedInstance; diff --git a/gi/closure.cpp b/gi/closure.cpp index a952a14f..860ca678 100644 --- a/gi/closure.cpp +++ b/gi/closure.cpp @@ -21,16 +21,18 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <glib.h> -#include <string.h> -#include <limits.h> -#include <util/log.h> +#include <new> -#include "closure.h" -#include "gjs/jsapi-util-root.h" #include "gjs/jsapi-wrapper.h" + +#include "gi/closure.h" +#include "gjs/context-private.h" +#include "gjs/jsapi-util-root.h" +#include "gjs/jsapi-util.h" #include "gjs/mem-private.h" +#include "util/log.h" struct Closure { JSContext *context; diff --git a/gi/closure.h b/gi/closure.h index ef85c05f..fb8a1455 100644 --- a/gi/closure.h +++ b/gi/closure.h @@ -24,10 +24,10 @@ #ifndef GI_CLOSURE_H_ #define GI_CLOSURE_H_ -#include <stdbool.h> #include <glib-object.h> -#include "gjs/jsapi-util.h" +#include "gjs/jsapi-wrapper.h" + #include "gjs/macros.h" GJS_USE diff --git a/gi/enumeration.cpp b/gi/enumeration.cpp index 78c77c0c..de2a3be4 100644 --- a/gi/enumeration.cpp +++ b/gi/enumeration.cpp @@ -21,22 +21,16 @@ * IN THE SOFTWARE. */ -#include <config.h> - -#include <string.h> +#include <girepository.h> +#include <glib-object.h> +#include <glib.h> -#include "function.h" -#include "gi/wrapperutils.h" -#include "gjs/context-private.h" #include "gjs/jsapi-wrapper.h" -#include "gtype.h" -#include "repo.h" - -#include <util/log.h> -#include <girepository.h> - -#include "enumeration.h" +#include "gi/enumeration.h" +#include "gi/wrapperutils.h" +#include "gjs/jsapi-util.h" +#include "util/log.h" GJS_JSAPI_RETURN_CONVENTION static bool diff --git a/gi/enumeration.h b/gi/enumeration.h index ac78a974..0115c3eb 100644 --- a/gi/enumeration.h +++ b/gi/enumeration.h @@ -24,13 +24,11 @@ #ifndef GI_ENUMERATION_H_ #define GI_ENUMERATION_H_ -#include <stdbool.h> -#include <glib.h> +#include <girepository.h> -#include "gjs/jsapi-util.h" -#include "gjs/macros.h" +#include "gjs/jsapi-wrapper.h" -#include <girepository.h> +#include "gjs/macros.h" GJS_JSAPI_RETURN_CONVENTION bool gjs_define_enum_values(JSContext *context, diff --git a/gi/foreign.cpp b/gi/foreign.cpp index 3082c6c0..cb8da5d8 100644 --- a/gi/foreign.cpp +++ b/gi/foreign.cpp @@ -21,16 +21,18 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <string.h> // for strcmp -#include <string.h> #include <girepository.h> +#include <glib.h> -#include "arg.h" -#include "foreign.h" -#include "gjs/context-private.h" #include "gjs/jsapi-wrapper.h" +#include "gi/arg.h" +#include "gi/foreign.h" +#include "gjs/context-private.h" +#include "gjs/jsapi-util.h" + static struct { char *gi_namespace; char *module; // relative to "imports." diff --git a/gi/foreign.h b/gi/foreign.h index b2644f20..fbf6111a 100644 --- a/gi/foreign.h +++ b/gi/foreign.h @@ -24,10 +24,11 @@ #ifndef GI_FOREIGN_H_ #define GI_FOREIGN_H_ -#include <stdbool.h> #include <girepository.h> -#include "arg.h" +#include "gjs/jsapi-wrapper.h" + +#include "gi/arg.h" #include "gjs/macros.h" typedef bool (*GjsArgOverrideToGArgumentFunc) (JSContext *context, diff --git a/gi/function.cpp b/gi/function.cpp index 269deac3..ce04027f 100644 --- a/gi/function.cpp +++ b/gi/function.cpp @@ -21,7 +21,20 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <stdint.h> +#include <stdlib.h> // for exit +#include <string.h> // for strcmp, memset, size_t + +#include <new> + +#include <ffi.h> +#include <girepository.h> +#include <girffi.h> +#include <glib-object.h> +#include <glib.h> + +#include "gjs/jsapi-wrapper.h" +#include "mozilla/Maybe.h" #include "gi/arg.h" #include "gi/boxed.h" @@ -34,16 +47,11 @@ #include "gi/param.h" #include "gi/union.h" #include "gjs/context-private.h" +#include "gjs/context.h" #include "gjs/jsapi-class.h" -#include "gjs/jsapi-wrapper.h" +#include "gjs/jsapi-util.h" #include "gjs/mem-private.h" - -#include <util/log.h> - -#include <girepository.h> - -#include <errno.h> -#include <string.h> +#include "util/log.h" /* We use guint8 for arguments; functions can't * have more than this. diff --git a/gi/function.h b/gi/function.h index d9bc3d69..f9b14254 100644 --- a/gi/function.h +++ b/gi/function.h @@ -24,14 +24,13 @@ #ifndef GI_FUNCTION_H_ #define GI_FUNCTION_H_ -#include <stdbool.h> -#include <glib.h> +#include <ffi.h> +#include <girepository.h> +#include <glib-object.h> -#include "gjs/jsapi-util.h" -#include "gjs/macros.h" +#include "gjs/jsapi-wrapper.h" -#include <girepository.h> -#include <girffi.h> +#include "gjs/macros.h" typedef enum { PARAM_NORMAL, diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp index 35791309..da8f5a08 100644 --- a/gi/fundamental.cpp +++ b/gi/fundamental.cpp @@ -22,25 +22,22 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <girepository.h> +#include <glib.h> -#include "fundamental.h" +#include "gjs/jsapi-wrapper.h" +#include "js/GCHashTable.h" // for WeakCache -#include "arg.h" -#include "boxed.h" -#include "function.h" -#include "gi/gtype.h" -#include "gi/object.h" +#include "gi/arg.h" +#include "gi/function.h" +#include "gi/fundamental.h" #include "gi/repo.h" #include "gi/wrapperutils.h" +#include "gjs/atoms.h" #include "gjs/context-private.h" -#include "gjs/jsapi-class.h" -#include "gjs/jsapi-wrapper.h" +#include "gjs/jsapi-util.h" #include "gjs/mem-private.h" - -#include <gjs/context.h> -#include <util/log.h> -#include <girepository.h> +#include "util/log.h" FundamentalInstance::FundamentalInstance(JSContext* cx, JS::HandleObject obj) : GIWrapperInstance(cx, obj) { diff --git a/gi/fundamental.h b/gi/fundamental.h index aea7e35a..9756aaf2 100644 --- a/gi/fundamental.h +++ b/gi/fundamental.h @@ -25,13 +25,14 @@ #ifndef GI_FUNDAMENTAL_H_ #define GI_FUNDAMENTAL_H_ -#include <stdbool.h> -#include <glib.h> #include <girepository.h> +#include <glib-object.h> + +#include "gjs/jsapi-wrapper.h" #include "gi/wrapperutils.h" -#include "gjs/jsapi-util.h" #include "gjs/macros.h" +#include "util/log.h" class FundamentalPrototype; class FundamentalInstance; diff --git a/gi/gerror.cpp b/gi/gerror.cpp index 7f2b8bfa..a1b1a546 100644 --- a/gi/gerror.cpp +++ b/gi/gerror.cpp @@ -21,23 +21,23 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <stdint.h> -#include <string.h> +#include <girepository.h> +#include <glib-object.h> + +#include "gjs/jsapi-wrapper.h" -#include "boxed.h" -#include "enumeration.h" -#include "gerror.h" +#include "gi/boxed.h" +#include "gi/enumeration.h" +#include "gi/gerror.h" +#include "gi/repo.h" +#include "gjs/atoms.h" #include "gjs/context-private.h" #include "gjs/error-types.h" -#include "gjs/jsapi-class.h" -#include "gjs/jsapi-wrapper.h" +#include "gjs/jsapi-util.h" #include "gjs/mem-private.h" -#include "repo.h" - -#include <util/log.h> - -#include <girepository.h> +#include "util/log.h" ErrorPrototype::ErrorPrototype(GIEnumInfo* info, GType gtype) : GIWrapperPrototype(info, gtype), diff --git a/gi/gerror.h b/gi/gerror.h index 5cd08b5b..730f864a 100644 --- a/gi/gerror.h +++ b/gi/gerror.h @@ -24,13 +24,15 @@ #ifndef GI_GERROR_H_ #define GI_GERROR_H_ -#include <stdbool.h> -#include <glib.h> #include <girepository.h> +#include <glib-object.h> +#include <glib.h> + +#include "gjs/jsapi-wrapper.h" #include "gi/wrapperutils.h" -#include "gjs/jsapi-util.h" #include "gjs/macros.h" +#include "util/log.h" class ErrorPrototype; class ErrorInstance; diff --git a/gi/gjs_gi_trace.h b/gi/gjs_gi_trace.h index ff9758cb..77e6c6fe 100644 --- a/gi/gjs_gi_trace.h +++ b/gi/gjs_gi_trace.h @@ -26,9 +26,7 @@ #ifndef GI_GJS_GI_TRACE_H_ #define GI_GJS_GI_TRACE_H_ -#ifndef GJS_VERSION -# error "config.h must be included prior to gjs_trace.h" -#endif +#include <config.h> // IWYU pragma: keep #ifdef HAVE_DTRACE diff --git a/gi/gobject.cpp b/gi/gobject.cpp index 00a4ae61..cc17086b 100644 --- a/gi/gobject.cpp +++ b/gi/gobject.cpp @@ -21,16 +21,21 @@ * IN THE SOFTWARE. */ +#include <unordered_map> +#include <utility> // for move, pair + #include <glib-object.h> +#include <glib.h> -#include <unordered_map> +#include "gjs/jsapi-wrapper.h" +#include "gi/gobject.h" +#include "gi/object.h" +#include "gi/value.h" +#include "gjs/context-private.h" #include "gjs/context.h" #include "gjs/jsapi-util.h" -#include "gjs/jsapi-wrapper.h" -#include "gobject.h" -#include "object.h" -#include "value.h" +#include "gjs/macros.h" static std::unordered_map<GType, AutoParamArray> class_init_properties; diff --git a/gi/gobject.h b/gi/gobject.h index 1d925e05..2179bec8 100644 --- a/gi/gobject.h +++ b/gi/gobject.h @@ -23,11 +23,10 @@ #ifndef GI_GOBJECT_H_ #define GI_GOBJECT_H_ -#include <glib-object.h> - -#include <unordered_map> #include <vector> +#include <glib-object.h> + #include "gjs/jsapi-util.h" using AutoParamArray = std::vector<GjsAutoParam>; diff --git a/gi/gtype.cpp b/gi/gtype.cpp index 1b10ea99..a915bf66 100644 --- a/gi/gtype.cpp +++ b/gi/gtype.cpp @@ -22,17 +22,17 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <glib-object.h> +#include <glib.h> -#include <girepository.h> - -#include <unordered_map> +#include "gjs/jsapi-wrapper.h" +#include "js/GCHashTable.h" // for WeakCache #include "gi/gtype.h" +#include "gjs/atoms.h" #include "gjs/context-private.h" #include "gjs/jsapi-class.h" -#include "gjs/jsapi-wrapper.h" -#include "util/log.h" +#include "gjs/jsapi-util.h" GJS_USE static JSObject* gjs_gtype_get_proto(JSContext* cx) G_GNUC_UNUSED; GJS_JSAPI_RETURN_CONVENTION @@ -25,11 +25,10 @@ #ifndef GI_GTYPE_H_ #define GI_GTYPE_H_ -#include <stdbool.h> -#include <glib.h> -#include <girepository.h> +#include <glib-object.h> #include "gjs/jsapi-wrapper.h" + #include "gjs/macros.h" GJS_JSAPI_RETURN_CONVENTION diff --git a/gi/interface.cpp b/gi/interface.cpp index 90ca2066..57a0537b 100644 --- a/gi/interface.cpp +++ b/gi/interface.cpp @@ -22,21 +22,18 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <girepository.h> + +#include "gjs/jsapi-wrapper.h" #include "gi/function.h" -#include "gi/gtype.h" #include "gi/interface.h" #include "gi/object.h" #include "gi/repo.h" -#include "gjs/jsapi-class.h" -#include "gjs/jsapi-wrapper.h" +#include "gjs/atoms.h" +#include "gjs/context-private.h" #include "gjs/mem-private.h" -#include <util/log.h> - -#include <girepository.h> - InterfacePrototype::InterfacePrototype(GIInterfaceInfo* info, GType gtype) : GIWrapperPrototype(info, gtype), m_vtable( diff --git a/gi/interface.h b/gi/interface.h index 7730b4a0..e10bf561 100644 --- a/gi/interface.h +++ b/gi/interface.h @@ -25,13 +25,16 @@ #ifndef GI_INTERFACE_H_ #define GI_INTERFACE_H_ -#include <stdbool.h> -#include <glib.h> #include <girepository.h> +#include <glib-object.h> +#include <glib.h> + +#include "gjs/jsapi-wrapper.h" #include "gi/wrapperutils.h" #include "gjs/jsapi-util.h" #include "gjs/macros.h" +#include "util/log.h" class InterfacePrototype; class InterfaceInstance; @@ -21,19 +21,20 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <girepository.h> +#include <glib.h> + +#include "gjs/jsapi-wrapper.h" #include "gi/ns.h" -#include "gi/param.h" #include "gi/repo.h" +#include "gjs/atoms.h" +#include "gjs/context-private.h" #include "gjs/jsapi-class.h" -#include "gjs/jsapi-wrapper.h" +#include "gjs/jsapi-util.h" +#include "gjs/macros.h" #include "gjs/mem-private.h" - -#include <util/log.h> -#include <girepository.h> - -#include <string.h> +#include "util/log.h" typedef struct { char *gi_namespace; @@ -24,12 +24,11 @@ #ifndef GI_NS_H_ #define GI_NS_H_ -#include <glib.h> -#include <girepository.h> - -#include "gjs/jsapi-util.h" #include "gjs/macros.h" +class JSObject; +struct JSContext; + GJS_JSAPI_RETURN_CONVENTION JSObject* gjs_create_ns(JSContext *context, const char *ns_name); diff --git a/gi/object.cpp b/gi/object.cpp index 5404fe15..04a1c5f5 100644 --- a/gi/object.cpp +++ b/gi/object.cpp @@ -22,37 +22,39 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <string.h> // for memset, strcmp -#include <memory> -#include <string.h> -#include <tuple> -#include <unordered_map> +#include <algorithm> // for move, find +#include <functional> // for mem_fn +#include <string> +#include <tuple> // for tie +#include <type_traits> // for remove_reference<>::type #include <vector> +#include <ffi.h> +#include <girepository.h> +#include <glib-object.h> +#include <glib.h> + +#include "gjs/jsapi-wrapper.h" + #include "gi/arg.h" #include "gi/closure.h" #include "gi/function.h" #include "gi/gjs_gi_trace.h" #include "gi/object.h" -#include "gi/param.h" +#include "gi/repo.h" +#include "gi/toggle.h" +#include "gi/value.h" #include "gi/wrapperutils.h" +#include "gjs/atoms.h" #include "gjs/context-private.h" +#include "gjs/context.h" #include "gjs/jsapi-class.h" #include "gjs/jsapi-util-args.h" #include "gjs/jsapi-util-root.h" -#include "gjs/jsapi-wrapper.h" #include "gjs/mem-private.h" -#include "gtype.h" -#include "interface.h" -#include "repo.h" -#include "toggle.h" -#include "value.h" - -#include <util/log.h> -#include <girepository.h> - -#include "js/GCHashTable.h" +#include "util/log.h" /* This is a trick to print out the sizes of the structs at compile time, in * an error message. */ diff --git a/gi/object.h b/gi/object.h index 27272f6e..c7df2039 100644 --- a/gi/object.h +++ b/gi/object.h @@ -24,22 +24,28 @@ #ifndef GI_OBJECT_H_ #define GI_OBJECT_H_ -#include <glib-object.h> -#include <girepository.h> +#include <stddef.h> // for size_t #include <forward_list> #include <functional> #include <vector> +#include <girepository.h> +#include <glib-object.h> +#include <glib.h> + +#include "gjs/jsapi-wrapper.h" +#include "js/GCHashTable.h" // for GCHashMap + #include "gi/wrapperutils.h" #include "gjs/jsapi-util-root.h" #include "gjs/jsapi-util.h" -#include "gjs/jsapi-wrapper.h" #include "gjs/macros.h" +#include "util/log.h" -#include "js/GCHashTable.h" - +class GjsAtoms; class ObjectInstance; +class ObjectPrototype; class GjsListLink { private: @@ -62,8 +68,6 @@ struct AutoGValueVector : public std::vector<GValue> { } }; -class ObjectPrototype; - /* * ObjectBase: * diff --git a/gi/param.cpp b/gi/param.cpp index b47eae42..ccf66039 100644 --- a/gi/param.cpp +++ b/gi/param.cpp @@ -21,21 +21,21 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <girepository.h> +#include <glib.h> -#include <string.h> +#include "gjs/jsapi-wrapper.h" -#include "gi/arg.h" #include "gi/function.h" -#include "gi/gtype.h" -#include "gi/object.h" #include "gi/param.h" #include "gi/repo.h" +#include "gi/wrapperutils.h" +#include "gjs/atoms.h" +#include "gjs/context-private.h" #include "gjs/jsapi-class.h" -#include "gjs/jsapi-wrapper.h" +#include "gjs/jsapi-util.h" #include "gjs/mem-private.h" - -#include <util/log.h> +#include "util/log.h" typedef struct { GParamSpec* gparam; // nullptr if we are the prototype and not an instance @@ -24,11 +24,10 @@ #ifndef GI_PARAM_H_ #define GI_PARAM_H_ -#include <stdbool.h> -#include <glib.h> -#include <girepository.h> +#include <glib-object.h> + +#include "gjs/jsapi-wrapper.h" -#include "gjs/jsapi-util.h" #include "gjs/macros.h" GJS_JSAPI_RETURN_CONVENTION diff --git a/gi/private.cpp b/gi/private.cpp index b2060e58..dea49100 100644 --- a/gi/private.cpp +++ b/gi/private.cpp @@ -22,20 +22,24 @@ * IN THE SOFTWARE. */ +#include <stdint.h> + #include <glib-object.h> +#include <glib.h> -#include <unordered_map> +#include "gjs/jsapi-wrapper.h" +#include "gi/gobject.h" +#include "gi/gtype.h" +#include "gi/interface.h" +#include "gi/object.h" +#include "gi/param.h" +#include "gi/private.h" +#include "gi/repo.h" +#include "gjs/atoms.h" #include "gjs/context-private.h" #include "gjs/jsapi-util-args.h" #include "gjs/jsapi-util.h" -#include "gjs/jsapi-wrapper.h" -#include "gobject.h" -#include "interface.h" -#include "object.h" -#include "param.h" -#include "private.h" -#include "repo.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/private.h b/gi/private.h index 9c789f22..26cbadd6 100644 --- a/gi/private.h +++ b/gi/private.h @@ -25,6 +25,7 @@ #define GI_PRIVATE_H_ #include "gjs/jsapi-wrapper.h" + #include "gjs/macros.h" GJS_JSAPI_RETURN_CONVENTION diff --git a/gi/repo.cpp b/gi/repo.cpp index 40f0d7d3..75ce4cee 100644 --- a/gi/repo.cpp +++ b/gi/repo.cpp @@ -21,12 +21,18 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <stdint.h> +#include <string.h> // for strlen + +#include <girepository.h> +#include <glib-object.h> +#include <glib.h> + +#include "gjs/jsapi-wrapper.h" #include "gi/arg.h" #include "gi/boxed.h" #include "gi/enumeration.h" -#include "gi/foreign.h" #include "gi/function.h" #include "gi/fundamental.h" #include "gi/gerror.h" @@ -36,14 +42,13 @@ #include "gi/param.h" #include "gi/repo.h" #include "gi/union.h" +#include "gjs/atoms.h" +#include "gjs/context-private.h" +#include "gjs/global.h" #include "gjs/jsapi-class.h" -#include "gjs/jsapi-wrapper.h" +#include "gjs/jsapi-util.h" #include "gjs/mem-private.h" - -#include <util/misc.h> - -#include <girepository.h> -#include <string.h> +#include "util/log.h" typedef struct { void *dummy; @@ -24,14 +24,12 @@ #ifndef GI_REPO_H_ #define GI_REPO_H_ -#include <stdbool.h> -#include <glib.h> - #include <girepository.h> -#include <util/log.h> #include "gjs/jsapi-wrapper.h" + #include "gjs/macros.h" +#include "util/log.h" GJS_JSAPI_RETURN_CONVENTION bool gjs_define_repo(JSContext *cx, diff --git a/gi/toggle.cpp b/gi/toggle.cpp index 8fae06d0..3807ae13 100644 --- a/gi/toggle.cpp +++ b/gi/toggle.cpp @@ -23,12 +23,15 @@ * Authored by: Philip Chimento <philip@endlessm.com>, <philip.chimento@gmail.com> */ -#include <algorithm> +#include <algorithm> // for find_if #include <deque> #include <mutex> +#include <utility> // for pair + #include <glib-object.h> +#include <glib.h> -#include "toggle.h" +#include "gi/toggle.h" std::deque<ToggleQueue::Item>::iterator ToggleQueue::find_operation_locked(const GObject *gobj, diff --git a/gi/toggle.h b/gi/toggle.h index 44db802f..fa7e01ae 100644 --- a/gi/toggle.h +++ b/gi/toggle.h @@ -29,7 +29,10 @@ #include <atomic> #include <deque> #include <mutex> +#include <utility> // for pair + #include <glib-object.h> +#include <glib.h> #include "gjs/macros.h" #include "util/log.h" diff --git a/gi/union.cpp b/gi/union.cpp index f0f5bec3..56540599 100644 --- a/gi/union.cpp +++ b/gi/union.cpp @@ -21,25 +21,16 @@ * IN THE SOFTWARE. */ -#include <config.h> - -#include <string.h> - #include <girepository.h> -/* include first for logging related #define used in repo.h */ -#include <util/log.h> +#include "gjs/jsapi-wrapper.h" -#include "arg.h" #include "gi/function.h" -#include "gi/gtype.h" -#include "gi/object.h" +#include "gi/repo.h" #include "gi/union.h" -#include "gi/wrapperutils.h" -#include "gjs/jsapi-class.h" -#include "gjs/jsapi-wrapper.h" +#include "gjs/jsapi-util.h" #include "gjs/mem-private.h" -#include "repo.h" +#include "util/log.h" UnionPrototype::UnionPrototype(GIUnionInfo* info, GType gtype) : GIWrapperPrototype(info, gtype) { @@ -24,13 +24,14 @@ #ifndef GI_UNION_H_ #define GI_UNION_H_ -#include <stdbool.h> -#include <glib.h> #include <girepository.h> +#include <glib-object.h> + +#include "gjs/jsapi-wrapper.h" #include "gi/wrapperutils.h" -#include "gjs/jsapi-util.h" #include "gjs/macros.h" +#include "util/log.h" class UnionPrototype; class UnionInstance; diff --git a/gi/value.cpp b/gi/value.cpp index 9a25e18e..a375c34a 100644 --- a/gi/value.cpp +++ b/gi/value.cpp @@ -21,27 +21,34 @@ * IN THE SOFTWARE. */ -#include <config.h> - -#include <mozilla/Unused.h> - -#include <util/log.h> - -#include "foreign.h" -#include "value.h" -#include "closure.h" -#include "arg.h" -#include "param.h" -#include "object.h" -#include "fundamental.h" -#include "boxed.h" -#include "union.h" -#include "gtype.h" -#include "gerror.h" -#include "gjs/context-private.h" -#include "gjs/jsapi-wrapper.h" +#include <limits.h> // for SCHAR_MAX, SCHAR_MIN, UCHAR_MAX +#include <stdint.h> +#include <string.h> // for memset #include <girepository.h> +#include <glib-object.h> +#include <glib.h> + +#include "gjs/jsapi-wrapper.h" +#include "mozilla/Unused.h" + +#include "gi/arg.h" +#include "gi/boxed.h" +#include "gi/closure.h" +#include "gi/foreign.h" +#include "gi/fundamental.h" +#include "gi/gerror.h" +#include "gi/gtype.h" +#include "gi/object.h" +#include "gi/param.h" +#include "gi/union.h" +#include "gi/value.h" +#include "gi/wrapperutils.h" +#include "gjs/atoms.h" +#include "gjs/context-private.h" +#include "gjs/context.h" +#include "gjs/jsapi-util.h" +#include "util/log.h" GJS_JSAPI_RETURN_CONVENTION static bool gjs_value_from_g_value_internal(JSContext *context, @@ -24,10 +24,10 @@ #ifndef GI_VALUE_H_ #define GI_VALUE_H_ -#include <stdbool.h> #include <glib-object.h> -#include "gjs/jsapi-util.h" +#include "gjs/jsapi-wrapper.h" + #include "gjs/macros.h" GJS_JSAPI_RETURN_CONVENTION diff --git a/gi/wrapperutils.cpp b/gi/wrapperutils.cpp index d5bb72ba..b5428c17 100644 --- a/gi/wrapperutils.cpp +++ b/gi/wrapperutils.cpp @@ -21,13 +21,17 @@ * IN THE SOFTWARE. */ -#include <config.h> +#include <girepository.h> +#include <glib-object.h> -#include <string.h> +#include "gjs/jsapi-wrapper.h" #include "gi/function.h" +#include "gi/gtype.h" #include "gi/wrapperutils.h" +#include "gjs/atoms.h" #include "gjs/context-private.h" +#include "gjs/jsapi-util.h" /* Default spidermonkey toString is worthless. Replace it * with something that gives us both the introspection name diff --git a/gi/wrapperutils.h b/gi/wrapperutils.h index 80d71459..95666216 100644 --- a/gi/wrapperutils.h +++ b/gi/wrapperutils.h @@ -25,8 +25,20 @@ #ifndef GI_WRAPPERUTILS_H_ #define GI_WRAPPERUTILS_H_ +#include <stdint.h> + +#include <new> +#include <string> + +#include <girepository.h> +#include <glib-object.h> +#include <glib.h> + +#include "gjs/jsapi-wrapper.h" + +#include "gjs/atoms.h" #include "gjs/context-private.h" -#include "gjs/jsapi-class.h" +#include "gjs/jsapi-class.h" // IWYU pragma: keep #include "gjs/jsapi-util.h" #include "gjs/macros.h" #include "util/log.h" |