From: Francis Deslauriers Date: Tue, 3 Dec 2019 20:33:22 +0000 (-0500) Subject: Cleanup: apply `include-what-you-use` guideline for `size_t` X-Git-Tag: v2.13.0-rc1~550 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b4051ad8c170901d5297e1b3005b24e63cb0ab1e;p=lttng-ust.git Cleanup: apply `include-what-you-use` guideline for `size_t` I saw that some files use the `size_t` type but there are not including a header for it. The `size_t` type is defined by the following headers: So, to follow the best practice of including what is used in a file, I added `#include ` in files using `size_t` but did not include any of the previously listed header. Signed-off-by: Francis Deslauriers Signed-off-by: Mathieu Desnoyers Change-Id: Ica1d82691335294decf13ffcdf4257e35d6a44c2 --- diff --git a/doc/examples/demo/ust_tests_demo2.h b/doc/examples/demo/ust_tests_demo2.h index eec0349e..4470dc06 100644 --- a/doc/examples/demo/ust_tests_demo2.h +++ b/doc/examples/demo/ust_tests_demo2.h @@ -27,6 +27,7 @@ */ #include +#include TRACEPOINT_EVENT(ust_tests_demo2, loop, TP_ARGS(int, anint, int, netint, long *, values, diff --git a/doc/examples/hello-static-lib/ust_tests_hello.h b/doc/examples/hello-static-lib/ust_tests_hello.h index e783feca..2b557563 100644 --- a/doc/examples/hello-static-lib/ust_tests_hello.h +++ b/doc/examples/hello-static-lib/ust_tests_hello.h @@ -27,6 +27,7 @@ */ #include +#include TRACEPOINT_EVENT(ust_tests_hello, tptest, TP_ARGS(int, anint, int, netint, long *, values, diff --git a/include/lttng/ust-context-provider.h b/include/lttng/ust-context-provider.h index 5b266fa8..4573617b 100644 --- a/include/lttng/ust-context-provider.h +++ b/include/lttng/ust-context-provider.h @@ -23,6 +23,7 @@ * SOFTWARE. */ +#include #include #include diff --git a/include/lttng/ust-ctl.h b/include/lttng/ust-ctl.h index 932940ba..56128490 100644 --- a/include/lttng/ust-ctl.h +++ b/include/lttng/ust-ctl.h @@ -19,6 +19,7 @@ #ifndef _LTTNG_UST_CTL_H #define _LTTNG_UST_CTL_H +#include #include #include #include diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 89309682..a9f80fb0 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/include/ust_snprintf.h b/include/ust_snprintf.h index 5ce14851..a416a27c 100644 --- a/include/ust_snprintf.h +++ b/include/ust_snprintf.h @@ -19,6 +19,7 @@ #define UST_SNPRINTF #include +#include extern int ust_safe_vsnprintf(char *str, size_t n, const char *fmt, va_list ap); extern int ust_safe_snprintf(char *str, size_t n, const char *fmt, ...); diff --git a/liblttng-ust-dl/ust_dl.h b/liblttng-ust-dl/ust_dl.h index c8a06956..0ea21266 100644 --- a/liblttng-ust-dl/ust_dl.h +++ b/liblttng-ust-dl/ust_dl.h @@ -31,6 +31,7 @@ extern "C" { * SOFTWARE. */ +#include #include #include #include diff --git a/liblttng-ust/getenv.c b/liblttng-ust/getenv.c index 25740a50..a05653d7 100644 --- a/liblttng-ust/getenv.c +++ b/liblttng-ust/getenv.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/liblttng-ust/jhash.h b/liblttng-ust/jhash.h index da1e7dd0..416836ad 100644 --- a/liblttng-ust/jhash.h +++ b/liblttng-ust/jhash.h @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include diff --git a/liblttng-ust/lttng-context-cgroup-ns.c b/liblttng-ust/lttng-context-cgroup-ns.c index d4053150..3526798f 100644 --- a/liblttng-ust/lttng-context-cgroup-ns.c +++ b/liblttng-ust/lttng-context-cgroup-ns.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-cpu-id.c b/liblttng-ust/lttng-context-cpu-id.c index a3252f15..c94ef714 100644 --- a/liblttng-ust/lttng-context-cpu-id.c +++ b/liblttng-ust/lttng-context-cpu-id.c @@ -28,6 +28,7 @@ #define _GNU_SOURCE #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-ip.c b/liblttng-ust/lttng-context-ip.c index fb922954..47f5af03 100644 --- a/liblttng-ust/lttng-context-ip.c +++ b/liblttng-ust/lttng-context-ip.c @@ -21,6 +21,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-ipc-ns.c b/liblttng-ust/lttng-context-ipc-ns.c index c973dc86..64b3cd8e 100644 --- a/liblttng-ust/lttng-context-ipc-ns.c +++ b/liblttng-ust/lttng-context-ipc-ns.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-mnt-ns.c b/liblttng-ust/lttng-context-mnt-ns.c index d54c42aa..fb3e7beb 100644 --- a/liblttng-ust/lttng-context-mnt-ns.c +++ b/liblttng-ust/lttng-context-mnt-ns.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-net-ns.c b/liblttng-ust/lttng-context-net-ns.c index 9d6ded12..3da46d63 100644 --- a/liblttng-ust/lttng-context-net-ns.c +++ b/liblttng-ust/lttng-context-net-ns.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-perf-counters.c b/liblttng-ust/lttng-context-perf-counters.c index a6ff55b6..90f9db19 100644 --- a/liblttng-ust/lttng-context-perf-counters.c +++ b/liblttng-ust/lttng-context-perf-counters.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/liblttng-ust/lttng-context-pid-ns.c b/liblttng-ust/lttng-context-pid-ns.c index 1581fb3d..71b42bd6 100644 --- a/liblttng-ust/lttng-context-pid-ns.c +++ b/liblttng-ust/lttng-context-pid-ns.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-procname.c b/liblttng-ust/lttng-context-procname.c index c6d02cf6..73f38878 100644 --- a/liblttng-ust/lttng-context-procname.c +++ b/liblttng-ust/lttng-context-procname.c @@ -21,6 +21,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-provider.c b/liblttng-ust/lttng-context-provider.c index b51ef23f..edb1e9b2 100644 --- a/liblttng-ust/lttng-context-provider.c +++ b/liblttng-ust/lttng-context-provider.c @@ -21,6 +21,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-pthread-id.c b/liblttng-ust/lttng-context-pthread-id.c index 5f9faf85..d3328259 100644 --- a/liblttng-ust/lttng-context-pthread-id.c +++ b/liblttng-ust/lttng-context-pthread-id.c @@ -21,6 +21,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-user-ns.c b/liblttng-ust/lttng-context-user-ns.c index 04b940f6..d3e5192e 100644 --- a/liblttng-ust/lttng-context-user-ns.c +++ b/liblttng-ust/lttng-context-user-ns.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-uts-ns.c b/liblttng-ust/lttng-context-uts-ns.c index fb2d89f9..43faad0d 100644 --- a/liblttng-ust/lttng-context-uts-ns.c +++ b/liblttng-ust/lttng-context-uts-ns.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-vegid.c b/liblttng-ust/lttng-context-vegid.c index 70855688..12d095f7 100644 --- a/liblttng-ust/lttng-context-vegid.c +++ b/liblttng-ust/lttng-context-vegid.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-veuid.c b/liblttng-ust/lttng-context-veuid.c index b627a974..2576aaf0 100644 --- a/liblttng-ust/lttng-context-veuid.c +++ b/liblttng-ust/lttng-context-veuid.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-vgid.c b/liblttng-ust/lttng-context-vgid.c index 7ffaf683..db0c82d8 100644 --- a/liblttng-ust/lttng-context-vgid.c +++ b/liblttng-ust/lttng-context-vgid.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-vpid.c b/liblttng-ust/lttng-context-vpid.c index 11978e6e..aa2586ef 100644 --- a/liblttng-ust/lttng-context-vpid.c +++ b/liblttng-ust/lttng-context-vpid.c @@ -21,6 +21,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-vsgid.c b/liblttng-ust/lttng-context-vsgid.c index 437b01e4..7613bdd6 100644 --- a/liblttng-ust/lttng-context-vsgid.c +++ b/liblttng-ust/lttng-context-vsgid.c @@ -23,6 +23,7 @@ #define _GNU_SOURCE #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-vsuid.c b/liblttng-ust/lttng-context-vsuid.c index 56f3d073..9c8fd585 100644 --- a/liblttng-ust/lttng-context-vsuid.c +++ b/liblttng-ust/lttng-context-vsuid.c @@ -23,6 +23,7 @@ #define _GNU_SOURCE #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-vtid.c b/liblttng-ust/lttng-context-vtid.c index 36e5695d..0a29021d 100644 --- a/liblttng-ust/lttng-context-vtid.c +++ b/liblttng-ust/lttng-context-vtid.c @@ -21,6 +21,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context-vuid.c b/liblttng-ust/lttng-context-vuid.c index 54167519..ad4a07c5 100644 --- a/liblttng-ust/lttng-context-vuid.c +++ b/liblttng-ust/lttng-context-vuid.c @@ -22,6 +22,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-context.c b/liblttng-ust/lttng-context.c index e408defc..bb6a9c9d 100644 --- a/liblttng-ust/lttng-context.c +++ b/liblttng-ust/lttng-context.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/liblttng-ust/lttng-filter-interpreter.c b/liblttng-ust/lttng-filter-interpreter.c index 59bc72cd..f246ce2a 100644 --- a/liblttng-ust/lttng-filter-interpreter.c +++ b/liblttng-ust/lttng-filter-interpreter.c @@ -25,8 +25,9 @@ */ #define _LGPL_SOURCE -#include +#include #include +#include #include #include "lttng-filter.h" #include "string-utils.h" diff --git a/liblttng-ust/lttng-filter-specialize.c b/liblttng-ust/lttng-filter-specialize.c index e269db6a..21e35923 100644 --- a/liblttng-ust/lttng-filter-specialize.c +++ b/liblttng-ust/lttng-filter-specialize.c @@ -25,6 +25,8 @@ */ #define _LGPL_SOURCE +#include + #include "lttng-filter.h" #include diff --git a/liblttng-ust/lttng-filter-validator.c b/liblttng-ust/lttng-filter-validator.c index acac7ce7..49e2e43d 100644 --- a/liblttng-ust/lttng-filter-validator.c +++ b/liblttng-ust/lttng-filter-validator.c @@ -25,6 +25,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include "lttng-filter.h" diff --git a/liblttng-ust/lttng-filter.c b/liblttng-ust/lttng-filter.c index d52658ae..fb8eefdd 100644 --- a/liblttng-ust/lttng-filter.c +++ b/liblttng-ust/lttng-filter.c @@ -25,6 +25,7 @@ */ #define _LGPL_SOURCE +#include #include #include "lttng-filter.h" diff --git a/liblttng-ust/lttng-hash-helper.h b/liblttng-ust/lttng-hash-helper.h index bddc7c46..0df5f288 100644 --- a/liblttng-ust/lttng-hash-helper.h +++ b/liblttng-ust/lttng-hash-helper.h @@ -24,6 +24,7 @@ */ #include +#include #include #include diff --git a/liblttng-ust/lttng-ring-buffer-client.h b/liblttng-ust/lttng-ring-buffer-client.h index 7078938d..62d1ff82 100644 --- a/liblttng-ust/lttng-ring-buffer-client.h +++ b/liblttng-ust/lttng-ring-buffer-client.h @@ -20,6 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include "lttng/bitfield.h" diff --git a/liblttng-ust/lttng-ring-buffer-metadata-client.h b/liblttng-ust/lttng-ring-buffer-metadata-client.h index 45340a7b..05d3f1bb 100644 --- a/liblttng-ust/lttng-ring-buffer-metadata-client.h +++ b/liblttng-ust/lttng-ring-buffer-metadata-client.h @@ -20,6 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include "lttng/bitfield.h" diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 9d0c010d..838bf08b 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -21,6 +21,7 @@ #define _LGPL_SOURCE #define _GNU_SOURCE +#include #include #include #include diff --git a/liblttng-ust/lttng-ust-statedump-provider.h b/liblttng-ust/lttng-ust-statedump-provider.h index b0c43cf7..474e2d22 100644 --- a/liblttng-ust/lttng-ust-statedump-provider.h +++ b/liblttng-ust/lttng-ust-statedump-provider.h @@ -31,6 +31,7 @@ extern "C" { * SOFTWARE. */ +#include #include #include #include diff --git a/liblttng-ust/string-utils.h b/liblttng-ust/string-utils.h index 94e9a5c1..414b6e6a 100644 --- a/liblttng-ust/string-utils.h +++ b/liblttng-ust/string-utils.h @@ -24,6 +24,7 @@ */ #include +#include bool strutils_is_star_glob_pattern(const char *pattern); bool strutils_is_star_at_the_end_only_glob_pattern(const char *pattern); diff --git a/liblttng-ust/ust-core.c b/liblttng-ust/ust-core.c index 76f729a6..255ad963 100644 --- a/liblttng-ust/ust-core.c +++ b/liblttng-ust/ust-core.c @@ -19,6 +19,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/liblttng-ust/ust_lib.h b/liblttng-ust/ust_lib.h index df372dc7..425bd383 100644 --- a/liblttng-ust/ust_lib.h +++ b/liblttng-ust/ust_lib.h @@ -32,6 +32,7 @@ extern "C" { * SOFTWARE. */ +#include #include #include diff --git a/libringbuffer/backend.h b/libringbuffer/backend.h index 46022ad3..52e632d8 100644 --- a/libringbuffer/backend.h +++ b/libringbuffer/backend.h @@ -26,6 +26,7 @@ * the reader in flight recorder mode. */ +#include #include /* Internal helpers */ diff --git a/libringbuffer/backend_internal.h b/libringbuffer/backend_internal.h index e597cf4d..f492cc3e 100644 --- a/libringbuffer/backend_internal.h +++ b/libringbuffer/backend_internal.h @@ -23,6 +23,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include diff --git a/libringbuffer/frontend.h b/libringbuffer/frontend.h index 2a9fd09a..016fc530 100644 --- a/libringbuffer/frontend.h +++ b/libringbuffer/frontend.h @@ -28,6 +28,7 @@ * * See ring_buffer_frontend.c for more information on wait-free algorithms. */ +#include #include #include diff --git a/libringbuffer/frontend_api.h b/libringbuffer/frontend_api.h index bc1fd122..8a320061 100644 --- a/libringbuffer/frontend_api.h +++ b/libringbuffer/frontend_api.h @@ -30,10 +30,13 @@ * See frontend.h for channel allocation and read-side API. */ -#include "frontend.h" +#include + #include #include +#include "frontend.h" + /** * lib_ring_buffer_get_cpu - Precedes ring buffer reserve/commit. * diff --git a/libringbuffer/ring_buffer_backend.c b/libringbuffer/ring_buffer_backend.c index 2dea1db5..b69dc5e6 100644 --- a/libringbuffer/ring_buffer_backend.c +++ b/libringbuffer/ring_buffer_backend.c @@ -20,6 +20,7 @@ #define _GNU_SOURCE #define _LGPL_SOURCE +#include #include #include #include diff --git a/libringbuffer/shm.h b/libringbuffer/shm.h index 1f293e38..b5d1343a 100644 --- a/libringbuffer/shm.h +++ b/libringbuffer/shm.h @@ -21,6 +21,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include diff --git a/libringbuffer/shm_types.h b/libringbuffer/shm_types.h index 11076d29..94ccfa56 100644 --- a/libringbuffer/shm_types.h +++ b/libringbuffer/shm_types.h @@ -22,6 +22,7 @@ */ #include +#include #include #include "shm_internal.h" diff --git a/snprintf/fvwrite.h b/snprintf/fvwrite.h index 65536212..7ba16dc5 100644 --- a/snprintf/fvwrite.h +++ b/snprintf/fvwrite.h @@ -35,6 +35,8 @@ /* * I/O descriptors for __sfvwrite(). */ +#include + struct __lttng_ust_siov { void *iov_base; size_t iov_len; diff --git a/snprintf/patient_write.c b/snprintf/patient_write.c index b6620cb2..9bd2913f 100644 --- a/snprintf/patient_write.c +++ b/snprintf/patient_write.c @@ -17,6 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + /* write() */ #include diff --git a/snprintf/snprintf.c b/snprintf/snprintf.c index a6263979..68b45776 100644 --- a/snprintf/snprintf.c +++ b/snprintf/snprintf.c @@ -32,6 +32,7 @@ */ #include +#include #include #include #include diff --git a/snprintf/various.h b/snprintf/various.h index 30bedd04..638428fd 100644 --- a/snprintf/various.h +++ b/snprintf/various.h @@ -34,6 +34,7 @@ #define UST_SNPRINTF_VARIOUS_H #include +#include struct __lttng_ust_sbuf { unsigned char *_base; diff --git a/snprintf/wcio.h b/snprintf/wcio.h index 0c955e5c..453a41b1 100644 --- a/snprintf/wcio.h +++ b/snprintf/wcio.h @@ -32,6 +32,8 @@ #ifndef _WCIO_H_ #define _WCIO_H_ +#include + /* minimal requirement of SUSv2 */ #define WCIO_UNGETWC_BUFSIZE 1 diff --git a/tests/hello.cxx/ust_tests_hello.h b/tests/hello.cxx/ust_tests_hello.h index ddb83587..22914eef 100644 --- a/tests/hello.cxx/ust_tests_hello.h +++ b/tests/hello.cxx/ust_tests_hello.h @@ -27,6 +27,7 @@ */ #include +#include TRACEPOINT_ENUM(ust_tests_hello, my_enum, TP_ENUM_VALUES( diff --git a/tests/hello/ust_tests_hello.h b/tests/hello/ust_tests_hello.h index 372828f8..a140ca83 100644 --- a/tests/hello/ust_tests_hello.h +++ b/tests/hello/ust_tests_hello.h @@ -28,6 +28,7 @@ #include #include +#include TRACEPOINT_EVENT(ust_tests_hello, tptest, TP_ARGS(int, anint, int, netint, long *, values, diff --git a/tests/test-app-ctx/hello.c b/tests/test-app-ctx/hello.c index 197df21e..85064846 100644 --- a/tests/test-app-ctx/hello.c +++ b/tests/test-app-ctx/hello.c @@ -32,6 +32,7 @@ */ struct mmsghdr; #include +#include #include #include diff --git a/tests/test-app-ctx/ust_tests_hello.h b/tests/test-app-ctx/ust_tests_hello.h index e518b0d4..f16a75d5 100644 --- a/tests/test-app-ctx/ust_tests_hello.h +++ b/tests/test-app-ctx/ust_tests_hello.h @@ -27,6 +27,7 @@ */ #include +#include #include TRACEPOINT_EVENT(ust_tests_hello, tptest,