MCPcopy Create free account
hub / github.com/F-Stack/f-stack / getLongDoubleFromObject

Function getLongDoubleFromObject

app/redis-6.2.6/src/object.c:648–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

646}
647
648int getLongDoubleFromObject(robj *o, long double *target) {
649 long double value;
650
651 if (o == NULL) {
652 value = 0;
653 } else {
654 serverAssertWithInfo(NULL,o,o->type == OBJ_STRING);
655 if (sdsEncodedObject(o)) {
656 if (!string2ld(o->ptr, sdslen(o->ptr), &value))
657 return C_ERR;
658 } else if (o->encoding == OBJ_ENCODING_INT) {
659 value = (long)o->ptr;
660 } else {
661 serverPanic("Unknown string encoding");
662 }
663 }
664 *target = value;
665 return C_OK;
666}
667
668int getLongDoubleFromObjectOrReply(client *c, robj *o, long double *target, const char *msg) {
669 long double value;

Callers 1

Calls 2

string2ldFunction · 0.85
sdslenFunction · 0.85

Tested by

no test coverage detected