| 23 | void putint(vector<uchar> &p, int n) { putint_(p, n); } |
| 24 | |
| 25 | int getint(ucharbuf &p) |
| 26 | { |
| 27 | int c = (char)p.get(); |
| 28 | if(c==-128) { int n = p.get(); n |= char(p.get())<<8; DEBUGVAR(n); return n; } |
| 29 | else if(c==-127) { int n = p.get(); n |= p.get()<<8; n |= p.get()<<16; n |= (p.get()<<24); DEBUGVAR(n); return n; } |
| 30 | else |
| 31 | { |
| 32 | DEBUGVAR(c); |
| 33 | return c; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // special encoding for asymmetric small integers: -1..252 go into one byte, -256..65279 go into three bytes and any other int goes into five bytes |
| 38 | // (the network encoding is compatible with basic getint) |
no test coverage detected