From 7fe0498a9173fca00dcd45a41847e629b70cd941 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 3 Sep 2021 17:31:29 -0400 Subject: [PATCH] common: compile libindex as C++ MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ia9ade43bad7d53a652e83529d0e4f3d29b7839c8 Signed-off-by: Simon Marchi Signed-off-by: Jérémie Galarneau --- src/common/index/Makefile.am | 5 ++++- src/common/index/{index.c => index.cpp} | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) rename src/common/index/{index.c => index.cpp} (98%) diff --git a/src/common/index/Makefile.am b/src/common/index/Makefile.am index d06f01186..d62a31c30 100644 --- a/src/common/index/Makefile.am +++ b/src/common/index/Makefile.am @@ -2,4 +2,7 @@ noinst_LTLIBRARIES = libindex.la -libindex_la_SOURCES = index.c index.h ctf-index.h +libindex_la_SOURCES = \ + ctf-index.h \ + index.cpp \ + index.h diff --git a/src/common/index/index.c b/src/common/index/index.cpp similarity index 98% rename from src/common/index/index.c rename to src/common/index/index.cpp index f6b8e0716..48d30e428 100644 --- a/src/common/index/index.c +++ b/src/common/index/index.cpp @@ -45,7 +45,7 @@ static enum lttng_trace_chunk_status _lttng_index_file_create_from_trace_chunk( LTTNG_ASSERT(acquired_reference); - index_file = zmalloc(sizeof(*index_file)); + index_file = (lttng_index_file *) zmalloc(sizeof(*index_file)); if (!index_file) { PERROR("Failed to allocate lttng_index_file"); chunk_status = LTTNG_TRACE_CHUNK_STATUS_ERROR; @@ -84,7 +84,7 @@ static enum lttng_trace_chunk_status _lttng_index_file_create_from_trace_chunk( * stays valid even if we re-create a new file with the * same name afterwards. */ - chunk_status = lttng_trace_chunk_unlink_file( + chunk_status = (lttng_trace_chunk_status) lttng_trace_chunk_unlink_file( chunk, index_file_path); if (chunk_status != LTTNG_TRACE_CHUNK_STATUS_OK && !(chunk_status == LTTNG_TRACE_CHUNK_STATUS_ERROR && -- 2.34.1