MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cv2_decimal

Function cv2_decimal

src/mcp/test_impact_coverage.c:798–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

796}
797
798static bool cv2_decimal(cv2_context_t *ctx, cv2_span_t span, bool canonical, uint64_t *out) {
799 if (!span.length || (canonical && span.length > 1 && span.data[0] == '0'))
800 return cv2_fail(ctx, CBM_COVERAGE_PARSE_FORMAT);
801 uint64_t value = 0;
802 for (size_t i = 0; i < span.length; i++) {
803 if (!cv2_step(ctx))
804 return false;
805 unsigned char byte = span.data[i];
806 if (byte < '0' || byte > '9')
807 return cv2_fail(ctx, CBM_COVERAGE_PARSE_FORMAT);
808 unsigned digit = (unsigned)(byte - '0');
809 if (value > (UINT64_MAX - digit) / 10)
810 return cv2_fail(ctx, CBM_COVERAGE_PARSE_FORMAT);
811 value = value * 10 + digit;
812 }
813 *out = value;
814 return true;
815}
816
817static int cv2_hex_digit(unsigned char byte) {
818 if (byte >= '0' && byte <= '9')

Callers 3

cv2_headerFunction · 0.85
cv2_profileFunction · 0.85
cv2_test_idsFunction · 0.85

Calls 2

cv2_failFunction · 0.85
cv2_stepFunction · 0.85

Tested by

no test coverage detected