diff --git a/media-layer/trampoline/src/guest/guest.h b/media-layer/trampoline/src/guest/guest.h index 2f5166ee..d85eb72c 100644 --- a/media-layer/trampoline/src/guest/guest.h +++ b/media-layer/trampoline/src/guest/guest.h @@ -23,12 +23,12 @@ struct copy_array { if (arr == nullptr) { length = 0; } - this->size = length * sizeof(T); - this->data = arr; + size = length * sizeof(T); + data = arr; } explicit copy_array(const char *str) { - this->size = str != nullptr ? (strlen(str) + 1) : 0; - this->data = str; + size = str != nullptr ? (strlen(str) + 1) : 0; + data = str; } uint32_t size; const void *data; diff --git a/media-layer/trampoline/src/host/host.h b/media-layer/trampoline/src/host/host.h index cd7c607b..ca5acf9e 100644 --- a/media-layer/trampoline/src/host/host.h +++ b/media-layer/trampoline/src/host/host.h @@ -18,11 +18,13 @@ __attribute__((visibility("internal"))) void _add_handler(unsigned char id, hand // Arguments struct TrampolineArguments { + // Constructor explicit TrampolineArguments(const unsigned char *args) { - this->raw_args = args; - this->position = 0; + raw_args = args; + position = 0; } + // Read Next Value template T next() { block_pointer(T); @@ -30,6 +32,7 @@ struct TrampolineArguments { raw_args += sizeof(T); return ret; } + // Read Next Array template const T *next_arr(uint32_t *length = nullptr) { block_pointer(T); @@ -37,7 +40,7 @@ struct TrampolineArguments { if (length != nullptr) { *length = size / sizeof(T); } - static bool just_read_pointer = getenv(MCPI_USE_PIPE_TRAMPOLINE_ENV) == nullptr; + static bool just_read_pointer = !is_trampoline_pipe_based(); if (size == 0) { return nullptr; } else if (just_read_pointer) {