[PATCH 1/2] Documentation: No argument of ALLOC_GROW should have side-effects
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Oct 8, 2010, 16:46 UTC
- Message-ID
- <20101008164659.GC9212@burratino>
- In-Reply-To
- <20101008164536.GB9212@burratino>
The explanatory comment before the definition of ALLOC_GROW carefully lists arguments that will be used more than once and thus cannot have side-effects; a lazy reader might conclude that the arguments not listed are used only once and side effects safe.
Correct it to list all three arguments, avoiding this confusion.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> --- cache.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cache.h b/cache.h index 2ef2fa3..23d6d45 100644 --- a/cache.h +++ b/cache.h @@ -438,7 +438,7 @@ extern int init_db(const char *template_dir, unsigned int flags); * at least 'nr' entries; the number of entries currently allocated * is 'alloc', using the standard growing factor alloc_nr() macro. * - * DO NOT USE any expression with side-effect for 'x' or 'alloc'. + * DO NOT USE any expression with side-effect for 'x', 'nr', or 'alloc'. */ #define ALLOC_GROW(x, nr, alloc) \ do { \
-- 1.7.2.3