From d50caa97d17187ed96746cc1527e5dbf57d4a81a Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Sat, 14 Nov 2009 10:14:04 -0800 Subject: 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. --- src/helper/binarybuffer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/helper/binarybuffer.h') 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)) -- cgit v1.2.3