From 6d533a1c3d107b34c3964567cbe59b7891a56161 Mon Sep 17 00:00:00 2001 From: aet Date: Mon, 21 Jan 2002 10:56:30 +0000 Subject: [PATCH] Compiler warning fixups for various compilers git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@180 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/libopensc/log.h | 5 ++--- src/libopensc/pkcs15.c | 2 +- src/libopensc/sc-log.h | 5 ++--- src/tools/cryptoflex-tool.c | 14 +++++++------- src/tools/opensc-explorer.c | 4 ++-- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/libopensc/log.h b/src/libopensc/log.h index 5b22d41e..206e7419 100644 --- a/src/libopensc/log.h +++ b/src/libopensc/log.h @@ -60,9 +60,8 @@ void debug(struct sc_context *ctx, const char *format, ...); void do_log(struct sc_context *ctx, int facility, const char *file, int line, const char *func, const char *format, ...); -void do_log2(struct sc_context *ctx, int facility, const char *file, - int line, const char *func, const char *format, - va_list args); +void do_log2(struct sc_context *ctx, int type, const char *file, + int line, const char *func, const char *format, va_list args); void sc_hex_dump(struct sc_context *ctx, const u8 *buf, size_t len, char *out, size_t outlen); diff --git a/src/libopensc/pkcs15.c b/src/libopensc/pkcs15.c index 245ab63a..83a00d8f 100644 --- a/src/libopensc/pkcs15.c +++ b/src/libopensc/pkcs15.c @@ -804,7 +804,7 @@ int sc_pkcs15_create(struct sc_pkcs15_card *p15card, struct sc_card *card) int r, i; u8 *tokinf_buf = NULL, *odf_buf = NULL; size_t tokinf_size, odf_size; - u8 line[10240]; + char line[10240]; sc_format_path("3F0050155031", &p15card->file_odf.path); sc_format_path("3F0050155032", &p15card->file_tokeninfo.path); diff --git a/src/libopensc/sc-log.h b/src/libopensc/sc-log.h index 5b22d41e..206e7419 100644 --- a/src/libopensc/sc-log.h +++ b/src/libopensc/sc-log.h @@ -60,9 +60,8 @@ void debug(struct sc_context *ctx, const char *format, ...); void do_log(struct sc_context *ctx, int facility, const char *file, int line, const char *func, const char *format, ...); -void do_log2(struct sc_context *ctx, int facility, const char *file, - int line, const char *func, const char *format, - va_list args); +void do_log2(struct sc_context *ctx, int type, const char *file, + int line, const char *func, const char *format, va_list args); void sc_hex_dump(struct sc_context *ctx, const u8 *buf, size_t len, char *out, size_t outlen); diff --git a/src/tools/cryptoflex-tool.c b/src/tools/cryptoflex-tool.c index a8507f0f..c55ae4f4 100644 --- a/src/tools/cryptoflex-tool.c +++ b/src/tools/cryptoflex-tool.c @@ -90,7 +90,7 @@ int verify_pin(int pin) return -2; } memset(pinbuf, 0, sizeof(pinbuf)); - strncpy(pinbuf, pass, sizeof(pinbuf)); + strncpy((char *) pinbuf, pass, sizeof(pinbuf)); memset(pass, 0, strlen(pass)); } if (pin == 1) @@ -109,7 +109,7 @@ int verify_pin(int pin) return 0; } -int select_app_df() +int select_app_df(void) { struct sc_path path; struct sc_file file; @@ -396,7 +396,7 @@ int read_private_key(RSA *rsa) return parse_private_key(p, keysize, rsa); } -int read_key() +int read_key(void) { RSA *rsa = RSA_new(); u8 buf[1024], *p = buf; @@ -441,7 +441,7 @@ int read_key() return 0; } -int list_keys() +int list_keys(void) { int r, i, idx = 0; struct sc_path path; @@ -483,7 +483,7 @@ int list_keys() return 0; } -int generate_key() +int generate_key(void) { struct sc_apdu apdu; u8 sbuf[4]; @@ -540,7 +540,7 @@ int generate_key() return 1; } -int create_key_files() +int create_key_files(void) { struct sc_file file; int mod_lens[] = { 512, 768, 1024, 2048 }; @@ -804,7 +804,7 @@ int update_private_key(const u8 *key, size_t keysize) return 0; } -int store_key() +int store_key(void) { u8 prv[1024], pub[1024]; size_t prvsize, pubsize; diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c index c0f121b6..94466542 100644 --- a/src/tools/opensc-explorer.c +++ b/src/tools/opensc-explorer.c @@ -409,7 +409,7 @@ int do_create(const char *arg, const char *arg2) { struct sc_path path; struct sc_file file; - int size; + unsigned int size; int i; if (arg_to_path(arg, &path) != 0) @@ -436,7 +436,7 @@ int do_mkdir(const char *arg, const char *arg2) { struct sc_path path; struct sc_file file; - size_t size; + unsigned int size; int i; if (arg_to_path(arg, &path) != 0)