diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-14 10:14:04 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-16 00:46:33 -0800 |
commit | d50caa97d17187ed96746cc1527e5dbf57d4a81a (patch) | |
tree | 60cbe3b12b386a180135162af69b773a0e76e08d /src/helper/binarybuffer.h | |
parent | 5a43bd2e185bf469561a8370dcd543cc4813c33f (diff) |
improve str_to_buf and buf_to_str helpers
Improve types: use void * and unsigned. Move all variables to point of
first use. Move radix guessing logic to new str_radix_guess helper.
Diffstat (limited to 'src/helper/binarybuffer.h')
-rw-r--r-- | src/helper/binarybuffer.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/helper/binarybuffer.h b/src/helper/binarybuffer.h index 400cbbe6..49050074 100644 --- a/src/helper/binarybuffer.h +++ b/src/helper/binarybuffer.h @@ -79,9 +79,9 @@ uint8_t* buf_set_ones(uint8_t *buf, int count); uint8_t* buf_set_buf(const uint8_t *src, int src_start, uint8_t *dst, int dst_start, int len); -int str_to_buf(const char *str, int len, - uint8_t *bin_buf, int buf_size, int radix); -char* buf_to_str(const uint8_t *buf, int size, int radix); +int str_to_buf(const char *str, unsigned len, + void *bin_buf, unsigned buf_size, unsigned radix); +char* buf_to_str(const void *buf, unsigned size, unsigned radix); #define CEIL(m, n) (((m) + (n) - 1) / (n)) |