same functions, higher representation 64 bit*/ if unsafe requested when first non numerical character shall be * met the number shall be returned; avoid giving the * exact len of the number */
| 397 | * met the number shall be returned; avoid giving the |
| 398 | * exact len of the number */ |
| 399 | inline static int reverse_hex2int64( char *c, int len, int unsafe, uint64_t *r) |
| 400 | { |
| 401 | char *pc; |
| 402 | char mychar; |
| 403 | |
| 404 | *r=0; |
| 405 | for (pc=c+len-1; len>0; pc--, len--) { |
| 406 | (*r) <<= 4 ; |
| 407 | mychar=*pc; |
| 408 | if ( mychar >='0' && mychar <='9') (*r)+=mychar -'0'; |
| 409 | else if (mychar >='a' && mychar <='f') (*r)+=mychar -'a'+10; |
| 410 | else if (mychar >='A' && mychar <='F') (*r)+=mychar -'A'+10; |
| 411 | else if (unsafe) |
| 412 | return 0; |
| 413 | else return -1; |
| 414 | } |
| 415 | return 0; |
| 416 | } |
| 417 | |
| 418 | inline static int64_t int64_2reverse_hex( char **c, int *size, uint64_t nr ) |
| 419 | { |
no outgoing calls
no test coverage detected