| 49 | void putaint(vector<uchar> &p, int n) { putaint_(p, n); } |
| 50 | |
| 51 | int getaint(ucharbuf &p) |
| 52 | { |
| 53 | int c = ((char)p.get()) + 125; |
| 54 | if(c==-128) { int n = p.get(); n |= p.get()<<8; n -= 256; DEBUGVAR(n); return n; } |
| 55 | else if(c==-127) { int n = p.get(); n |= p.get()<<8; n |= p.get()<<16; n |= (p.get()<<24); DEBUGVAR(n); return n; } |
| 56 | else |
| 57 | { |
| 58 | DEBUGVAR(c); |
| 59 | return c; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // much smaller encoding for unsigned integers up to 28 bits, but can handle signed |
| 64 | template<class T> |