Remove obsolete function

This commit is contained in:
Justin Ethier 2017-10-27 13:02:51 +00:00
parent 6aaa600ebc
commit 8289eca02a
2 changed files with 7 additions and 8 deletions

View file

@ -727,7 +727,6 @@ uint32_t Cyc_utf8_decode(uint32_t* state, uint32_t* codep, uint32_t byte);
int Cyc_utf8_count_code_points(uint8_t* s);
uint32_t Cyc_utf8_validate_stream(uint32_t *state, char *str, size_t len);
uint32_t Cyc_utf8_validate(char *str, size_t len);
int uint32_num_bytes(uint32_t val);
/**@}*/
#endif /* CYCLONE_RUNTIME_H */

View file

@ -6586,13 +6586,13 @@ uint32_t Cyc_utf8_validate(char *str, size_t len) {
return state;
}
int uint32_num_bytes(uint32_t x) {
// TODO: could compute log(val) / log(256)
if (x < 0x100) return 1;
if (x < 0x10000) return 2;
if (x < 0x1000000) return 3;
return 4;
}
//int uint32_num_bytes(uint32_t x) {
// // TODO: could compute log(val) / log(256)
// if (x < 0x100) return 1;
// if (x < 0x10000) return 2;
// if (x < 0x1000000) return 3;
// return 4;
//}
/**
* This function takes one or more 32-bit chars and encodes them