Add type-checked versions of allocation and deallocations functions
[lttng-tools.git] / src / bin / lttng-sessiond / rotation-thread.cpp
index 473138cf8861d16871cc6b2f250bf1fb6b911229..ee924ba98f042ee83a7f80f5d0737c95630d867a 100644 (file)
@@ -8,35 +8,35 @@
 
 #define _LGPL_SOURCE
 #include <lttng/trigger/trigger.h>
-#include <common/error.h>
-#include <common/config/session-config.h>
-#include <common/defaults.h>
-#include <common/utils.h>
-#include <common/futex.h>
-#include <common/align.h>
-#include <common/time.h>
-#include <common/hashtable/utils.h>
+#include <common/error.hpp>
+#include <common/config/session-config.hpp>
+#include <common/defaults.hpp>
+#include <common/utils.hpp>
+#include <common/futex.hpp>
+#include <common/align.hpp>
+#include <common/time.hpp>
+#include <common/hashtable/utils.hpp>
 #include <sys/stat.h>
 #include <time.h>
 #include <signal.h>
 #include <inttypes.h>
 
-#include <common/kernel-ctl/kernel-ctl.h>
-#include <lttng/notification/channel-internal.h>
-#include <lttng/rotate-internal.h>
-#include <lttng/location-internal.h>
-#include <lttng/condition/condition-internal.h>
-
-#include "rotation-thread.h"
-#include "lttng-sessiond.h"
-#include "health-sessiond.h"
-#include "rotate.h"
-#include "cmd.h"
-#include "session.h"
-#include "timer.h"
-#include "notification-thread-commands.h"
-#include "utils.h"
-#include "thread.h"
+#include <common/kernel-ctl/kernel-ctl.hpp>
+#include <lttng/notification/channel-internal.hpp>
+#include <lttng/rotate-internal.hpp>
+#include <lttng/location-internal.hpp>
+#include <lttng/condition/condition-internal.hpp>
+
+#include "rotation-thread.hpp"
+#include "lttng-sessiond.hpp"
+#include "health-sessiond.hpp"
+#include "rotate.hpp"
+#include "cmd.hpp"
+#include "session.hpp"
+#include "timer.hpp"
+#include "notification-thread-commands.hpp"
+#include "utils.hpp"
+#include "thread.hpp"
 
 #include <urcu.h>
 #include <urcu/list.h>
@@ -89,7 +89,7 @@ struct rotation_thread_timer_queue *rotation_thread_timer_queue_create(void)
 {
        struct rotation_thread_timer_queue *queue = NULL;
 
-       queue = (rotation_thread_timer_queue *) zmalloc(sizeof(*queue));
+       queue = zmalloc<rotation_thread_timer_queue>();
        if (!queue) {
                PERROR("Failed to allocate timer rotate queue");
                goto end;
@@ -134,7 +134,7 @@ struct rotation_thread_handle *rotation_thread_handle_create(
 {
        struct rotation_thread_handle *handle;
 
-       handle = (rotation_thread_handle *) zmalloc(sizeof(*handle));
+       handle = zmalloc<rotation_thread_handle>();
        if (!handle) {
                goto end;
        }
@@ -193,7 +193,7 @@ void rotation_thread_enqueue_job(struct rotation_thread_timer_queue *queue,
                goto end;
        }
 
-       job = (rotation_thread_job *) zmalloc(sizeof(struct rotation_thread_job));
+       job = zmalloc<rotation_thread_job>();
        if (!job) {
                PERROR("Failed to allocate rotation thread job of type \"%s\" for session \"%s\"",
                                job_type_str, session->name);
@@ -564,7 +564,7 @@ int run_job(struct rotation_thread_job *job, struct ltt_session *session,
 
 static
 int handle_job_queue(struct rotation_thread_handle *handle,
-               struct rotation_thread *state,
+               struct rotation_thread *state __attribute__((unused)),
                struct rotation_thread_timer_queue *queue)
 {
        int ret = 0;
@@ -710,9 +710,9 @@ end:
 }
 
 static
-int handle_notification_channel(int fd,
+int handle_notification_channel(int fd __attribute__((unused)),
                struct rotation_thread_handle *handle,
-               struct rotation_thread *state)
+               struct rotation_thread *state __attribute__((unused)))
 {
        int ret;
        bool notification_pending;
This page took 0.028938 seconds and 4 git commands to generate.