From 2c93a214aa15b0ea93673bceb537d9782e2140eb Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Sat, 11 Aug 2012 16:22:03 +0200 Subject: [PATCH] Add warn_unused_result attributes to rng_(get|allocate)_bytes_not_zero Also fixed Doxygen comments. --- src/libstrongswan/crypto/rngs/rng.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libstrongswan/crypto/rngs/rng.h b/src/libstrongswan/crypto/rngs/rng.h index c72509b..4a1a285 100644 --- a/src/libstrongswan/crypto/rngs/rng.h +++ b/src/libstrongswan/crypto/rngs/rng.h @@ -82,10 +82,11 @@ struct rng_t { * @param rng rng_t object * @param len number of bytes to get * @param buffer pointer where the generated bytes will be written - * @param all TRUE if all bytes have to be non-zero + * @param all TRUE if all bytes have to be non-zero, FALSE for first * @return TRUE if bytes successfully written */ -bool rng_get_bytes_not_zero(rng_t *rng, size_t len, u_int8_t *buffer, bool all); +bool rng_get_bytes_not_zero(rng_t *rng, size_t len, u_int8_t *buffer, + bool all) __attribute__((warn_unused_result)); /** * Wrapper around rng_t.allocate_bytes() ensuring that either all bytes or at @@ -93,12 +94,12 @@ bool rng_get_bytes_not_zero(rng_t *rng, size_t len, u_int8_t *buffer, bool all); * * @param rng rng_t object * @param len number of bytes to get - * @param buffer pointer where the generated bytes will be written - * @param all TRUE if all bytes have to be non-zero + * @param chunk chunk that stores the generated bytes (allocated) + * @param all TRUE if all bytes have to be non-zero, FALSE for first * @return TRUE if bytes successfully written */ bool rng_allocate_bytes_not_zero(rng_t *rng, size_t len, chunk_t *chunk, - bool all); + bool all) __attribute__((warn_unused_result)); -- 2.7.4