diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-09-10 12:30:57 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-09-10 12:30:57 -0400 |
| commit | c9474faa4e6cfd6480c1bd24216c26f4320e3c29 (patch) | |
| tree | 4bf022698f229cd276b598ed95aa30a61e882674 /src/buffer.hpp | |
| parent | f27d82fe90e1d0007bf2d3ef52eac8cdbc381e0d (diff) | |
| parent | 7c9f7b72c59e7c6de38038f512ae332fc164e8d7 (diff) | |
| download | zig-c9474faa4e6cfd6480c1bd24216c26f4320e3c29.tar.gz zig-c9474faa4e6cfd6480c1bd24216c26f4320e3c29.zip | |
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'src/buffer.hpp')
| -rw-r--r-- | src/buffer.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buffer.hpp b/src/buffer.hpp index c12d71956f..501e44b5ac 100644 --- a/src/buffer.hpp +++ b/src/buffer.hpp @@ -173,4 +173,9 @@ static inline void buf_upcase(Buf *buf) { } } +static inline Slice<uint8_t> buf_to_slice(Buf *buf) { + return Slice<uint8_t>{reinterpret_cast<uint8_t*>(buf_ptr(buf)), buf_len(buf)}; +} + + #endif |
