[host] use variable-relative sizeof where possible

This commit is contained in:
Tudor Brindus
2021-08-15 12:18:01 -04:00
committed by Geoffrey McRae
parent c3f7327187
commit 982b4e6625
4 changed files with 10 additions and 10 deletions

View File

@@ -153,7 +153,7 @@ static bool nvfbc_create(
if (!NvFBCInit())
return false;
this = (struct iface *)calloc(sizeof(struct iface), 1);
this = (struct iface *)calloc(sizeof(*this), 1);
this->seperateCursor = option_get_bool("nvfbc", "decoupleCursor");
this->getPointerBufferFn = getPointerBufferFn;

View File

@@ -133,7 +133,7 @@ bool NvFBCToSysCreate(
return false;
}
*handle = (NvFBCHandle)calloc(sizeof(struct stNvFBCHandle), 1);
*handle = (NvFBCHandle)calloc(sizeof(**handle), 1);
(*handle)->nvfbc = static_cast<NvFBCToSys *>(params.pNvFBC);
if (maxWidth)