MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / zero

Method zero

src/Array.cpp:205–226  ·  view source on GitHub ↗

Set numeric values to 0, pointers to null, bools to false

Source from the content-addressed store, hash-verified

203
204// Set numeric values to 0, pointers to null, bools to false
205void ArrayBase::zero(Dynamic inFirst, Dynamic inCount)
206{
207 int first = inFirst==null() ? 0 : inFirst->__ToInt();
208 if (first<0)
209 first+=length;
210 if (first<0 || first>=length)
211 return;
212
213 int count = length;
214 if (inCount!=null())
215 count = inCount->__ToInt();
216 if (count<0)
217 count += length;
218 if (count<0)
219 return;
220
221 if (first+count > length)
222 count = length - first;
223
224 int size = GetElementSize();
225 memset(mBase + first*size, 0, count*size);
226}
227
228int ArrayBase::Memcmp(ArrayBase *inOther)
229{

Callers

nothing calls this directly

Calls 3

nullClass · 0.50
GetElementSizeFunction · 0.50
__ToIntMethod · 0.45

Tested by

no test coverage detected