Warning fixes from Christos Zoulas
- shadowed variables - signed/unsigned confusion - const lossage - incomplete structure initializations - unused code
This commit is contained in:
@@ -152,7 +152,7 @@ p11_rsa_private_encrypt(int flen,
|
||||
}
|
||||
|
||||
ret = P11FUNC(p11rsa->p, Sign,
|
||||
(session, (CK_BYTE *)from, flen, to, &ck_sigsize));
|
||||
(session, (CK_BYTE *)(intptr_t)from, flen, to, &ck_sigsize));
|
||||
p11_put_session(p11rsa->p, p11rsa->slot, session);
|
||||
if (ret != CKR_OK)
|
||||
return -1;
|
||||
@@ -190,7 +190,7 @@ p11_rsa_private_decrypt(int flen, const unsigned char *from, unsigned char *to,
|
||||
}
|
||||
|
||||
ret = P11FUNC(p11rsa->p, Decrypt,
|
||||
(session, (CK_BYTE *)from, flen, to, &ck_sigsize));
|
||||
(session, (CK_BYTE *)(intptr_t)from, flen, to, &ck_sigsize));
|
||||
p11_put_session(p11rsa->p, p11rsa->slot, session);
|
||||
if (ret != CKR_OK)
|
||||
return -1;
|
||||
@@ -878,7 +878,8 @@ p11_init(hx509_context context,
|
||||
|
||||
{
|
||||
CK_SLOT_ID_PTR slot_ids;
|
||||
int i, num_tokens = 0;
|
||||
int num_tokens = 0;
|
||||
size_t i;
|
||||
|
||||
slot_ids = malloc(p->num_slots * sizeof(*slot_ids));
|
||||
if (slot_ids == NULL) {
|
||||
@@ -933,7 +934,7 @@ p11_init(hx509_context context,
|
||||
static void
|
||||
p11_release_module(struct p11_module *p)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
if (p->ref == 0)
|
||||
_hx509_abort("pkcs11 ref to low");
|
||||
@@ -957,7 +958,7 @@ p11_release_module(struct p11_module *p)
|
||||
free(p->slot[i].mechs.list);
|
||||
|
||||
if (p->slot[i].mechs.infos) {
|
||||
int j;
|
||||
size_t j;
|
||||
|
||||
for (j = 0 ; j < p->slot[i].mechs.num ; j++)
|
||||
free(p->slot[i].mechs.infos[j]);
|
||||
@@ -981,7 +982,7 @@ static int
|
||||
p11_free(hx509_certs certs, void *data)
|
||||
{
|
||||
struct p11_module *p = data;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < p->num_slots; i++) {
|
||||
if (p->slot[i].certs)
|
||||
@@ -1002,7 +1003,8 @@ p11_iter_start(hx509_context context,
|
||||
{
|
||||
struct p11_module *p = data;
|
||||
struct p11_cursor *c;
|
||||
int ret, i;
|
||||
int ret;
|
||||
size_t i;
|
||||
|
||||
c = malloc(sizeof(*c));
|
||||
if (c == NULL) {
|
||||
@@ -1103,7 +1105,7 @@ p11_printinfo(hx509_context context,
|
||||
void *ctx)
|
||||
{
|
||||
struct p11_module *p = data;
|
||||
int i, j;
|
||||
size_t i, j;
|
||||
|
||||
_hx509_pi_printf(func, ctx, "pkcs11 driver with %d slot%s",
|
||||
p->num_slots, p->num_slots > 1 ? "s" : "");
|
||||
|
Reference in New Issue
Block a user