MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / getBlockCheckedRaw

Function getBlockCheckedRaw

src/fileformats/ocd_types.cpp:154–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152
153
154 const void* getBlockCheckedRaw(const QByteArray& byte_array, quint32 pos, quint32 block_size)
155 {
156 if (pos == 0)
157 {
158 return nullptr;
159 }
160 else if (Q_UNLIKELY(quint64(pos) + block_size > std::numeric_limits<quint32>::max()
161 || pos + block_size - 1 >= quint32(byte_array.size())))
162 {
163 qWarning("Ocd::getBlockChecked: Requested data block is out of bounds");
164 return nullptr;
165 }
166 return byte_array.data() + pos;
167 }
168
169
170 QByteArray& addPadding(QByteArray& byte_array)

Callers 1

getBlockCheckedFunction · 0.85

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected