MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SlCalcArrayLen

Function SlCalcArrayLen

src/saveload/saveload.cpp:1169–1172  ·  view source on GitHub ↗

* Return the size in bytes of a certain type of atomic array * @param length The length of the array counted in elements * @param conv VarType type of the variable that is used in calculating the size */

Source from the content-addressed store, hash-verified

1167 * @param conv VarType type of the variable that is used in calculating the size
1168 */
1169static inline size_t SlCalcArrayLen(size_t length, VarType conv)
1170{
1171 return SlCalcConvFileLen(conv) * length + SlGetArrayLength(length);
1172}
1173
1174/**
1175 * Save/Load the length of the array followed by the array of SL_VAR elements.

Callers 1

SlCalcObjMemberLengthFunction · 0.85

Calls 2

SlCalcConvFileLenFunction · 0.85
SlGetArrayLengthFunction · 0.85

Tested by

no test coverage detected