From: Vladimír Čunát Date: Tue, 24 Sep 2019 07:41:13 +0000 (+0200) Subject: lib/*: improve some comments X-Git-Tag: v4.3.0~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b76929cfd73d339b2567843be0a7b817b935f954;p=thirdparty%2Fknot-resolver.git lib/*: improve some comments --- 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;