From: Nikos Mavrogiannopoulos Date: Wed, 24 Sep 2014 08:20:54 +0000 (+0200) Subject: use unsigned types in prototypes X-Git-Tag: gnutls_3_4_0~875 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=139a995ee83f4e321af78a32db1c2ef2991cd5f4;p=thirdparty%2Fgnutls.git use unsigned types in prototypes --- diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index 5309f25c84..1a60974cfd 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -1163,7 +1163,7 @@ gnutls_certificate_set_x509_key(gnutls_certificate_credentials_t res, */ int gnutls_certificate_get_x509_key(gnutls_certificate_credentials_t res, - int index, + unsigned index, gnutls_x509_privkey_t *key) { if (index >= res->ncerts) { @@ -1201,11 +1201,12 @@ gnutls_certificate_get_x509_key(gnutls_certificate_credentials_t res, */ int gnutls_certificate_get_x509_crt(gnutls_certificate_credentials_t res, - int index, + unsigned index, gnutls_x509_crt_t **crt_list, - int *crt_list_size) + unsigned *crt_list_size) { - int ret, i; + int ret; + unsigned i; if (index >= res->ncerts) { gnutls_assert(); diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in index a03e1f9d72..71b092c1bc 100644 --- a/lib/includes/gnutls/gnutls.h.in +++ b/lib/includes/gnutls/gnutls.h.in @@ -1435,12 +1435,12 @@ int gnutls_certificate_set_x509_crl(gnutls_certificate_credentials_t res, int crl_list_size); int gnutls_certificate_get_x509_key(gnutls_certificate_credentials_t res, - int index, + unsigned index, gnutls_x509_privkey_t *key); int gnutls_certificate_get_x509_crt(gnutls_certificate_credentials_t res, - int index, + unsigned index, gnutls_x509_crt_t **crt_list, - int *crt_list_size); + unsigned *crt_list_size); /* OCSP status request extension, RFC 6066 */ typedef int (*gnutls_status_request_ocsp_func) diff --git a/lib/includes/gnutls/openpgp.h b/lib/includes/gnutls/openpgp.h index b7b64ad788..cdd3f80999 100644 --- a/lib/includes/gnutls/openpgp.h +++ b/lib/includes/gnutls/openpgp.h @@ -334,13 +334,13 @@ int gnutls_certificate_set_openpgp_key int gnutls_certificate_get_openpgp_key(gnutls_certificate_credentials_t res, - int index, + unsigned index, gnutls_openpgp_privkey_t *key); int gnutls_certificate_get_openpgp_crt(gnutls_certificate_credentials_t res, - int index, + unsigned index, gnutls_openpgp_crt_t **crt_list, - int *crt_list_size); + unsigned *crt_list_size); int gnutls_certificate_set_openpgp_key_file diff --git a/lib/openpgp/gnutls_openpgp.c b/lib/openpgp/gnutls_openpgp.c index bbb101ec8a..d609a55de1 100644 --- a/lib/openpgp/gnutls_openpgp.c +++ b/lib/openpgp/gnutls_openpgp.c @@ -191,7 +191,7 @@ gnutls_certificate_set_openpgp_key(gnutls_certificate_credentials_t res, */ int gnutls_certificate_get_openpgp_key(gnutls_certificate_credentials_t res, - int index, + unsigned index, gnutls_openpgp_privkey_t *key) { if (index >= res->ncerts) { @@ -230,11 +230,12 @@ gnutls_certificate_get_openpgp_key(gnutls_certificate_credentials_t res, */ int gnutls_certificate_get_openpgp_crt(gnutls_certificate_credentials_t res, - int index, + unsigned index, gnutls_openpgp_crt_t **crt_list, - int *crt_list_size) + unsigned *crt_list_size) { - int ret, i; + int ret; + unsigned i; if (index >= res->ncerts) { gnutls_assert(); diff --git a/tests/openpgp-auth.c b/tests/openpgp-auth.c index 82e37126c2..bbbd2a85ec 100644 --- a/tests/openpgp-auth.c +++ b/tests/openpgp-auth.c @@ -64,15 +64,15 @@ int key_recv_func(gnutls_session_t session, const unsigned char *keyfpr, return 0; } +static void check_loaded_key(gnutls_certificate_credentials_t cred) { int err; gnutls_openpgp_privkey_t key; gnutls_openpgp_crt_t *crts; - int n_crts; - gnutls_datum_t datum; + unsigned n_crts; gnutls_openpgp_keyid_t keyid; - int i; + unsigned i; /* check that the getter functions for openpgp keys of * gnutls_certificate_credentials_t work and deliver the diff --git a/tests/x509cert.c b/tests/x509cert.c index 4e07ae5661..670d4d23f6 100644 --- a/tests/x509cert.c +++ b/tests/x509cert.c @@ -167,12 +167,12 @@ void doit(void) gnutls_x509_privkey_t get_key; gnutls_x509_crt_t *get_crts; - int n_get_crts; + unsigned n_get_crts; gnutls_datum_t get_datum; gnutls_x509_trust_list_t trust_list; gnutls_x509_trust_list_iter_t trust_iter; gnutls_x509_crt_t get_ca_crt; - int n_get_ca_crts; + unsigned n_get_ca_crts; /* this must be called once in the program */