fix: all functions have declarations (-Wmissing-prototypes -Wold-style-definition)
[lttng-ust.git] / tests / compile / test-app-ctx / hello.c
index d1cbca4c35a280dae29a61e68adcf44261afa263..c08fa8dd0347eef348aa0ebafa389796d9397264 100644 (file)
@@ -35,6 +35,7 @@ struct mmsghdr;
 
 static __thread unsigned int test_count;
 
+static
 void test_inc_count(void)
 {
        test_count++;
@@ -109,8 +110,7 @@ void test_record(struct lttng_ust_ctx_field *field,
        int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES;
        char sel_char = (char) sel;
 
-       lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(char));
-       lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+       lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char), lttng_ust_rb_alignof(char));
        switch (sel) {
        case LTTNG_UST_DYNAMIC_TYPE_NONE:
                break;
@@ -118,86 +118,76 @@ void test_record(struct lttng_ust_ctx_field *field,
        {
                int8_t v = -8;
 
-               lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(v));
-               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
                break;
        }
        case LTTNG_UST_DYNAMIC_TYPE_S16:
        {
                int16_t v = -16;
 
-               lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(v));
-               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
                break;
        }
        case LTTNG_UST_DYNAMIC_TYPE_S32:
        {
                int32_t v = -32;
 
-               lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(v));
-               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
                break;
        }
        case LTTNG_UST_DYNAMIC_TYPE_S64:
        {
                int64_t v = -64;
 
-               lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(v));
-               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
                break;
        }
        case LTTNG_UST_DYNAMIC_TYPE_U8:
        {
                uint8_t v = 8;
 
-               lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(v));
-               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
                break;
        }
        case LTTNG_UST_DYNAMIC_TYPE_U16:
        {
                uint16_t v = 16;
 
-               lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(v));
-               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
                break;
        }
        case LTTNG_UST_DYNAMIC_TYPE_U32:
        {
                uint32_t v = 32;
 
-               lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(v));
-               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
                break;
        }
        case LTTNG_UST_DYNAMIC_TYPE_U64:
        {
                uint64_t v = 64;
 
-               lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(v));
-               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
                break;
        }
        case LTTNG_UST_DYNAMIC_TYPE_FLOAT:
        {
                float f = 22322.0;
 
-               lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(f));
-               lttng_chan_buf->ops->event_write(ctx, &f, sizeof(f));
+               lttng_chan_buf->ops->event_write(ctx, &f, sizeof(f), lttng_ust_rb_alignof(f));
                break;
        }
        case LTTNG_UST_DYNAMIC_TYPE_DOUBLE:
        {
                double d = 2.0;
 
-               lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_ust_rb_alignof(d));
-               lttng_chan_buf->ops->event_write(ctx, &d, sizeof(d));
+               lttng_chan_buf->ops->event_write(ctx, &d, sizeof(d), lttng_ust_rb_alignof(d));
                break;
        }
        case LTTNG_UST_DYNAMIC_TYPE_STRING:
        {
                const char *str = "teststr";
-               lttng_chan_buf->ops->event_write(ctx, str, strlen(str) + 1);
+               lttng_chan_buf->ops->event_write(ctx, str, strlen(str) + 1, 1);
                break;
        }
        default:
@@ -261,12 +251,14 @@ struct lttng_ust_context_provider myprovider = {
        .get_value = test_get_value,
 };
 
+static
 void inthandler(int sig)
 {
        printf("in SIGUSR1 handler\n");
        tracepoint(ust_tests_hello, tptest_sighandler);
 }
 
+static
 int init_int_handler(void)
 {
        int result;
@@ -294,8 +286,6 @@ int init_int_handler(void)
        return 0;
 }
 
-void test_inc_count(void);
-
 int main(int argc, char **argv)
 {
        int i, netint;
This page took 0.025208 seconds and 4 git commands to generate.