| 833 | /* Read a uint16 from BUF and advance 2 bytes. */ |
| 834 | |
| 835 | static uint16_t |
| 836 | read_uint16 (struct dwarf_buf *buf) |
| 837 | { |
| 838 | const unsigned char *p = buf->buf; |
| 839 | |
| 840 | if (!advance (buf, 2)) |
| 841 | return 0; |
| 842 | if (buf->is_bigendian) |
| 843 | return ((uint16_t) p[0] << 8) | (uint16_t) p[1]; |
| 844 | else |
| 845 | return ((uint16_t) p[1] << 8) | (uint16_t) p[0]; |
| 846 | } |
| 847 | |
| 848 | /* Read a 24 bit value from BUF and advance 3 bytes. */ |
| 849 |
no test coverage detected