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

Function collect_sites

tests/test_parse_coverage.c:1191–1202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1189} cov_site_t;
1190
1191static int collect_sites(const CBMFileResult *r, bool calls, cov_site_t **out) {
1192 int n = calls ? r->calls.count : r->usages.count;
1193 *out = calloc((size_t)(n > 0 ? n : 1), sizeof(cov_site_t));
1194 for (int i = 0; i < n && *out; i++) {
1195 (*out)[i] =
1196 calls ? (cov_site_t){r->calls.items[i].callee_name, r->calls.items[i].site_start_byte,
1197 r->calls.items[i].site_end_byte}
1198 : (cov_site_t){r->usages.items[i].ref_name, r->usages.items[i].site_start_byte,
1199 r->usages.items[i].site_end_byte};
1200 }
1201 return *out ? n : 0;
1202}
1203
1204static bool site_in(cov_site_t s, const cov_site_t *arr, int n) {
1205 for (int i = 0; i < n; i++) {

Callers 1

sites_agreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected