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

Function cv2_name

src/mcp/test_impact_coverage.c:938–957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

936}
937
938static bool cv2_name(cv2_context_t *ctx, cv2_span_t span, cbm_coverage_profile_t *row) {
939 if (!span.length || (span.length & 1))
940 return cv2_fail(ctx, CBM_COVERAGE_PARSE_FORMAT);
941 size_t length = span.length / 2;
942 unsigned char *name = cv2_array(ctx, length, 1);
943 if (!name)
944 return false;
945 for (size_t i = 0; i < length; i++) {
946 if (!cv2_step(ctx))
947 return false;
948 int high = cv2_hex_digit(span.data[i * 2]);
949 int low = cv2_hex_digit(span.data[i * 2 + 1]);
950 if (high < 0 || low < 0)
951 return cv2_fail(ctx, CBM_COVERAGE_PARSE_FORMAT);
952 name[i] = (unsigned char)((high << 4) | low);
953 }
954 row->name = name;
955 row->name_length = length;
956 return true;
957}
958
959static bool cv2_profile_compare(cv2_context_t *ctx, const cbm_coverage_profile_t *left,
960 const cbm_coverage_profile_t *right, int *out) {

Callers 1

cv2_profileFunction · 0.85

Calls 4

cv2_failFunction · 0.85
cv2_arrayFunction · 0.85
cv2_stepFunction · 0.85
cv2_hex_digitFunction · 0.85

Tested by

no test coverage detected