Small Tweak
This commit is contained in:
parent
0a0c3cebb3
commit
f40a7c3545
@ -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;
|
||||
|
@ -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 <typename T>
|
||||
T next() {
|
||||
block_pointer(T);
|
||||
@ -30,6 +32,7 @@ struct TrampolineArguments {
|
||||
raw_args += sizeof(T);
|
||||
return ret;
|
||||
}
|
||||
// Read Next Array
|
||||
template <typename T>
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user