Add type-checked versions of allocation and deallocations functions
[lttng-tools.git] / src / lib / lttng-ctl / rotate.cpp
index 6a003a18ec101f1b0a3aa13eaaf5027c8df2c987..106b8fb489947be591f31e6e44ab863f815ee9d3 100644 (file)
 
 #include <lttng/lttng-error.h>
 #include <lttng/rotation.h>
-#include <lttng/location-internal.h>
-#include <lttng/rotate-internal.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/macros.h>
+#include <lttng/location-internal.hpp>
+#include <lttng/rotate-internal.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+#include <common/macros.hpp>
 
-#include "lttng-ctl-helper.h"
+#include "lttng-ctl-helper.hpp"
 
 static
 enum lttng_rotation_status ask_rotation_info(
@@ -196,7 +196,7 @@ end:
  * Return 0 on success else a negative LTTng error code.
  */
 int lttng_rotate_session(const char *session_name,
-               struct lttng_rotation_immediate_descriptor *descriptor,
+               struct lttng_rotation_immediate_descriptor *descriptor __attribute__((unused)),
                struct lttng_rotation_handle **rotation_handle)
 {
        struct lttcomm_session_msg lsm;
@@ -230,7 +230,7 @@ int lttng_rotate_session(const char *session_name,
                goto end;
        }
 
-       *rotation_handle = (lttng_rotation_handle *) zmalloc(sizeof(struct lttng_rotation_handle));
+       *rotation_handle = zmalloc<lttng_rotation_handle>();
        if (!*rotation_handle) {
                ret = -LTTNG_ERR_NOMEM;
                goto end;
@@ -350,7 +350,7 @@ end:
 static
 struct lttng_rotation_schedules *lttng_rotation_schedules_create(void)
 {
-       return (lttng_rotation_schedules *) zmalloc(sizeof(struct lttng_rotation_schedules));
+       return zmalloc<lttng_rotation_schedules>();
 }
 
 static
@@ -463,7 +463,7 @@ lttng_rotation_schedule_size_threshold_create(void)
 {
        struct lttng_rotation_schedule_size_threshold *schedule;
 
-       schedule = (lttng_rotation_schedule_size_threshold *) zmalloc(sizeof(*schedule));
+       schedule = zmalloc<lttng_rotation_schedule_size_threshold>();
        if (!schedule) {
                goto end;
        }
@@ -529,7 +529,7 @@ lttng_rotation_schedule_periodic_create(void)
 {
        struct lttng_rotation_schedule_periodic *schedule;
 
-       schedule = (lttng_rotation_schedule_periodic *) zmalloc(sizeof(*schedule));
+       schedule = zmalloc<lttng_rotation_schedule_periodic>();
        if (!schedule) {
                goto end;
        }
This page took 0.025172 seconds and 4 git commands to generate.