mark direct access result const

This commit is contained in:
dzaima 2022-07-01 21:30:47 +03:00
parent 11c956174b
commit 010db0b1fc
2 changed files with 14 additions and 14 deletions

View File

@ -95,13 +95,13 @@ BQNElType bqn_directArrType(BQNV a);
// Mutating the result, or using it after `a` is freed, results in undefined behavior. // Mutating the result, or using it after `a` is freed, results in undefined behavior.
// Doing other FFI invocations between a direct access request and the last read from the result is currently allowed in CBQN, // Doing other FFI invocations between a direct access request and the last read from the result is currently allowed in CBQN,
// but that may not be true for an implementation which has a compacting garbage collector. // but that may not be true for an implementation which has a compacting garbage collector.
int8_t* bqn_directI8 (BQNV a); const int8_t* bqn_directI8 (BQNV a);
int16_t* bqn_directI16(BQNV a); const int16_t* bqn_directI16(BQNV a);
int32_t* bqn_directI32(BQNV a); const int32_t* bqn_directI32(BQNV a);
double* bqn_directF64(BQNV a); const double* bqn_directF64(BQNV a);
uint8_t* bqn_directC8 (BQNV a); const uint8_t* bqn_directC8 (BQNV a);
uint16_t* bqn_directC16(BQNV a); const uint16_t* bqn_directC16(BQNV a);
uint32_t* bqn_directC32(BQNV a); const uint32_t* bqn_directC32(BQNV a);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -186,13 +186,13 @@ BQNElType bqn_directArrType(BQNV a) {
if (!isArr(b)) return elt_unk; if (!isArr(b)) return elt_unk;
return typeMap[TI(b,elType)]; return typeMap[TI(b,elType)];
} }
i8* bqn_directI8 (BQNV a) { return i8any_ptr (getB(a)); } const i8* bqn_directI8 (BQNV a) { return i8any_ptr (getB(a)); }
i16* bqn_directI16(BQNV a) { return i16any_ptr(getB(a)); } const i16* bqn_directI16(BQNV a) { return i16any_ptr(getB(a)); }
i32* bqn_directI32(BQNV a) { return i32any_ptr(getB(a)); } const i32* bqn_directI32(BQNV a) { return i32any_ptr(getB(a)); }
f64* bqn_directF64(BQNV a) { return f64any_ptr(getB(a)); } const f64* bqn_directF64(BQNV a) { return f64any_ptr(getB(a)); }
u8* bqn_directC8 (BQNV a) { return c8any_ptr (getB(a)); } const u8* bqn_directC8 (BQNV a) { return c8any_ptr (getB(a)); }
u16* bqn_directC16(BQNV a) { return c16any_ptr(getB(a)); } const u16* bqn_directC16(BQNV a) { return c16any_ptr(getB(a)); }
u32* bqn_directC32(BQNV a) { return c32any_ptr(getB(a)); } const u32* bqn_directC32(BQNV a) { return c32any_ptr(getB(a)); }
void ffiFn_visit(Value* v) { mm_visit(((BoundFn*)v)->obj); } void ffiFn_visit(Value* v) { mm_visit(((BoundFn*)v)->obj); }
DEF_FREE(ffiFn) { dec(((BoundFn*)x)->obj); } DEF_FREE(ffiFn) { dec(((BoundFn*)x)->obj); }