- applied some -W's from strongswan

- fixed that warnings
This commit is contained in:
Martin Willi
2006-05-09 07:34:25 +00:00
parent 24953b5e18
commit f768bdc3f3
62 changed files with 147 additions and 145 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ static logger_t *logger = NULL;
/**
* initializes the ASN.1 logger
*/
static void asn1_init_logger()
static void asn1_init_logger(void)
{
if (logger == NULL)
logger = logger_manager->get_logger(logger_manager, ASN1);
+4 -4
View File
@@ -34,7 +34,7 @@ static logger_t *logger = NULL;
/**
* initializes the PEM logger
*/
static void pem_init_logger()
static void pem_init_logger(void)
{
if (logger == NULL)
logger = logger_manager->get_logger(logger_manager, ASN1);
@@ -89,7 +89,7 @@ static bool find_boundary(const char* tag, chunk_t *line)
/*
* decrypts a DES-EDE-CBC encrypted data block
*/
static err_t pem_decrypt(chunk_t *blob, chunk_t *iv, const char *passphrase)
static err_t pem_decrypt(chunk_t *blob, chunk_t *iv, char *passphrase)
{
hasher_t *hasher;
crypter_t *crypter;
@@ -144,7 +144,7 @@ static err_t pem_decrypt(chunk_t *blob, chunk_t *iv, const char *passphrase)
* RFC 1421 Privacy Enhancement for Electronic Mail, February 1993
* RFC 934 Message Encapsulation, January 1985
*/
err_t pem_to_bin(chunk_t *blob, const char *passphrase, bool *pgp)
err_t pem_to_bin(chunk_t *blob, char *passphrase, bool *pgp)
{
typedef enum {
PEM_PRE = 0,
@@ -285,7 +285,7 @@ err_t pem_to_bin(chunk_t *blob, const char *passphrase, bool *pgp)
/* load a coded key or certificate file with autodetection
* of binary DER or base64 PEM ASN.1 formats and armored PGP format
*/
bool pem_asn1_load_file(const char *filename, const char *passphrase,
bool pem_asn1_load_file(const char *filename, char *passphrase,
const char *type, chunk_t *blob, bool *pgp)
{
err_t ugh = NULL;
+2 -2
View File
@@ -19,9 +19,9 @@
#include <types.h>
err_t pem_to_bin(chunk_t *blob, const char *passphrase, bool *pgp);
err_t pem_to_bin(chunk_t *blob, char *passphrase, bool *pgp);
bool pem_asn1_load_file(const char *filename, const char *passphrase,
bool pem_asn1_load_file(const char *filename, char *passphrase,
const char *type, chunk_t *blob, bool *pgp);
#endif /*PEM_H_*/
+73 -69
View File
@@ -33,22 +33,23 @@ static const char *badch(const char *, int, char *, size_t);
#define BADCH3 (-7) /* invalid character 3 */
#define BADOFF(code) (BADCH0-(code))
/*
- ttodatav - convert text to data, with verbose error reports
/**
* @brief convert text to data, with verbose error reports
*
* If some of this looks slightly odd, it's because it has changed
* repeatedly (from the original atodata()) without a major rewrite.
*
* @param src
* @param srclen 0 means apply strlen()
* @param base 0 means figure it out
* @param dst need not be valid if dstlen is 0
* @param dstlen
* @param lenp where to record length (NULL is nowhere)
* @param errp error buffer
* @param flags
* @return NULL on success, else literal or errp
*/
const char * /* NULL on success, else literal or errp */
ttodatav(src, srclen, base, dst, dstlen, lenp, errp, errlen, flags)
const char *src;
size_t srclen; /* 0 means apply strlen() */
int base; /* 0 means figure it out */
char *dst; /* need not be valid if dstlen is 0 */
size_t dstlen;
size_t *lenp; /* where to record length (NULL is nowhere) */
char *errp; /* error buffer */
size_t errlen;
unsigned int flags;
const char *ttodatav(const char *src, size_t srclen, int base, char *dst, size_t dstlen, size_t *lenp, char *errp, size_t errlen, unsigned int flags)
{
size_t ingroup; /* number of input bytes converted at once */
char buf[4]; /* output from conversion */
@@ -166,32 +167,35 @@ unsigned int flags;
return NULL;
}
/*
- ttodata - convert text to data
/**
* @brief ttodata - convert text to data
*
* @param src
* @param srclen 0 means apply strlen()
* @param base 0 means figure it out
* @param dst need not be valid if dstlen is 0
* @param dstlen
* @param lenp where to record length (NULL is nowhere)
* @return NULL on success, else literal
*/
const char * /* NULL on success, else literal */
ttodata(src, srclen, base, dst, dstlen, lenp)
const char *src;
size_t srclen; /* 0 means apply strlen() */
int base; /* 0 means figure it out */
char *dst; /* need not be valid if dstlen is 0 */
size_t dstlen;
size_t *lenp; /* where to record length (NULL is nowhere) */
const char *ttodata(const char *src, size_t srclen, int base, char *dst, size_t dstlen, size_t *lenp)
{
return ttodatav(src, srclen, base, dst, dstlen, lenp, (char *)NULL,
(size_t)0, TTODATAV_SPACECOUNTS);
}
/*
- atodata - convert ASCII to data
/**
* @brief atodata - convert ASCII to data
*
* backward-compatibility interface
*
* @param src
* @param srclen
* @param dst
* @param dstlen
* @return 0 for failure, true length for success
*/
size_t /* 0 for failure, true length for success */
atodata(src, srclen, dst, dstlen)
const char *src;
size_t srclen;
char *dst;
size_t dstlen;
size_t atodata(const char *src, size_t srclen, char *dst, size_t dstlen)
{
size_t len;
const char *err;
@@ -202,29 +206,25 @@ size_t dstlen;
return len;
}
/*
- atobytes - convert ASCII to data bytes
/**
* @brief atobytes - convert ASCII to data bytes
*
* another backward-compatibility interface
*/
const char *
atobytes(src, srclen, dst, dstlen, lenp)
const char *src;
size_t srclen;
char *dst;
size_t dstlen;
size_t *lenp;
const char *atobytes(const char *src, size_t srclen, char *dst, size_t dstlen, size_t *lenp)
{
return ttodata(src, srclen, 0, dst, dstlen, lenp);
}
/*
- unhex - convert two ASCII hex digits to byte
/**
* @brief unhex - convert two ASCII hex digits to byte
*
* @param src known to be full length
* @param dstnumber of result bytes, or error code
* @param dstlen not large enough is a failure
* @return
*/
static int /* number of result bytes, or error code */
unhex(src, dst, dstlen)
const char *src; /* known to be full length */
char *dst;
size_t dstlen; /* not large enough is a failure */
static int unhex(const char *src, char *dst, size_t dstlen)
{
char *p;
unsigned byte;
@@ -252,16 +252,18 @@ size_t dstlen; /* not large enough is a failure */
return 1;
}
/*
- unb64 - convert four ASCII base64 digits to three bytes
/**
* @brief unb64 - convert four ASCII base64 digits to three bytes
*
* Note that a base64 digit group is padded out with '=' if it represents
* less than three bytes: one byte is dd==, two is ddd=, three is dddd.
*
* @param src known to be full length
* @param dst
* @param dstlen
* @return number of result bytes, or error code
*/
static int /* number of result bytes, or error code */
unb64(src, dst, dstlen)
const char *src; /* known to be full length */
char *dst;
size_t dstlen;
static int unb64(const char *src, char *dst, size_t dstlen)
{
char *p;
unsigned byte1;
@@ -316,14 +318,15 @@ size_t dstlen;
return 3;
}
/*
- untext - convert one ASCII character to byte
/**
* @brief untext - convert one ASCII character to byte
*
* @param src known to be full length
* @param dst
* @param dstlen not large enough is a failure
* @return number of result bytes, or error code
*/
static int /* number of result bytes, or error code */
untext(src, dst, dstlen)
const char *src; /* known to be full length */
char *dst;
size_t dstlen; /* not large enough is a failure */
static int untext(const char *src, char *dst, size_t dstlen)
{
if (dstlen < 1)
return SHORT;
@@ -332,18 +335,19 @@ size_t dstlen; /* not large enough is a failure */
return 1;
}
/*
- badch - produce a nice complaint about an unknown character
/**
* @brief badch - produce a nice complaint about an unknown character
*
* If the compiler complains that the array bigenough[] has a negative
* size, that means the TTODATAV_BUF constant has been set too small.
*
* @param src
* @param errcode
* @param errp might be NULL
* @param errlen
* @return literal or errp
*/
static const char * /* literal or errp */
badch(src, errcode, errp, errlen)
const char *src;
int errcode;
char *errp; /* might be NULL */
size_t errlen;
static const char *badch(const char *src, int errcode, char *errp, size_t errlen)
{
static const char pre[] = "unknown character (`";
static const char suf[] = "') in input";
+1 -1
View File
@@ -377,7 +377,7 @@ static void destroy(private_md5_hasher_t *this)
/*
* Described in header.
*/
md5_hasher_t *md5_hasher_create()
md5_hasher_t *md5_hasher_create(void)
{
private_md5_hasher_t *this = malloc_thing(private_md5_hasher_t);
+1 -1
View File
@@ -55,6 +55,6 @@ struct md5_hasher_t {
*
* @ingroup hashers
*/
md5_hasher_t *md5_hasher_create();
md5_hasher_t *md5_hasher_create(void);
#endif /*MD5_HASHER_H_*/
+1 -1
View File
@@ -252,7 +252,7 @@ static void destroy(private_sha1_hasher_t *this)
/*
* Described in header.
*/
sha1_hasher_t *sha1_hasher_create()
sha1_hasher_t *sha1_hasher_create(void)
{
private_sha1_hasher_t *this = malloc_thing(private_sha1_hasher_t);
+1 -1
View File
@@ -55,6 +55,6 @@ struct sha1_hasher_t {
*
* @ingroup hashers
*/
sha1_hasher_t *sha1_hasher_create();
sha1_hasher_t *sha1_hasher_create(void);
#endif /*SHA1_HASHER_H_*/
+2 -2
View File
@@ -170,7 +170,7 @@ static const asn1Object_t privkey_objects[] = {
#define PRIV_KEY_COEFF 9
#define PRIV_KEY_ROOF 16
static private_rsa_private_key_t *rsa_private_key_create_empty();
static private_rsa_private_key_t *rsa_private_key_create_empty(void);
/**
* Implementation of private_rsa_private_key_t.compute_prime.
@@ -546,7 +546,7 @@ static void destroy(private_rsa_private_key_t *this)
/**
* Internal generic constructor
*/
static private_rsa_private_key_t *rsa_private_key_create_empty()
static private_rsa_private_key_t *rsa_private_key_create_empty(void)
{
private_rsa_private_key_t *this = malloc_thing(private_rsa_private_key_t);
+2 -2
View File
@@ -150,7 +150,7 @@ struct rsa_public_key_info_t {
chunk_t public_key;
};
private_rsa_public_key_t *rsa_public_key_create_empty();
private_rsa_public_key_t *rsa_public_key_create_empty(void);
/**
* Implementation of private_rsa_public_key_t.rsaep and private_rsa_public_key_t.rsavp1
@@ -364,7 +364,7 @@ static void destroy(private_rsa_public_key_t *this)
/**
* Generic private constructor
*/
private_rsa_public_key_t *rsa_public_key_create_empty()
private_rsa_public_key_t *rsa_public_key_create_empty(void)
{
private_rsa_public_key_t *this = malloc_thing(private_rsa_public_key_t);
+3 -3
View File
@@ -874,9 +874,9 @@ x509_t *x509_create_from_chunk(chunk_t chunk)
this->public_key = NULL;
this->subject = NULL;
this->issuer = NULL;
this->subjectAltNames = linked_list_create(this->subjectAltNames);
this->issuerAltNames = linked_list_create(this->issuerAltNames);
this->crlDistributionPoints = linked_list_create(this->crlDistributionPoints);
this->subjectAltNames = linked_list_create();
this->issuerAltNames = linked_list_create();
this->crlDistributionPoints = linked_list_create();
/* we do not use a per-instance logger right now, since its not always accessible */
logger = logger_manager->get_logger(logger_manager, ASN1);
+2 -2
View File
@@ -26,7 +26,7 @@
/**
* Called whenever the library is linked from a process
*/
void __attribute__ ((constructor)) library_init()
void __attribute__ ((constructor)) library_init(void)
{
logger_manager_init();
leak_detective_init();
@@ -35,7 +35,7 @@ void __attribute__ ((constructor)) library_init()
/**
* Called whenever the library is unlinked from a process
*/
void __attribute__ ((destructor)) library_cleanup()
void __attribute__ ((destructor)) library_cleanup(void)
{
leak_detective_cleanup();
logger_manager_cleanup();
+1 -1
View File
@@ -261,7 +261,7 @@ static void destroy(private_host_t *this)
/**
* Creates an empty host_t object
*/
static private_host_t *host_create_empty()
static private_host_t *host_create_empty(void)
{
private_host_t *this = malloc_thing(private_host_t);
+2 -2
View File
@@ -248,7 +248,7 @@ struct private_identification_t {
id_type_t type;
};
static private_identification_t *identification_create();
static private_identification_t *identification_create(void);
/**
@@ -952,7 +952,7 @@ static void destroy(private_identification_t *this)
/**
* Generic constructor used for the other constructors.
*/
static private_identification_t *identification_create()
static private_identification_t *identification_create(void)
{
private_identification_t *this = malloc_thing(private_identification_t);
+1 -1
View File
@@ -197,7 +197,7 @@ struct linked_list_t {
*
* @ingroup utils
*/
linked_list_t *linked_list_create();
linked_list_t *linked_list_create(void);
#endif /*LINKED_LIST_H_*/
+2 -2
View File
@@ -149,12 +149,12 @@ extern logger_manager_t *logger_manager;
* Initialize the logger manager with all its logger.
* Has to be called before logger_manager is accessed.
*/
void logger_manager_init();
void logger_manager_init(void);
/**
* Free any resources hold by the logger manager. Do
* not access logger_manager after this call.
*/
void logger_manager_cleanup();
void logger_manager_cleanup(void);
#endif /*LOGGER_MANAGER_H_*/
+1 -1
View File
@@ -105,6 +105,6 @@ struct randomizer_t {
*
* @ingroup utils
*/
randomizer_t *randomizer_create();
randomizer_t *randomizer_create(void);
#endif /*RANDOMIZER_H_*/