|
@@ -181,7 +181,8 @@ static inline bool is_space_char(uchar c) {
|
|
}
|
|
}
|
|
|
|
|
|
HL_PRIM double hl_parse_float( vbyte *bytes, int pos, int len ) {
|
|
HL_PRIM double hl_parse_float( vbyte *bytes, int pos, int len ) {
|
|
- const uchar *str = (uchar*)(bytes+pos), *end = NULL;
|
|
|
|
|
|
+ const uchar *str = (uchar*)(bytes+pos);
|
|
|
|
+ uchar *end = NULL;
|
|
while( is_space_char(*str) ) str++;
|
|
while( is_space_char(*str) ) str++;
|
|
double d = utod(str,&end);
|
|
double d = utod(str,&end);
|
|
if( end == str )
|
|
if( end == str )
|
|
@@ -197,12 +198,12 @@ static inline bool has_hex_prefix( const uchar *c, int len, bool is_signed ) {
|
|
|
|
|
|
HL_PRIM vdynamic *hl_parse_int( vbyte *bytes, int pos, int len ) {
|
|
HL_PRIM vdynamic *hl_parse_int( vbyte *bytes, int pos, int len ) {
|
|
const uchar *c = (uchar*)(bytes + pos);
|
|
const uchar *c = (uchar*)(bytes + pos);
|
|
- const uchar *const start = c;
|
|
|
|
|
|
+ const uchar *start = c;
|
|
int h;
|
|
int h;
|
|
while( is_space_char(*c) ) c++;
|
|
while( is_space_char(*c) ) c++;
|
|
uchar sign = c[0];
|
|
uchar sign = c[0];
|
|
bool is_signed = sign == '-' || sign == '+';
|
|
bool is_signed = sign == '-' || sign == '+';
|
|
- if( has_hex_prefix(c,len+start-c,is_signed) ) {
|
|
|
|
|
|
+ if( has_hex_prefix(c,(int)(len+start-c),is_signed) ) {
|
|
h = 0;
|
|
h = 0;
|
|
c += is_signed ? 3 : 2;
|
|
c += is_signed ? 3 : 2;
|
|
while( *c ) {
|
|
while( *c ) {
|
|
@@ -218,7 +219,7 @@ HL_PRIM vdynamic *hl_parse_int( vbyte *bytes, int pos, int len ) {
|
|
}
|
|
}
|
|
if( sign == '-' ) h = -h;
|
|
if( sign == '-' ) h = -h;
|
|
} else {
|
|
} else {
|
|
- const uchar *end = NULL;
|
|
|
|
|
|
+ uchar *end = NULL;
|
|
h = utoi(c,&end);
|
|
h = utoi(c,&end);
|
|
if( c == end )
|
|
if( c == end )
|
|
return NULL;
|
|
return NULL;
|