Fix: fix some warnings shown with -Wextra on gcc 9.1.0
authorSimon Marchi <simon.marchi@efficios.com>
Sat, 5 Oct 2019 04:02:59 +0000 (00:02 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 8 Oct 2019 14:23:40 +0000 (10:23 -0400)
commit9c7f2f8572e28b311e918168f70e6feebf33c52b
tree3efcf679f995e8099ff52041904c022357c9a4f6
parente9b03bd9fe752f120d95e5bb209839ad08810c60
Fix: fix some warnings shown with -Wextra on gcc 9.1.0

Fix this:

    /home/simark/src/babeltrace/src/ctf-writer/event.c: In function ‘bt_ctf_event_create’:
    /home/simark/src/babeltrace/src/ctf-writer/event.c:626:3: error: cast between incompatible function types from ‘void (*)(struct bt_ctf_field_wrapper *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
      626 |   (release_header_field_func) destroy_event_header_field);
          |   ^

by adding a second parameter, stream_class, to destroy_event_header_field, to
match the release_header_field_func type (which takes two pointers).

Fix this:

    /home/simark/src/babeltrace/src/lib/trace-ir/clock-class.c: In function ‘bt_clock_class_create’:
    /home/simark/src/babeltrace/src/lib/trace-ir/clock-class.c:125:3: error: cast between incompatible function types from ‘void (*)(struct bt_clock_snapshot *, struct bt_clock_class *)’ to ‘void * (*)(void *, void *)’ [-Werror=cast-function-type]
      125 |   (bt_object_pool_destroy_object_func)
          |   ^

by making bt_object_pool_destroy_object_func return `void` instead of `void *`
(none of the implementations actually return anything, it seems like a copy
paste error from the typedef above).

Change-Id: I8707a4a3b3eb34d84604f9b8117a20eaa5f50c83
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2138
Tested-by: jenkins <jenkins@lttng.org>
src/ctf-writer/event.c
src/lib/object-pool.h
This page took 0.025069 seconds and 4 git commands to generate.