summaryrefslogtreecommitdiff
path: root/src/helper/binarybuffer.h
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-14 10:14:04 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-16 00:46:33 -0800
commitd50caa97d17187ed96746cc1527e5dbf57d4a81a (patch)
tree60cbe3b12b386a180135162af69b773a0e76e08d /src/helper/binarybuffer.h
parent5a43bd2e185bf469561a8370dcd543cc4813c33f (diff)
downloadopenocd+libswd-d50caa97d17187ed96746cc1527e5dbf57d4a81a.tar.gz
openocd+libswd-d50caa97d17187ed96746cc1527e5dbf57d4a81a.tar.bz2
openocd+libswd-d50caa97d17187ed96746cc1527e5dbf57d4a81a.tar.xz
openocd+libswd-d50caa97d17187ed96746cc1527e5dbf57d4a81a.zip
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.h6
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))