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

Function VectorIndex

NULLC/includes/vector.cpp:99–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 }
98
99 NULLCRef VectorIndex(vector* vec, unsigned int index)
100 {
101 NULLCRef ret = { 0, 0 };
102 if(index >= vec->size)
103 {
104 nullcThrowError("operator[] array index out of bounds");
105 return ret;
106 }
107 ret.typeID = (vec->flags ? nullcGetSubType(vec->elemType) : vec->elemType);
108 ret.ptr = vec->flags ? ((char**)vec->data.ptr)[index] : (vec->data.ptr + vec->elemSize * index);
109 return ret;
110 }
111
112 void VectorReserve(unsigned int size, vector* vec)
113 {

Callers

nothing calls this directly

Calls 2

nullcGetSubTypeFunction · 0.70
nullcThrowErrorFunction · 0.50

Tested by

no test coverage detected