From b76929cfd73d339b2567843be0a7b817b935f954 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 24 Sep 2019 09:41:13 +0200 Subject: [PATCH] lib/*: improve some comments --- lib/cache/api.c | 2 +- lib/layer.h | 2 +- lib/utils.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cache/api.c b/lib/cache/api.c index ece97b96d..88feb0ee7 100644 --- a/lib/cache/api.c +++ b/lib/cache/api.c @@ -568,7 +568,7 @@ static ssize_t stash_rrset(struct kr_cache *cache, const struct kr_query *qry, key = key_exact_type(k, rr->type); } - /* Compute materialized sizes of the new data. */ + /* Compute in-cache size for the new data. */ const knot_rdataset_t *rds_sigs = rr_sigs ? &rr_sigs->rrs : NULL; const int rr_ssize = rdataset_dematerialize_size(&rr->rrs); assert(rr_ssize == to_even(rr_ssize)); diff --git a/lib/layer.h b/lib/layer.h index 7518ea7cc..5fbd9df2f 100644 --- a/lib/layer.h +++ b/lib/layer.h @@ -82,7 +82,7 @@ struct kr_layer_api { /** Paired to begin, called both on successes and failures. */ int (*finish)(kr_layer_t *ctx); - /** Processing an answer from upstream or the answer to the request. + /** Process an answer from upstream or from cache. * Lua API: call is omitted iff (state & KR_STATE_FAIL). */ int (*consume)(kr_layer_t *ctx, knot_pkt_t *pkt); diff --git a/lib/utils.h b/lib/utils.h index 61127ce0b..f806c8ff8 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -230,7 +230,7 @@ static inline uint64_t kr_rand_bytes(unsigned int size) kr_rnd_buffered(data, size); /* I would have liked to dump the random data into a size_t directly, * but that would work well only on little-endian machines, - * so intsead I hope that the compiler will optimize this out. + * so instead I hope that the compiler will optimize this out. * (Tested via reading assembly from usual gcc -O2 setup.) * Alternatively we could waste more rnd bytes, but that seemed worse. */ result = 0; -- 2.47.2