MCPcopy Create free account
hub / github.com/SimHacker/micropolis / load_short

Function load_short

MicropolisCore/src/MicropolisEngine/src/fileio.cpp:161–172  ·  view source on GitHub ↗

* Load an array of short values from file to memory. * * Convert to the correct processor architecture, if necessary. * @param buf Buffer to put the loaded short values in. * @param len Number of short values to load. * @param f File handle of the file to load from. * @return Load was succesfull. */

Source from the content-addressed store, hash-verified

159 * @return Load was succesfull.
160 */
161static bool load_short(short *buf, int len, FILE *f)
162{
163 size_t result = fread(buf, sizeof(short), len, f);
164
165 if ((int)result != len) {
166 return false;
167 }
168
169 SWAP_SHORTS(buf, len); /* to intel */
170
171 return true;
172}
173
174
175/**

Callers 1

loadFileDirMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected