From 677b341ad4c97dfd688d8267c12fe13984158707 Mon Sep 17 00:00:00 2001 From: dzaima Date: Tue, 6 Feb 2024 14:19:52 +0200 Subject: [PATCH] merge readRe & makeRe, reduce its result size to the proper size previously the 1<>reW; - if (reW) dst = m_tyarrv(&r, 1<a[0].o; assert(isC32(e) || e.u==ty_voidptr.u); - u8 etw = isC32(e)? sty_w[styG(e)] : sizeof(void*); - return makeRe(t->reType, t->reWidth, ptr, etw); + u8 elW = isC32(e)? sty_w[styG(e)] : sizeof(void*); // bytes + u8 reW = t->reWidth; // log bits + B r; + char* dst = m_tyarrlbv(&r, reW, (elW*8)>>reW, (t->reType=='c'? reTyMapC : reTyMapI)[reW]); + memcpy(dst, src, elW); + return r; } static B readAny(B o, u8* ptr) { // doesn't consume