C++ warning fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1438 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
68c885ebe1
commit
c69ef430ee
@ -877,9 +877,9 @@ etoken_card_ctl(struct sc_card *card, unsigned long cmd, void *ptr)
|
||||
return etoken_generate_key(card,
|
||||
(struct sc_cardctl_etoken_genkey_info *) ptr);
|
||||
case SC_CARDCTL_LIFECYCLE_GET:
|
||||
return etoken_lifecycle_get(card, ptr);
|
||||
return etoken_lifecycle_get(card, (int *) ptr);
|
||||
case SC_CARDCTL_LIFECYCLE_SET:
|
||||
return etoken_lifecycle_set(card, ptr);
|
||||
return etoken_lifecycle_set(card, (int *) ptr);
|
||||
}
|
||||
return SC_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ static int append_ex_data(sc_card_t *card, sc_starcos_ex_data_t *in_dat)
|
||||
sc_starcos_ex_data_t *tmp = (sc_starcos_ex_data_t *)card->drv_data,
|
||||
*new_dat;
|
||||
|
||||
new_dat = malloc(sizeof(*new_dat));
|
||||
new_dat = (sc_starcos_ex_data_t *) malloc(sizeof(*new_dat));
|
||||
if (!new_dat)
|
||||
return SC_ERROR_INTERNAL;
|
||||
new_dat->next = NULL;
|
||||
@ -215,7 +215,7 @@ static int starcos_init(struct sc_card *card)
|
||||
starcos_sec_data_t *sec_data;
|
||||
sc_starcos_ex_data_t tmp_data;
|
||||
|
||||
sec_data = malloc(sizeof(starcos_sec_data_t));
|
||||
sec_data = (starcos_sec_data_t *) malloc(sizeof(starcos_sec_data_t));
|
||||
if (!sec_data)
|
||||
return SC_ERROR_OUT_OF_MEMORY;
|
||||
memset(sec_data, 0, sizeof(starcos_sec_data_t));
|
||||
@ -865,7 +865,7 @@ static int starcos_set_security_env(struct sc_card *card,
|
||||
algID = env->algorithm_ref & 0xFF;
|
||||
ex_dat.key = SC_STARCOS_EX_KEY(SC_STARCOS_KEY_ATTR, keyID);
|
||||
if (!get_ex_data(card, &ex_dat))
|
||||
key_attr = ex_dat.data;
|
||||
key_attr = (struct sc_cardctl_starcos_key_attr_st *) ex_dat.data;
|
||||
|
||||
if (env->operation == SC_SEC_OPERATION_SIGN && key_attr &&
|
||||
key_attr->flag == SC_SEC_OPERATION_AUTHENTICATE)
|
||||
|
@ -204,7 +204,7 @@ int print_file(struct sc_card *card, const struct sc_file *file, const struct sc
|
||||
if (file->ef_structure == SC_FILE_EF_TRANSPARENT) {
|
||||
unsigned char *buf;
|
||||
|
||||
if (!(buf = malloc(file->size))) {
|
||||
if (!(buf = (unsigned char *) malloc(file->size))) {
|
||||
fprintf(stderr, "out of memory");
|
||||
return 1;
|
||||
}
|
||||
|
@ -1064,7 +1064,7 @@ get_pin_callback(struct sc_profile *profile,
|
||||
struct secret *s = &opt_secrets[n];
|
||||
|
||||
if (sc_pkcs15_compare_id(&info->auth_id, &s->id)) {
|
||||
secret = s->key;
|
||||
secret = (char *) s->key;
|
||||
len = s->len;
|
||||
break;
|
||||
}
|
||||
|
@ -631,7 +631,7 @@ int unblock_pin(void)
|
||||
return 2;
|
||||
|
||||
if (opt_pin)
|
||||
pin = opt_pin;
|
||||
pin = (u8 *) opt_pin;
|
||||
else
|
||||
while (1) {
|
||||
u8 *pin2;
|
||||
@ -671,7 +671,7 @@ int change_pin(void)
|
||||
int r;
|
||||
|
||||
if (opt_pin)
|
||||
pincode=opt_pin;
|
||||
pincode = (u8 *) opt_pin;
|
||||
else
|
||||
pincode = get_pin("Enter old PIN", &pinfo);
|
||||
if (pincode == NULL)
|
||||
@ -681,7 +681,7 @@ int change_pin(void)
|
||||
return 2;
|
||||
}
|
||||
if (opt_newpin)
|
||||
newpin = opt_newpin;
|
||||
newpin = (u8 *) opt_newpin;
|
||||
else
|
||||
while (1) {
|
||||
u8 *newpin2;
|
||||
|
Loading…
Reference in New Issue
Block a user