X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Ftestpoint%2Ftestpoint.cpp;h=7d41fae5fa381d5299012a400799ccc940fd9d36;hb=cd9adb8b829564212158943a0d279bb35322ab30;hp=4dfeadd81eb9aad643d31b5200f0d59e38e5e921;hpb=c9e313bc594f40a86eed237dce222c0fc99c957f;p=lttng-tools.git diff --git a/src/common/testpoint/testpoint.cpp b/src/common/testpoint/testpoint.cpp index 4dfeadd81..7d41fae5f 100644 --- a/src/common/testpoint/testpoint.cpp +++ b/src/common/testpoint/testpoint.cpp @@ -8,12 +8,12 @@ #ifndef NTESTPOINT #define _LGPL_SOURCE -#include /* for dlsym */ +#include "testpoint.hpp" + +#include /* for dlsym */ #include /* for getenv */ #include /* for strncmp */ -#include "testpoint.hpp" - /* Environment variable used to enable the testpoints facilities. */ static const char *lttng_testpoint_env_var = "LTTNG_TESTPOINT_ENABLE"; @@ -23,13 +23,12 @@ int lttng_testpoint_activated; /* * Toggle the support for testpoints on the application startup. */ -static void __attribute__((constructor)) lttng_testpoint_check(void) +static void __attribute__((constructor)) lttng_testpoint_check() { - char *testpoint_env_val = NULL; + char *testpoint_env_val = nullptr; testpoint_env_val = getenv(lttng_testpoint_env_var); - if (testpoint_env_val != NULL - && (strncmp(testpoint_env_val, "1", 1) == 0)) { + if (testpoint_env_val != nullptr && (strncmp(testpoint_env_val, "1", 1) == 0)) { lttng_testpoint_activated = 1; } } @@ -43,7 +42,7 @@ static void __attribute__((constructor)) lttng_testpoint_check(void) void *lttng_testpoint_lookup(const char *name) { if (!name) { - return NULL; + return nullptr; } return dlsym(RTLD_DEFAULT, name);