From 025f03fde6577340ce06cb225c9bb3ed793760ea Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 21 Jul 2013 15:03:22 +0900 Subject: [PATCH] sexp_string_size and sexp_string_length both return sexp_uint_t. --- doc/chibi.scrbl | 4 ++-- include/chibi/sexp.h | 2 +- sexp.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/chibi.scrbl b/doc/chibi.scrbl index 2c96b9ae..3015aad0 100755 --- a/doc/chibi.scrbl +++ b/doc/chibi.scrbl @@ -690,8 +690,8 @@ the following macros: \itemlist[ \item{\ccode{char* sexp_string_data(s)} - the raw bytes of the string} -\item{\ccode{unsigned long sexp_string_size(s)} - the number of raw bytes in the string} -\item{\ccode{int sexp_string_length(sexp s)} - the number of characters encoded in \var{s}} +\item{\ccode{sexp_uint_t sexp_string_size(s)} - the number of raw bytes in the string} +\item{\ccode{sexp_uint_t sexp_string_length(sexp s)} - the number of characters encoded in \var{s}} ] Currently all Scheme strings also happen to be NULL-terminated, but diff --git a/include/chibi/sexp.h b/include/chibi/sexp.h index 2bc9642e..7f532217 100755 --- a/include/chibi/sexp.h +++ b/include/chibi/sexp.h @@ -1403,7 +1403,7 @@ SEXP_API void sexp_init(void); #if SEXP_USE_UTF8_STRINGS SEXP_API int sexp_utf8_initial_byte_count (int c); SEXP_API int sexp_utf8_char_byte_count (int c); -SEXP_API int sexp_string_utf8_length (unsigned char *p, int len); +SEXP_API sexp_uint_t sexp_string_utf8_length (unsigned char *p, long len); SEXP_API char* sexp_string_utf8_prev (unsigned char *p); SEXP_API sexp sexp_string_utf8_ref (sexp ctx, sexp str, sexp i); SEXP_API sexp sexp_string_utf8_index_ref (sexp ctx, sexp self, sexp_sint_t n, sexp str, sexp i); diff --git a/sexp.c b/sexp.c index 3f9798ce..83db093b 100644 --- a/sexp.c +++ b/sexp.c @@ -923,9 +923,9 @@ int sexp_utf8_char_byte_count (int c) { return 4; } -int sexp_string_utf8_length (unsigned char *p, int len) { +sexp_uint_t sexp_string_utf8_length (unsigned char *p, long len) { unsigned char *q = p+len; - int i; + sexp_uint_t i; for (i=0; p