MCPcopy Create free account
hub / github.com/WheretIB/nullc / ArrayCopy

Method ArrayCopy

NULLC/StdLib.cpp:957–972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955}
956
957void NULLC::ArrayCopy(NULLCAutoArray dst, NULLCAutoArray src)
958{
959 if(dst.ptr == src.ptr)
960 return;
961 if(dst.typeID != src.typeID)
962 {
963 nullcThrowError("ERROR: destination element type '%s' doesn't match source element type '%s'", nullcGetTypeName(dst.typeID), nullcGetTypeName(src.typeID));
964 return;
965 }
966 if(dst.len < src.len)
967 {
968 nullcThrowError("ERROR: destination array size '%d' is smaller than source array size '%s'", dst.len, src.len);
969 return;
970 }
971 memcpy(dst.ptr, src.ptr, nullcGetTypeSize(dst.typeID) * src.len);
972}

Callers

nothing calls this directly

Calls 3

nullcThrowErrorFunction · 0.70
nullcGetTypeNameFunction · 0.50
nullcGetTypeSizeFunction · 0.50

Tested by

no test coverage detected