| 936 | } |
| 937 | |
| 938 | static 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 | |
| 959 | static bool cv2_profile_compare(cv2_context_t *ctx, const cbm_coverage_profile_t *left, |
| 960 | const cbm_coverage_profile_t *right, int *out) { |
no test coverage detected