Avoid problems with Doxygen by adding warn_unused_result attribute at the end of method signatures

This commit is contained in:
Tobias Brunner
2012-08-11 16:48:09 +02:00
parent 2c93a214aa
commit 3b891b9e5b
9 changed files with 57 additions and 61 deletions
+3 -4
View File
@@ -47,9 +47,8 @@ struct aead_t {
* @param encrypted allocated encryption result * @param encrypted allocated encryption result
* @return TRUE if successfully encrypted * @return TRUE if successfully encrypted
*/ */
__attribute__((warn_unused_result))
bool (*encrypt)(aead_t *this, chunk_t plain, chunk_t assoc, chunk_t iv, bool (*encrypt)(aead_t *this, chunk_t plain, chunk_t assoc, chunk_t iv,
chunk_t *encrypted); chunk_t *encrypted) __attribute__((warn_unused_result));
/** /**
* Decrypt and verify data, verify associated data. * Decrypt and verify data, verify associated data.
@@ -102,8 +101,8 @@ struct aead_t {
* @param key encryption and authentication key * @param key encryption and authentication key
* @return TRUE if key set successfully * @return TRUE if key set successfully
*/ */
__attribute__((warn_unused_result)) bool (*set_key)(aead_t *this,
bool (*set_key)(aead_t *this, chunk_t key); chunk_t key) __attribute__((warn_unused_result));
/** /**
* Destroy a aead_t. * Destroy a aead_t.
+4 -6
View File
@@ -92,9 +92,8 @@ struct crypter_t {
* @param encrypted chunk to allocate encrypted data, or NULL * @param encrypted chunk to allocate encrypted data, or NULL
* @return TRUE if encryption successful * @return TRUE if encryption successful
*/ */
__attribute__((warn_unused_result))
bool (*encrypt)(crypter_t *this, chunk_t data, chunk_t iv, bool (*encrypt)(crypter_t *this, chunk_t data, chunk_t iv,
chunk_t *encrypted); chunk_t *encrypted) __attribute__((warn_unused_result));
/** /**
* Decrypt a chunk of data and allocate space for the decrypted value. * Decrypt a chunk of data and allocate space for the decrypted value.
@@ -108,9 +107,8 @@ struct crypter_t {
* @param encrypted chunk to allocate decrypted data, or NULL * @param encrypted chunk to allocate decrypted data, or NULL
* @return TRUE if decryption successful * @return TRUE if decryption successful
*/ */
__attribute__((warn_unused_result))
bool (*decrypt)(crypter_t *this, chunk_t data, chunk_t iv, bool (*decrypt)(crypter_t *this, chunk_t data, chunk_t iv,
chunk_t *decrypted); chunk_t *decrypted) __attribute__((warn_unused_result));
/** /**
* Get the block size of the crypto algorithm. * Get the block size of the crypto algorithm.
@@ -149,8 +147,8 @@ struct crypter_t {
* @param key key to set * @param key key to set
* @return TRUE if key set successfully * @return TRUE if key set successfully
*/ */
__attribute__((warn_unused_result)) bool (*set_key)(crypter_t *this,
bool (*set_key) (crypter_t *this, chunk_t key); chunk_t key) __attribute__((warn_unused_result));
/** /**
* Destroys a crypter_t object. * Destroys a crypter_t object.
+5 -6
View File
@@ -87,8 +87,8 @@ struct hasher_t {
* @param hash pointer where the hash will be written * @param hash pointer where the hash will be written
* @return TRUE if hash created successfully * @return TRUE if hash created successfully
*/ */
__attribute__((warn_unused_result)) bool (*get_hash)(hasher_t *this, chunk_t data,
bool (*get_hash) (hasher_t *this, chunk_t data, u_int8_t *hash); u_int8_t *hash) __attribute__((warn_unused_result));
/** /**
* Hash data and allocate space for the hash. * Hash data and allocate space for the hash.
@@ -101,8 +101,8 @@ struct hasher_t {
* @param hash chunk which will hold allocated hash * @param hash chunk which will hold allocated hash
* @return TRUE if hash allocated successfully * @return TRUE if hash allocated successfully
*/ */
__attribute__((warn_unused_result)) bool (*allocate_hash)(hasher_t *this, chunk_t data,
bool (*allocate_hash) (hasher_t *this, chunk_t data, chunk_t *hash); chunk_t *hash) __attribute__((warn_unused_result));
/** /**
* Get the size of the resulting hash. * Get the size of the resulting hash.
@@ -116,8 +116,7 @@ struct hasher_t {
* *
* @return TRUE if hasher reset successfully * @return TRUE if hasher reset successfully
*/ */
__attribute__((warn_unused_result)) bool (*reset)(hasher_t *this) __attribute__((warn_unused_result));
bool (*reset) (hasher_t *this);
/** /**
* Destroys a hasher object. * Destroys a hasher object.
+4 -4
View File
@@ -46,8 +46,8 @@ struct mac_t {
* @param out pointer where the generated bytes will be written * @param out pointer where the generated bytes will be written
* @return TRUE if mac generated successfully * @return TRUE if mac generated successfully
*/ */
__attribute__((warn_unused_result)) bool (*get_mac)(mac_t *this, chunk_t data,
bool (*get_mac)(mac_t *this, chunk_t data, u_int8_t *out); u_int8_t *out) __attribute__((warn_unused_result));
/** /**
* Get the size of the resulting MAC. * Get the size of the resulting MAC.
@@ -64,8 +64,8 @@ struct mac_t {
* @param key key to set * @param key key to set
* @return TRUE if key set successfully * @return TRUE if key set successfully
*/ */
__attribute__((warn_unused_result)) bool (*set_key)(mac_t *this,
bool (*set_key) (mac_t *this, chunk_t key); chunk_t key) __attribute__((warn_unused_result));
/** /**
* Destroys a mac_t object. * Destroys a mac_t object.
+4 -4
View File
@@ -37,8 +37,8 @@ struct nonce_gen_t {
* @param buffer pointer where the generated nonce will be written * @param buffer pointer where the generated nonce will be written
* @return TRUE if nonce allocation was succesful, FALSE otherwise * @return TRUE if nonce allocation was succesful, FALSE otherwise
*/ */
__attribute__((warn_unused_result)) bool (*get_nonce)(nonce_gen_t *this, size_t size,
bool (*get_nonce) (nonce_gen_t *this, size_t size, u_int8_t *buffer); u_int8_t *buffer) __attribute__((warn_unused_result));
/** /**
* Generates a nonce and allocates space for it. * Generates a nonce and allocates space for it.
@@ -47,8 +47,8 @@ struct nonce_gen_t {
* @param chunk chunk which will hold the generated nonce * @param chunk chunk which will hold the generated nonce
* @return TRUE if nonce allocation was succesful, FALSE otherwise * @return TRUE if nonce allocation was succesful, FALSE otherwise
*/ */
__attribute__((warn_unused_result)) bool (*allocate_nonce)(nonce_gen_t *this, size_t size,
bool (*allocate_nonce) (nonce_gen_t *this, size_t size, chunk_t *chunk); chunk_t *chunk) __attribute__((warn_unused_result));
/** /**
* Destroys a nonce generator object. * Destroys a nonce generator object.
+4 -4
View File
@@ -38,8 +38,8 @@ struct prf_plus_t {
* @param buffer pointer where the generated bytes will be written * @param buffer pointer where the generated bytes will be written
* @return TRUE if bytes generated successfully * @return TRUE if bytes generated successfully
*/ */
__attribute__((warn_unused_result)) bool (*get_bytes)(prf_plus_t *this, size_t length,
bool (*get_bytes) (prf_plus_t *this, size_t length, u_int8_t *buffer); u_int8_t *buffer) __attribute__((warn_unused_result));
/** /**
* Allocate pseudo random bytes. * Allocate pseudo random bytes.
@@ -48,8 +48,8 @@ struct prf_plus_t {
* @param chunk chunk which will hold generated bytes * @param chunk chunk which will hold generated bytes
* @return TRUE if bytes allocated successfully * @return TRUE if bytes allocated successfully
*/ */
__attribute__((warn_unused_result)) bool (*allocate_bytes)(prf_plus_t *this, size_t length,
bool (*allocate_bytes) (prf_plus_t *this, size_t length, chunk_t *chunk); chunk_t *chunk) __attribute__((warn_unused_result));
/** /**
* Destroys a prf_plus_t object. * Destroys a prf_plus_t object.
+6 -6
View File
@@ -79,8 +79,8 @@ struct prf_t {
* @param buffer pointer where the generated bytes will be written * @param buffer pointer where the generated bytes will be written
* @return TRUE if bytes generated successfully * @return TRUE if bytes generated successfully
*/ */
__attribute__((warn_unused_result)) bool (*get_bytes)(prf_t *this, chunk_t seed,
bool (*get_bytes) (prf_t *this, chunk_t seed, u_int8_t *buffer); u_int8_t *buffer) __attribute__((warn_unused_result));
/** /**
* Generates pseudo random bytes and allocate space for them. * Generates pseudo random bytes and allocate space for them.
@@ -89,8 +89,8 @@ struct prf_t {
* @param chunk chunk which will hold generated bytes * @param chunk chunk which will hold generated bytes
* @return TRUE if bytes allocated and generated successfully * @return TRUE if bytes allocated and generated successfully
*/ */
__attribute__((warn_unused_result)) bool (*allocate_bytes)(prf_t *this, chunk_t seed,
bool (*allocate_bytes) (prf_t *this, chunk_t seed, chunk_t *chunk); chunk_t *chunk) __attribute__((warn_unused_result));
/** /**
* Get the block size of this prf_t object. * Get the block size of this prf_t object.
@@ -115,8 +115,8 @@ struct prf_t {
* @param key key to set * @param key key to set
* @return TRUE if key set successfully * @return TRUE if key set successfully
*/ */
__attribute__((warn_unused_result)) bool (*set_key)(prf_t *this,
bool (*set_key) (prf_t *this, chunk_t key); chunk_t key) __attribute__((warn_unused_result));
/** /**
* Destroys a prf object. * Destroys a prf object.
+4 -4
View File
@@ -56,8 +56,8 @@ struct rng_t {
* @param buffer pointer where the generated bytes will be written * @param buffer pointer where the generated bytes will be written
* @return TRUE if bytes successfully written * @return TRUE if bytes successfully written
*/ */
__attribute__((warn_unused_result)) bool (*get_bytes)(rng_t *this, size_t len,
bool (*get_bytes) (rng_t *this, size_t len, u_int8_t *buffer); u_int8_t *buffer) __attribute__((warn_unused_result));
/** /**
* Generates random bytes and allocate space for them. * Generates random bytes and allocate space for them.
@@ -66,8 +66,8 @@ struct rng_t {
* @param chunk chunk which will hold generated bytes * @param chunk chunk which will hold generated bytes
* @return TRUE if allocation succeeded * @return TRUE if allocation succeeded
*/ */
__attribute__((warn_unused_result)) bool (*allocate_bytes)(rng_t *this, size_t len,
bool (*allocate_bytes) (rng_t *this, size_t len, chunk_t *chunk); chunk_t *chunk) __attribute__((warn_unused_result));
/** /**
* Destroys a rng object. * Destroys a rng object.
+6 -6
View File
@@ -93,8 +93,8 @@ struct signer_t {
* @param buffer pointer where the signature will be written * @param buffer pointer where the signature will be written
* @return TRUE if signature created successfully * @return TRUE if signature created successfully
*/ */
__attribute__((warn_unused_result)) bool (*get_signature)(signer_t *this, chunk_t data,
bool (*get_signature) (signer_t *this, chunk_t data, u_int8_t *buffer); u_int8_t *buffer) __attribute__((warn_unused_result));
/** /**
* Generate a signature and allocate space for it. * Generate a signature and allocate space for it.
@@ -106,8 +106,8 @@ struct signer_t {
* @param chunk chunk which will hold the allocated signature * @param chunk chunk which will hold the allocated signature
* @return TRUE if signature allocated successfully * @return TRUE if signature allocated successfully
*/ */
__attribute__((warn_unused_result)) bool (*allocate_signature)(signer_t *this, chunk_t data,
bool (*allocate_signature) (signer_t *this, chunk_t data, chunk_t *chunk); chunk_t *chunk) __attribute__((warn_unused_result));
/** /**
* Verify a signature. * Verify a signature.
@@ -142,8 +142,8 @@ struct signer_t {
* @param key key to set * @param key key to set
* @return TRUE if key set * @return TRUE if key set
*/ */
__attribute__((warn_unused_result)) bool (*set_key)(signer_t *this,
bool (*set_key) (signer_t *this, chunk_t key); chunk_t key) __attribute__((warn_unused_result));
/** /**
* Destroys a signer_t object. * Destroys a signer_t object.