MCPcopy Create free account
hub / github.com/assaultcube/AC / putint_

Function putint_

source/src/protocol.cpp:14–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13template<class T>
14static inline void putint_(T &p, int n)
15{
16 DEBUGVAR(n);
17 if(n<128 && n>-127) p.put(n);
18 else if(n<0x8000 && n>=-0x8000) { p.put(0x80); p.put(n); p.put(n>>8); }
19 else { p.put(0x81); p.put(n); p.put(n>>8); p.put(n>>16); p.put(n>>24); }
20}
21void putint(ucharbuf &p, int n) { putint_(p, n); }
22void putint(packetbuf &p, int n) { putint_(p, n); }
23void putint(vector<uchar> &p, int n) { putint_(p, n); }

Callers 1

putintFunction · 0.85

Calls 1

putMethod · 0.45

Tested by

no test coverage detected