MCPcopy Create free account
hub / github.com/TASEmulators/fceux / PushBinaryItem

Function PushBinaryItem

src/lua-engine.cpp:818–829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

816// push a value's bytes onto the output stack
817template<typename T>
818void PushBinaryItem(T item, std::vector<unsigned char>& output)
819{
820 unsigned char* buf = (unsigned char*)&item;
821#ifdef IS_LITTLE_ENDIAN
822 for(int i = sizeof(T); i; i--)
823 output.push_back(*buf++);
824#else
825 int vecsize = output.size();
826 for(int i = sizeof(T); i; i--)
827 output.insert(output.begin() + vecsize, *buf++);
828#endif
829}
830// read a value from the byte stream and advance the stream by its size
831template<typename T>
832T AdvanceByteStream(const unsigned char*& data, unsigned int& remaining)

Callers 1

Calls 2

sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected