diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index 87db4b99..d040472c 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -766,7 +766,6 @@ void Cyc_set_globals_changed(gc_thread_data *thd); Cyc_utf8_encode(dest, dest_size, &char_value, 1) int Cyc_utf8_encode(char *dest, int sz, uint32_t *src, int srcsz); -uint32_t Cyc_utf8_decode(uint32_t* state, uint32_t* codep, uint32_t byte); int Cyc_utf8_count_code_points(uint8_t* s); int Cyc_utf8_count_code_points_and_bytes(uint8_t* s, char_type *codepoint, int *cpts, int *bytes); uint32_t Cyc_utf8_validate_stream(uint32_t *state, char *str, size_t len); diff --git a/runtime.c b/runtime.c index 21bb846a..3d588a14 100644 --- a/runtime.c +++ b/runtime.c @@ -21,6 +21,8 @@ //int JAE_DEBUG = 0; //int gcMoveCountsDEBUG[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +static uint32_t Cyc_utf8_decode(uint32_t* state, uint32_t* codep, uint32_t byte); + object Cyc_global_set(void *thd, object * glo, object value) { gc_mut_update((gc_thread_data *) thd, *glo, value); @@ -2367,7 +2369,7 @@ object Cyc_string_ref(void *data, object str, object k) if (string_num_cp(str) == string_len(str)) { return obj_char2obj(raw[idx]); } else { - char_type codepoint; + char_type codepoint = 0; uint32_t state = 0; int count; @@ -7250,7 +7252,7 @@ static const uint8_t utf8d[] = { * @param byte Byte to examine * @return The current state: `CYC_UTF8_ACCEPT` if successful otherwise `CYC_UTF8_REJECT`. */ -uint32_t Cyc_utf8_decode(uint32_t* state, uint32_t* codep, uint32_t byte) { +static uint32_t Cyc_utf8_decode(uint32_t* state, uint32_t* codep, uint32_t byte) { uint32_t type = utf8d[byte]; *codep = (*state != CYC_UTF8_ACCEPT) ?