From 1b62e92bcc18762a8e4a2e9e4dc322705bfb7eec Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 4 Jan 2023 19:12:53 -0600 Subject: add kai_text_to_longs() --- src/util/util.c | 23 +++++++++++++++++++++-- src/util/util.h | 5 ++++- src/util/util.test.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/util/util.c b/src/util/util.c index d3e8742..05701c6 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -23,12 +23,12 @@ void *kai_expand_array(void **array, size_t *count, size_t element_size) } -int kai_text_to_reals(ka_real_t *dest, const char *str, size_t count) +size_t kai_text_to_reals(ka_real_t *dest, const char *str, size_t count) { char *nptr = (char*) str; char *end; - int result = count; + size_t result = count; for (int i=0; i