Minor changes to get rid of compiler warnings for various OS's

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@220 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aet 2002-02-24 16:50:29 +00:00
parent 2adde8d501
commit 1f4e5c4b6d
6 changed files with 16 additions and 14 deletions

View File

@ -235,7 +235,7 @@ match_path(struct sc_card *card, unsigned short int **pathptr, size_t *pathlen,
}
static void
ac_to_acl(u_int16_t ac, struct sc_file *file, unsigned int op)
ac_to_acl(unsigned short int ac, struct sc_file *file, unsigned int op)
{
unsigned int npins, pin;
@ -828,7 +828,7 @@ static int
gpk_verify_pin(struct sc_card *card, int ref,
const u8 *pin, size_t pinlen, int *tries_left)
{
u_int8_t buffer[8];
u8 buffer[8];
struct sc_apdu apdu;
int r;
@ -896,7 +896,7 @@ gpk_erase_card(struct sc_card *card)
{
struct gpk_private_data *priv = OPSDATA(card);
struct sc_apdu apdu;
u_int8_t offset;
u8 offset;
int r;
SC_FUNC_CALLED(card->ctx, 1);

View File

@ -82,7 +82,7 @@ void parse_tokeninfo(struct sc_pkcs15_card *card, const u8 * buf, size_t buflen)
u8 label[128];
int label_len = sizeof(label);
int flags_len = sizeof(card->flags);
struct sc_asn1_entry asn1_toki[9], asn1_tokeninfo[2];
struct sc_asn1_entry asn1_toki[9], asn1_tokeninfo[3];
sc_copy_asn1_entry(c_asn1_toki, asn1_toki);
sc_copy_asn1_entry(c_asn1_tokeninfo, asn1_tokeninfo);
@ -521,7 +521,7 @@ int sc_pkcs15_bind(struct sc_card *card,
}
if (p15card->file_odf == NULL) {
tmppath = p15card->file_app->path;
sc_append_path_id(&tmppath, "\x50\x31", 2);
sc_append_path_id(&tmppath, (const u8 *) "\x50\x31", 2);
} else {
tmppath = p15card->file_odf->path;
sc_file_free(p15card->file_odf);
@ -544,7 +544,7 @@ int sc_pkcs15_bind(struct sc_card *card,
}
if (p15card->file_tokeninfo == NULL) {
tmppath = p15card->file_app->path;
sc_append_path_id(&tmppath, "\x50\x32", 2);
sc_append_path_id(&tmppath, (const u8 *) "\x50\x32", 2);
} else {
tmppath = p15card->file_tokeninfo->path;
sc_file_free(p15card->file_tokeninfo);

View File

@ -44,8 +44,8 @@ gpk_lock(struct sc_card *card, struct sc_file *file, unsigned int op)
static int
gpk_update_pins(struct sc_card *card, struct pin_info *info)
{
u_int8_t buffer[GPK_MAX_PINS * 8], *blk;
u_int8_t temp[16];
u8 buffer[GPK_MAX_PINS * 8], *blk;
u8 temp[16];
unsigned int npins, i, j, tries, cks;
int r;
@ -68,7 +68,7 @@ gpk_update_pins(struct sc_card *card, struct pin_info *info)
blk[2] = 0x8 | (i + 1);
memset(temp, 0, sizeof(temp));
strncpy(temp, info->secret[i], 8);
strncpy((char *) temp, info->secret[i], 8);
blk[4] = (temp[0] << 4) | (temp[1] & 0xF);
blk[5] = (temp[2] << 4) | (temp[3] & 0xF);
blk[6] = (temp[4] << 4) | (temp[5] & 0xF);
@ -236,7 +236,9 @@ gpk_init_app(struct sc_profile *profile, struct sc_card *card)
*/
struct pkcomp {
unsigned char tag;
// BIGNUM * bn;
#if 0
BIGNUM * bn;
#endif
u8 * data;
unsigned int size;
};

View File

@ -178,7 +178,7 @@ main(int argc, char **argv)
/* Read the PKCS15 structure from the card */
r = sc_pkcs15_bind(card, &p15card);
if (r) {
fprintf(stderr, "PKCS#15 initialization failed: %m\n");
fprintf(stderr, "PKCS#15 initialization failed: %s\n", sc_strerror(r));
goto done;
}
if (!opt_quiet)
@ -675,7 +675,7 @@ do_verify_pin(struct sc_profile *pro, unsigned int type, unsigned int reference)
return SC_ERROR_SECURITY_STATUS_NOT_SATISFIED;
}
return sc_verify(card, SC_AC_CHV, reference, pin, strlen(pin), NULL);
return sc_verify(card, SC_AC_CHV, reference, (const u8 *) pin, strlen(pin), NULL);
}
int

View File

@ -855,7 +855,7 @@ do_prkey_reference(int argc, char **argv)
{
struct sc_pkcs15_prkey_info *ki = &parser.cur_prkey->pkcs15;
return get_uint(argv[0], &ki->key_reference);
return get_uint(argv[0], (unsigned int *) &ki->key_reference);
}
static struct command commands[] = {

View File

@ -17,7 +17,7 @@ struct auth_info {
unsigned int id; /* CHV1, KEY0, ... */
unsigned int ref;
size_t key_len;
u_int8_t key[32];
u8 key[32];
};
struct file_info {