** Read a varint. Put the value in *pVal and return the number of bytes. */
| 10699 | ** Read a varint. Put the value in *pVal and return the number of bytes. |
| 10700 | */ |
| 10701 | static int dbdataGetVarint(const u8 *z, sqlite3_int64 *pVal){ |
| 10702 | sqlite3_int64 v = 0; |
| 10703 | int i; |
| 10704 | for(i=0; i<8; i++){ |
| 10705 | v = (v<<7) + (z[i]&0x7f); |
| 10706 | if( (z[i]&0x80)==0 ){ *pVal = v; return i+1; } |
| 10707 | } |
| 10708 | v = (v<<8) + (z[i]&0xff); |
| 10709 | *pVal = v; |
| 10710 | return 9; |
| 10711 | } |
| 10712 | |
| 10713 | /* |
| 10714 | ** Return the number of bytes of space used by an SQLite value of type |
no outgoing calls
no test coverage detected