core: Mark unused function args.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2016-09-13 20:53:14 +02:00
parent 9064eebdc0
commit 4a200146b6
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
20 changed files with 86 additions and 1 deletions

View File

@ -26,6 +26,10 @@ int
_gpgme_assuan_log_cb (assuan_context_t ctx, void *hook, _gpgme_assuan_log_cb (assuan_context_t ctx, void *hook,
unsigned int cat, const char *msg) unsigned int cat, const char *msg)
{ {
(void)ctx;
(void)hook;
(void)cat;
if (msg == NULL) if (msg == NULL)
return 1; return 1;
@ -49,6 +53,8 @@ my_pipe (assuan_context_t ctx, assuan_fd_t fds[2], int inherit_idx)
int res; int res;
int gfds[2]; int gfds[2];
(void)ctx;
res = _gpgme_io_pipe (gfds, inherit_idx); res = _gpgme_io_pipe (gfds, inherit_idx);
/* For now... */ /* For now... */
@ -64,6 +70,7 @@ my_pipe (assuan_context_t ctx, assuan_fd_t fds[2], int inherit_idx)
static int static int
my_close (assuan_context_t ctx, assuan_fd_t fd) my_close (assuan_context_t ctx, assuan_fd_t fd)
{ {
(void)ctx;
return _gpgme_io_close ((int) fd); return _gpgme_io_close ((int) fd);
} }
@ -71,6 +78,7 @@ my_close (assuan_context_t ctx, assuan_fd_t fd)
static gpgme_ssize_t static gpgme_ssize_t
my_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size) my_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size)
{ {
(void)ctx;
return _gpgme_io_read ((int) fd, buffer, size); return _gpgme_io_read ((int) fd, buffer, size);
} }
@ -78,6 +86,7 @@ my_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size)
static gpgme_ssize_t static gpgme_ssize_t
my_write (assuan_context_t ctx, assuan_fd_t fd, const void *buffer, size_t size) my_write (assuan_context_t ctx, assuan_fd_t fd, const void *buffer, size_t size)
{ {
(void)ctx;
return _gpgme_io_write ((int) fd, buffer, size); return _gpgme_io_write ((int) fd, buffer, size);
} }
@ -86,6 +95,7 @@ static int
my_recvmsg (assuan_context_t ctx, assuan_fd_t fd, assuan_msghdr_t msg, my_recvmsg (assuan_context_t ctx, assuan_fd_t fd, assuan_msghdr_t msg,
int flags) int flags)
{ {
(void)ctx;
#ifdef HAVE_W32_SYSTEM #ifdef HAVE_W32_SYSTEM
gpg_err_set_errno (ENOSYS); gpg_err_set_errno (ENOSYS);
return -1; return -1;
@ -100,6 +110,7 @@ static int
my_sendmsg (assuan_context_t ctx, assuan_fd_t fd, const assuan_msghdr_t msg, my_sendmsg (assuan_context_t ctx, assuan_fd_t fd, const assuan_msghdr_t msg,
int flags) int flags)
{ {
(void)ctx;
#ifdef HAVE_W32_SYSTEM #ifdef HAVE_W32_SYSTEM
gpg_err_set_errno (ENOSYS); gpg_err_set_errno (ENOSYS);
return -1; return -1;
@ -124,6 +135,9 @@ my_spawn (assuan_context_t ctx, pid_t *r_pid, const char *name,
struct spawn_fd_item_s *fd_items; struct spawn_fd_item_s *fd_items;
int i; int i;
(void)ctx;
(void)flags;
assert (name); assert (name);
if (! name) if (! name)
@ -194,6 +208,7 @@ static pid_t
my_waitpid (assuan_context_t ctx, pid_t pid, my_waitpid (assuan_context_t ctx, pid_t pid,
int nowait, int *status, int options) int nowait, int *status, int options)
{ {
(void)ctx;
#ifdef HAVE_W32_SYSTEM #ifdef HAVE_W32_SYSTEM
CloseHandle ((HANDLE) pid); CloseHandle ((HANDLE) pid);
#else #else
@ -226,6 +241,7 @@ my_socketpair (assuan_context_t ctx, int namespace, int style,
static int static int
my_socket (assuan_context_t ctx, int namespace, int style, int protocol) my_socket (assuan_context_t ctx, int namespace, int style, int protocol)
{ {
(void)ctx;
return _gpgme_io_socket (namespace, style, protocol); return _gpgme_io_socket (namespace, style, protocol);
} }
@ -234,6 +250,7 @@ static int
my_connect (assuan_context_t ctx, int sock, struct sockaddr *addr, my_connect (assuan_context_t ctx, int sock, struct sockaddr *addr,
socklen_t length) socklen_t length)
{ {
(void)ctx;
return _gpgme_io_connect (sock, addr, length); return _gpgme_io_connect (sock, addr, length);
} }

View File

@ -489,6 +489,8 @@ gpgme_data_identify (gpgme_data_t dh, int reserved)
int n; int n;
gpgme_off_t off; gpgme_off_t off;
(void)reserved;
/* Check whether we can seek the data object. */ /* Check whether we can seek the data object. */
off = gpgme_data_seek (dh, 0, SEEK_CUR); off = gpgme_data_seek (dh, 0, SEEK_CUR);
if (off == (gpgme_off_t)(-1)) if (off == (gpgme_off_t)(-1))

View File

@ -33,6 +33,8 @@
static gpgme_error_t static gpgme_error_t
delete_status_handler (void *priv, gpgme_status_code_t code, char *args) delete_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
(void)priv;
if (code == GPGME_STATUS_DELETE_PROBLEM) if (code == GPGME_STATUS_DELETE_PROBLEM)
{ {
enum delete_problem enum delete_problem

View File

@ -131,6 +131,7 @@ llass_get_home_dir (void)
static char * static char *
llass_get_version (const char *file_name) llass_get_version (const char *file_name)
{ {
(void)file_name;
return NULL; return NULL;
} }

View File

@ -413,6 +413,9 @@ g13_assuan_simple_command (assuan_context_t ctx, char *cmd,
char *line; char *line;
size_t linelen; size_t linelen;
(void)status_fnc;
(void)status_fnc_value;
err = assuan_write_line (ctx, cmd); err = assuan_write_line (ctx, cmd);
if (err) if (err)
return err; return err;

View File

@ -2540,6 +2540,8 @@ gpg_keylist (void *engine, const char *pattern, int secret_only,
engine_gpg_t gpg = engine; engine_gpg_t gpg = engine;
gpgme_error_t err; gpgme_error_t err;
(void)engine_flags;
err = gpg_keylist_build_options (gpg, secret_only, mode); err = gpg_keylist_build_options (gpg, secret_only, mode);
if (!err && pattern && *pattern) if (!err && pattern && *pattern)
@ -2559,6 +2561,8 @@ gpg_keylist_ext (void *engine, const char *pattern[], int secret_only,
engine_gpg_t gpg = engine; engine_gpg_t gpg = engine;
gpgme_error_t err; gpgme_error_t err;
(void)engine_flags;
if (reserved) if (reserved)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
@ -2585,6 +2589,8 @@ gpg_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
engine_gpg_t gpg = engine; engine_gpg_t gpg = engine;
gpgme_error_t err; gpgme_error_t err;
(void)include_certs;
if (mode == GPGME_SIG_MODE_CLEAR) if (mode == GPGME_SIG_MODE_CLEAR)
err = add_arg (gpg, "--clearsign"); err = add_arg (gpg, "--clearsign");
else else

View File

@ -912,6 +912,8 @@ gpgconf_conf_save (void *engine, gpgme_conf_comp_t comp)
static void static void
gpgconf_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs) gpgconf_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs)
{ {
(void)engine;
(void)io_cbs;
/* Nothing to do. */ /* Nothing to do. */
} }

View File

@ -185,6 +185,8 @@ close_notify_handler (int fd, void *opaque)
static gpgme_error_t static gpgme_error_t
default_inq_cb (engine_gpgsm_t gpgsm, const char *line) default_inq_cb (engine_gpgsm_t gpgsm, const char *line)
{ {
(void)gpgsm;
if (!strncmp (line, "PINENTRY_LAUNCHED", 17) && (line[17]==' '||!line[17])) if (!strncmp (line, "PINENTRY_LAUNCHED", 17) && (line[17]==' '||!line[17]))
{ {
_gpgme_allow_set_foreground_window ((pid_t)strtoul (line+17, NULL, 10)); _gpgme_allow_set_foreground_window ((pid_t)strtoul (line+17, NULL, 10));
@ -660,6 +662,9 @@ gpgsm_clear_fd (engine_gpgsm_t gpgsm, fd_type_t fd_type)
_gpgme_io_close (gpgsm->message_cb.fd); _gpgme_io_close (gpgsm->message_cb.fd);
break; break;
} }
#else
(void)gpgsm;
(void)fd_type;
#endif #endif
} }
@ -1133,6 +1138,8 @@ gpgsm_delete (void *engine, gpgme_key_t key, int allow_secret)
char *line; char *line;
int length = 8; /* "DELKEYS " */ int length = 8; /* "DELKEYS " */
(void)allow_secret;
if (!fpr) if (!fpr)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
@ -1816,6 +1823,8 @@ gpgsm_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
int i; int i;
gpgme_key_t key; gpgme_key_t key;
(void)use_textmode;
if (!gpgsm) if (!gpgsm)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);

View File

@ -187,6 +187,8 @@ close_notify_handler (int fd, void *opaque)
static gpgme_error_t static gpgme_error_t
default_inq_cb (engine_uiserver_t uiserver, const char *line) default_inq_cb (engine_uiserver_t uiserver, const char *line)
{ {
(void)uiserver;
if (!strncmp (line, "PINENTRY_LAUNCHED", 17) && (line[17]==' '||!line[17])) if (!strncmp (line, "PINENTRY_LAUNCHED", 17) && (line[17]==' '||!line[17]))
{ {
_gpgme_allow_set_foreground_window ((pid_t)strtoul (line+17, NULL, 10)); _gpgme_allow_set_foreground_window ((pid_t)strtoul (line+17, NULL, 10));
@ -1151,6 +1153,9 @@ uiserver_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
char *cmd; char *cmd;
gpgme_key_t key; gpgme_key_t key;
(void)use_textmode;
(void)include_certs;
if (!uiserver || !in || !out) if (!uiserver || !in || !out)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
if (uiserver->protocol == GPGME_PROTOCOL_DEFAULT) if (uiserver->protocol == GPGME_PROTOCOL_DEFAULT)

View File

@ -31,6 +31,9 @@
static gpgme_error_t static gpgme_error_t
getauditlog_status_handler (void *priv, gpgme_status_code_t code, char *args) getauditlog_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
(void)priv;
(void)code;
(void)args;
return 0; return 0;
} }

View File

@ -1809,6 +1809,8 @@ server_passphrase_cb (void *opaque, const char *uid_hint, const char *info,
unsigned char *buf = NULL; unsigned char *buf = NULL;
size_t buflen = 0; size_t buflen = 0;
(void)was_bad;
if (server && server->assuan_ctx) if (server && server->assuan_ctx)
{ {
if (uid_hint) if (uid_hint)
@ -1983,6 +1985,9 @@ static gpg_error_t
reset_notify (assuan_context_t ctx, char *line) reset_notify (assuan_context_t ctx, char *line)
{ {
struct server *server = assuan_get_pointer (ctx); struct server *server = assuan_get_pointer (ctx);
(void)line;
server_reset_fds (server); server_reset_fds (server);
gt_reset (server->gt); gt_reset (server->gt);
return 0; return 0;
@ -2306,6 +2311,8 @@ cmd_signers_clear (assuan_context_t ctx, char *line)
{ {
struct server *server = assuan_get_pointer (ctx); struct server *server = assuan_get_pointer (ctx);
(void)line;
return gt_signers_clear (server->gt); return gt_signers_clear (server->gt);
} }
@ -2322,6 +2329,8 @@ _cmd_decrypt_verify (assuan_context_t ctx, char *line, int verify)
gpgme_data_t inp_data; gpgme_data_t inp_data;
gpgme_data_t out_data; gpgme_data_t out_data;
(void)line;
inp_fd = server->input_fd; inp_fd = server->input_fd;
inp_fn = server->input_filename; inp_fn = server->input_filename;
if (inp_fd == ASSUAN_INVALID_FD && !inp_fn) if (inp_fd == ASSUAN_INVALID_FD && !inp_fn)
@ -2548,6 +2557,8 @@ cmd_verify (assuan_context_t ctx, char *line)
gpgme_data_t msg_data = NULL; gpgme_data_t msg_data = NULL;
gpgme_data_t out_data = NULL; gpgme_data_t out_data = NULL;
(void)line;
inp_fd = server->input_fd; inp_fd = server->input_fd;
inp_fn = server->input_filename; inp_fn = server->input_filename;
if (inp_fd == ASSUAN_INVALID_FD && !inp_fn) if (inp_fd == ASSUAN_INVALID_FD && !inp_fn)
@ -2723,6 +2734,8 @@ cmd_genkey (assuan_context_t ctx, char *line)
gpgme_data_t parms_data = NULL; gpgme_data_t parms_data = NULL;
const char *parms; const char *parms;
(void)line;
inp_fd = server->input_fd; inp_fd = server->input_fd;
inp_fn = server->input_filename; inp_fn = server->input_filename;
if (inp_fd == ASSUAN_INVALID_FD && !inp_fn) if (inp_fd == ASSUAN_INVALID_FD && !inp_fn)
@ -3038,6 +3051,9 @@ static gpg_error_t
cmd_result (assuan_context_t ctx, char *line) cmd_result (assuan_context_t ctx, char *line)
{ {
struct server *server = assuan_get_pointer (ctx); struct server *server = assuan_get_pointer (ctx);
(void)line;
return gt_result (server->gt, GT_RESULT_ALL); return gt_result (server->gt, GT_RESULT_ALL);
} }
@ -3093,6 +3109,8 @@ cmd_identify (assuan_context_t ctx, char *line)
char *inp_fn; char *inp_fn;
gpgme_data_t inp_data; gpgme_data_t inp_data;
(void)line;
inp_fd = server->input_fd; inp_fd = server->input_fd;
inp_fn = server->input_filename; inp_fn = server->input_filename;
if (inp_fd == ASSUAN_INVALID_FD && !inp_fn) if (inp_fd == ASSUAN_INVALID_FD && !inp_fn)

View File

@ -122,6 +122,8 @@ keylist_status_handler (void *priv, gpgme_status_code_t code, char *args)
void *hook; void *hook;
op_data_t opd; op_data_t opd;
(void)args;
err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, &hook, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, &hook, -1, NULL);
opd = hook; opd = hook;
if (err) if (err)

View File

@ -213,6 +213,8 @@ _gpgme_parse_inv_recp (char *args, int for_signing,
char *tail; char *tail;
long int reason; long int reason;
(void)for_signing;
inv_key = calloc (1, sizeof (*inv_key)); inv_key = calloc (1, sizeof (*inv_key));
if (!inv_key) if (!inv_key)
return gpg_error_from_syserror (); return gpg_error_from_syserror ();

View File

@ -145,6 +145,8 @@ _gpgme_get_gpgconf_path (void)
int int
_gpgme_get_conf_int (const char *key, int *value) _gpgme_get_conf_int (const char *key, int *value)
{ {
(void)key;
(void)value;
return 0; return 0;
} }

View File

@ -52,6 +52,9 @@ typedef struct
static gpgme_error_t static gpgme_error_t
trustlist_status_handler (void *priv, gpgme_status_code_t code, char *args) trustlist_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
(void)priv;
(void)code;
(void)args;
return 0; return 0;
} }

View File

@ -1264,6 +1264,8 @@ gpgme_get_sig_ulong_attr (gpgme_ctx_t ctx, int idx,
gpgme_verify_result_t result; gpgme_verify_result_t result;
gpgme_signature_t sig; gpgme_signature_t sig;
(void)whatidx;
result = gpgme_op_verify_result (ctx); result = gpgme_op_verify_result (ctx);
sig = result->signatures; sig = result->signatures;

View File

@ -307,7 +307,7 @@ _gpgme_get_program_version (const char *const file_name)
char *mark = NULL; char *mark = NULL;
int rp[2]; int rp[2];
int nread; int nread;
char *argv[] = {NULL /* file_name */, "--version", 0}; char *argv[] = {NULL /* file_name */, (char*)"--version", 0};
struct spawn_fd_item_s cfd[] = { {-1, 1 /* STDOUT_FILENO */, -1, 0}, struct spawn_fd_item_s cfd[] = { {-1, 1 /* STDOUT_FILENO */, -1, 0},
{-1, -1} }; {-1, -1} };
int status; int status;

View File

@ -118,6 +118,8 @@ _gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[],
char *container_file_esc = NULL; char *container_file_esc = NULL;
int i; int i;
(void)flags;
/* We want to encourage people to check error values, so not getting /* We want to encourage people to check error values, so not getting
them is discouraged here. Also makes our code easier. */ them is discouraged here. Also makes our code easier. */
if (! op_err) if (! op_err)

View File

@ -173,6 +173,8 @@ _gpgme_op_vfs_mount (gpgme_ctx_t ctx, const char *container_file,
char *cmd; char *cmd;
char *container_file_esc = NULL; char *container_file_esc = NULL;
(void)flags;
/* We want to encourage people to check error values, so not getting /* We want to encourage people to check error values, so not getting
them is discouraged here. Also makes our code easier. */ them is discouraged here. Also makes our code easier. */
if (! op_err) if (! op_err)

View File

@ -46,6 +46,8 @@ _gpgme_user_io_cb_handler (void *data, int fd)
struct tag *tag = (struct tag *) data; struct tag *tag = (struct tag *) data;
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
(void)fd;
assert (data); assert (data);
ctx = tag->ctx; ctx = tag->ctx;
assert (ctx); assert (ctx);