MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / reverse_hex2int64

Function reverse_hex2int64

ut.h:399–416  ·  view source on GitHub ↗

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 */

Source from the content-addressed store, hash-verified

397 * met the number shall be returned; avoid giving the
398 * exact len of the number */
399inline 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
418inline static int64_t int64_2reverse_hex( char **c, int *size, uint64_t nr )
419{

Callers 2

dm_send_answerFunction · 0.85
parse_branchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected