1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Marked all unused args on non-W32 platforms.

This commit is contained in:
Werner Koch 2008-10-20 13:53:23 +00:00
parent e1f4154d75
commit 0a5f742466
84 changed files with 864 additions and 224 deletions

View file

@ -1,3 +1,21 @@
2008-10-20 Werner Koch <wk@g10code.com>
* pcsc-wrapper.c (read_32): Use provided arg and not stdin. Is
called with stdin, though.
(handle_close): Mark unused arg.
(handle_status, handle_reset): Ditto.
* ccid-driver.c (ccid_check_card_presence): Mark not yet used arg.
* scdaemon.c (scd_deinit_default_ctrl): Mark unused arg.
* command.c (cmd_unlock, cmd_restart, cmd_disconnect): Ditto.
* apdu.c (ct_get_status): Ditto.
(ct_send_apdu, pcsc_send_apdu_wrapped)
(apdu_open_remote_reader): Ditto.
* app.c (select_application): Ditto.
* app-openpgp.c (do_writecert, do_change_pin, do_writekey): Ditto.
* app-nks.c (do_change_pin, do_check_pin): Ditto.
2008-10-16 Werner Koch <wk@g10code.com>
* command.c (cmd_disconnect): New dummy command.

View file

@ -542,6 +542,7 @@ reset_ct_reader (int slot)
static int
ct_get_status (int slot, unsigned int *status)
{
(void)slot;
/* The status we returned is wrong but we don't care becuase ctAPI
is not anymore required. */
*status = APDU_CARD_USABLE|APDU_CARD_PRESENT|APDU_CARD_ACTIVE;
@ -559,6 +560,8 @@ ct_send_apdu (int slot, unsigned char *apdu, size_t apdulen,
unsigned char dad[1], sad[1];
unsigned short ctbuflen;
(void)pininfo;
/* If we don't have an ATR, we need to reset the reader first. */
if (!reader_table[slot].atrlen
&& (rc = reset_ct_reader (slot)))
@ -1020,6 +1023,8 @@ pcsc_send_apdu_wrapped (int slot, unsigned char *apdu, size_t apdulen,
unsigned char msgbuf[9];
int sw = SW_HOST_CARD_IO_ERROR;
(void)pininfo;
if (!reader_table[slot].atrlen
&& (err = reset_pcsc_reader (slot)))
return err;
@ -2472,6 +2477,15 @@ apdu_open_remote_reader (const char *portstr,
writefnc, writefnc_value,
closefnc, closefnc_value);
#else
(void)portstr;
(void)cookie;
(void)length;
(void)readfnc;
(void)readfnc_value;
(void)writefnc;
(void)writefnc_value;
(void)closefnc;
(void)closefnc_value;
#ifdef _WIN32
errno = ENOENT;
#else

View file

@ -530,6 +530,9 @@ do_change_pin (app_t app, ctrl_t ctrl, const char *chvnostr,
const char *oldpin;
size_t oldpinlen;
(void)ctrl;
(void)chvnostr;
if ((flags & APP_CHANGE_FLAG_RESET))
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
@ -573,6 +576,7 @@ do_check_pin (app_t app, const char *keyidstr,
gpg_error_t (*pincb)(void*, const char *, char **),
void *pincb_arg)
{
(void)keyidstr;
return verify_pin (app, pincb, pincb_arg);
}

View file

@ -1777,6 +1777,7 @@ do_writecert (app_t app, ctrl_t ctrl,
void *pincb_arg,
const unsigned char *certdata, size_t certdatalen)
{
(void)ctrl;
#if GNUPG_MAJOR_VERSION > 1
if (strcmp (certidstr, "OPENPGP.3"))
return gpg_error (GPG_ERR_INV_ID);
@ -1808,6 +1809,8 @@ do_change_pin (app_t app, ctrl_t ctrl, const char *chvnostr,
int reset_mode = !!(flags & APP_CHANGE_FLAG_RESET);
int set_resetcode = 0;
(void)ctrl;
if (reset_mode && chvno == 3)
{
rc = gpg_error (GPG_ERR_INV_ID);
@ -2201,6 +2204,8 @@ do_writekey (app_t app, ctrl_t ctrl,
unsigned char fprbuf[20];
u32 created_at = 0;
(void)ctrl;
if (!strcmp (keyid, "OPENPGP.1"))
keyno = 0;
else if (!strcmp (keyid, "OPENPGP.2"))

View file

@ -220,6 +220,8 @@ select_application (ctrl_t ctrl, int slot, const char *name, app_t *r_app)
unsigned char *result = NULL;
size_t resultlen;
(void)ctrl;
*r_app = NULL;
err = lock_reader (slot);

View file

@ -1353,7 +1353,7 @@ ccid_close_reader (ccid_driver_t handle)
int
ccid_check_card_presence (ccid_driver_t handle)
{
(void)handle; /* Not yet implemented. */
return -1;
}

View file

@ -1502,6 +1502,8 @@ cmd_unlock (assuan_context_t ctx, char *line)
ctrl_t ctrl = assuan_get_pointer (ctx);
int rc = 0;
(void)line;
if (locked_session)
{
if (locked_session != ctrl->server_local)
@ -1624,6 +1626,8 @@ cmd_restart (assuan_context_t ctx, char *line)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
(void)line;
if (ctrl->app_ctx)
{
release_application (ctrl->app_ctx);
@ -1646,6 +1650,8 @@ cmd_restart (assuan_context_t ctx, char *line)
static int
cmd_disconnect (assuan_context_t ctx, char *line)
{
(void)ctx;
(void)line;
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}

View file

@ -243,10 +243,10 @@ read_32 (FILE *fp)
{
int c1, c2, c3, c4;
c1 = getc (stdin);
c2 = getc (stdin);
c3 = getc (stdin);
c4 = getc (stdin);
c1 = getc (fp);
c2 = getc (fp);
c3 = getc (fp);
c4 = getc (fp);
if (c1 == EOF || c2 == EOF || c3 == EOF || c4 == EOF)
{
fprintf (stderr, PGM ": premature EOF while parsing request\n");
@ -518,6 +518,9 @@ handle_open (unsigned char *argbuf, size_t arglen)
static void
handle_close (unsigned char *argbuf, size_t arglen)
{
(void)argbuf;
(void)arglen;
if (!driver_is_open)
{
fprintf (stderr, PGM ": PC/SC has not yet been opened\n");
@ -546,6 +549,9 @@ handle_status (unsigned char *argbuf, size_t arglen)
int status;
unsigned char buf[20];
(void)argbuf;
(void)arglen;
if (!driver_is_open)
{
fprintf (stderr, PGM ": PC/SC has not yet been opened\n");
@ -614,6 +620,9 @@ handle_reset (unsigned char *argbuf, size_t arglen)
unsigned long nreader, atrlen;
unsigned long card_state, card_protocol;
(void)argbuf;
(void)arglen;
if (!driver_is_open)
{
fprintf (stderr, PGM ": PC/SC has not yet been opened\n");

View file

@ -825,7 +825,7 @@ scd_init_default_ctrl (ctrl_t ctrl)
static void
scd_deinit_default_ctrl (ctrl_t ctrl)
{
(void)ctrl;
}