Defs of `r` with this label, name and start line; `*qn` gets the last one's QN. */
| 7491 | |
| 7492 | /* Defs of `r` with this label, name and start line; `*qn` gets the last one's QN. */ |
| 7493 | static int count_defs_at(const CBMFileResult *r, const char *label, const char *name, uint32_t line, |
| 7494 | const char **qn) { |
| 7495 | int n = 0; |
| 7496 | for (int i = 0; i < r->defs.count; i++) { |
| 7497 | const CBMDefinition *d = &r->defs.items[i]; |
| 7498 | if (d->label && d->name && strcmp(d->label, label) == 0 && strcmp(d->name, name) == 0 && |
| 7499 | d->start_line == line) { |
| 7500 | *qn = d->qualified_name; |
| 7501 | n++; |
| 7502 | } |
| 7503 | } |
| 7504 | return n; |
| 7505 | } |
| 7506 | |
| 7507 | /* A macro-generated struct body (the kernel's lib/tests/randstruct_kunit.c: |
| 7508 | * `struct s { DO_MANY_MEMBERS(m) };`, `struct t { mixed_members };`) opens a |