aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-03 16:11:17 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-03-03 16:11:17 -0500
commita92f70571fbd722de86dc9d84caa7642cd841251 (patch)
treeb9da0b7f09b87ec24b2db7245129a69d3ec75393
parentfd751ecedfde19f301cb5e8e097ea1ae18eadd6f (diff)
Update some annotations
-rw-r--r--match.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/match.c b/match.c
index c3e7ffc..e714a45 100644
--- a/match.c
+++ b/match.c
@@ -222,10 +222,9 @@ void cache_destroy(match_ctx_t *ctx)
//
// Look up a pattern definition by name from a definition pattern.
//
-__attribute__((nonnull(2)))
static bp_pat_t *_lookup_def(match_ctx_t *ctx, bp_pat_t *defs, const char *name, size_t namelen)
{
- while (defs) {
+ while (defs != NULL) {
if (defs->type == BP_CHAIN) {
auto chain = When(defs, BP_CHAIN);
bp_pat_t *second = _lookup_def(ctx, chain->second, name, namelen);
@@ -247,7 +246,7 @@ static bp_pat_t *_lookup_def(match_ctx_t *ctx, bp_pat_t *defs, const char *name,
//
// Look up a pattern definition by name from a context.
//
-__attribute__((nonnull))
+__attribute__((nonnull(2)))
bp_pat_t *lookup_ctx(match_ctx_t *ctx, const char *name, size_t namelen)
{
for (; ctx; ctx = ctx->parent_ctx) {