1010
1111// these are the chars that can follow a true/false/null or number atom
1212// and nothing else
13- const u32 structural_or_whitespace_negated [256 ] = {
13+ const uint32_t structural_or_whitespace_negated [256 ] = {
1414 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
1515 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
1616 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 ,
@@ -29,11 +29,11 @@ const u32 structural_or_whitespace_negated[256] = {
2929
3030// return non-zero if not a structural or whitespace char
3131// zero otherwise
32- really_inline u32 is_not_structural_or_whitespace (u8 c ) {
32+ really_inline uint32_t is_not_structural_or_whitespace (uint8_t c ) {
3333 return structural_or_whitespace_negated [c ];
3434}
3535
36- const u32 structural_or_whitespace [256 ] = {
36+ const uint32_t structural_or_whitespace [256 ] = {
3737 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
3838 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 ,
3939 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
@@ -46,7 +46,7 @@ const u32 structural_or_whitespace[256] = {
4646 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
4747 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
4848
49- really_inline u32 is_structural_or_whitespace (u8 c ) {
49+ really_inline uint32_t is_structural_or_whitespace (uint8_t c ) {
5050 return structural_or_whitespace [c ];
5151}
5252
@@ -67,22 +67,22 @@ const char digittoval[256] = {
6767 -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 };
6868
6969// return true if we have a valid hex between 0000 and FFFF
70- /*inline bool hex_to_u32(const u8 *src, u32 *res) {
71- u8 v1 = src[0];
72- u8 v2 = src[1];
73- u8 v3 = src[2];
74- u8 v4 = src[3];
70+ /*inline bool hex_to_u32(const uint8_t *src, uint32_t *res) {
71+ uint8_t v1 = src[0];
72+ uint8_t v2 = src[1];
73+ uint8_t v3 = src[2];
74+ uint8_t v4 = src[3];
7575 *res = digittoval[v1] << 12 | digittoval[v2] << 8 | digittoval[v3] << 4 |
7676 digittoval[v4];
7777 return (int32_t)(*res) >= 0;
7878}*/
7979
8080// returns a value with the highest bit set if it is not valid
81- uint32_t hex_to_u32_nocheck (const u8 * src ) {
82- u8 v1 = src [0 ];
83- u8 v2 = src [1 ];
84- u8 v3 = src [2 ];
85- u8 v4 = src [3 ];
81+ uint32_t hex_to_u32_nocheck (const uint8_t * src ) {
82+ uint8_t v1 = src [0 ];
83+ uint8_t v2 = src [1 ];
84+ uint8_t v3 = src [2 ];
85+ uint8_t v4 = src [3 ];
8686 return digittoval [v1 ] << 12 | digittoval [v2 ] << 8 | digittoval [v3 ] << 4 |
8787 digittoval [v4 ];
8888}
@@ -99,7 +99,7 @@ uint32_t hex_to_u32_nocheck(const u8 *src) {
9999//
100100// Note: we assume that surrogates are treated separately
101101//
102- inline size_t codepoint_to_utf8 (uint32_t cp , u8 * c ) {
102+ inline size_t codepoint_to_utf8 (uint32_t cp , uint8_t * c ) {
103103 if (cp <= 0x7F ) {
104104 c [0 ] = cp ;
105105 return 1 ; // ascii
0 commit comments