1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

w32: Silence warnings about unused vars.

* agent/gpg-agent.c (main) [W32]: Mark unused vars.
* sm/gpgsm.c (run_protect_tool) [W32]: Ditto.
* g10/trustdb.c (check_regexp) [DISABLE_REGEX]: Ditto.
* scd/scdaemon.c (main) [W32]: Ditto.
(handle_connections) [W32]: Ditto.
(handle_signal) [W32]: Do not build the function at all.
* scd/apdu.c (pcsc_send_apdu_direct): Ditto.
(connect_pcsc_card): s/long/pcsc_dword_t/.
(open_pcsc_reader_direct): Remove var listlen.
This commit is contained in:
Werner Koch 2014-03-07 09:46:44 +01:00
parent a0fc42598f
commit 094aa2589e
5 changed files with 24 additions and 10 deletions

View File

@ -1108,6 +1108,9 @@ main (int argc, char **argv )
fflush (NULL);
#ifdef HAVE_W32_SYSTEM
(void)csh_style;
(void)nodetach;
(void)env_file_name;
pid = getpid ();
es_printf ("set %s=%s;%lu;1\n",
GPG_AGENT_INFO_NAME, socket_name, (ulong)pid);

View File

@ -1333,6 +1333,8 @@ static int
check_regexp(const char *expr,const char *string)
{
#ifdef DISABLE_REGEX
(void)expr;
(void)string;
/* When DISABLE_REGEX is defined, assume all regexps do not
match. */
return 0;

View File

@ -1081,6 +1081,8 @@ pcsc_send_apdu_direct (int slot, unsigned char *apdu, size_t apdulen,
struct pcsc_io_request_s send_pci;
pcsc_dword_t recv_len;
(void)pininfo;
if (!reader_table[slot].atrlen
&& (err = reset_pcsc_reader (slot)))
return err;
@ -1513,7 +1515,7 @@ connect_pcsc_card (int slot)
{
char reader[250];
pcsc_dword_t readerlen, atrlen;
long card_state, card_protocol;
pcsc_dword_t card_state, card_protocol;
pcsc_vendor_specific_init (slot);
@ -1525,7 +1527,7 @@ connect_pcsc_card (int slot)
reader_table[slot].atr, &atrlen);
if (err)
log_error ("pcsc_status failed: %s (0x%lx) %lu\n",
pcsc_error_string (err), err, readerlen);
pcsc_error_string (err), err, (long unsigned int)readerlen);
else
{
if (atrlen > DIM (reader_table[0].atr))
@ -1853,7 +1855,7 @@ open_pcsc_reader_direct (const char *portstr)
long err;
int slot;
char *list = NULL;
pcsc_dword_t nreader, listlen;
pcsc_dword_t nreader;
char *p;
slot = new_reader_slot ();
@ -1897,7 +1899,6 @@ open_pcsc_reader_direct (const char *portstr)
return -1;
}
listlen = nreader;
p = list;
while (nreader)
{

View File

@ -806,7 +806,10 @@ main (int argc, char **argv )
fflush (NULL);
#ifndef HAVE_W32_SYSTEM
#ifdef HAVE_W32_SYSTEM
(void)csh_style;
(void)nodetach;
#else
pid = fork ();
if (pid == (pid_t)-1)
{
@ -958,12 +961,12 @@ scd_get_socket_name ()
}
#ifndef HAVE_W32_SYSTEM
static void
handle_signal (int signo)
{
switch (signo)
{
#ifndef HAVE_W32_SYSTEM
case SIGHUP:
log_info ("SIGHUP received - "
"re-reading configuration and resetting cards\n");
@ -1004,12 +1007,12 @@ handle_signal (int signo)
cleanup ();
scd_exit (0);
break;
#endif /*!HAVE_W32_SYSTEM*/
default:
log_info ("signal %d received - no action defined\n", signo);
}
}
#endif /*!HAVE_W32_SYSTEM*/
static void
@ -1182,7 +1185,6 @@ static void
handle_connections (int listen_fd)
{
npth_attr_t tattr;
int signo;
struct sockaddr_un paddr;
socklen_t plen;
fd_set fdset, read_fdset;
@ -1193,6 +1195,9 @@ handle_connections (int listen_fd)
struct timespec curtime;
struct timespec timeout;
int saved_errno;
#ifndef HAVE_W32_SYSTEM
int signo;
#endif
ret = npth_attr_init(&tattr);
/* FIXME: Check error. */

View File

@ -2140,7 +2140,10 @@ open_es_fwrite (const char *filename)
static void
run_protect_tool (int argc, char **argv)
{
#ifndef HAVE_W32_SYSTEM
#ifdef HAVE_W32_SYSTEM
(void)argc;
(void)argv;
#else
const char *pgm;
char **av;
int i;
@ -2159,6 +2162,6 @@ run_protect_tool (int argc, char **argv)
av[i] = NULL;
execv (pgm, av);
log_error ("error executing '%s': %s\n", pgm, strerror (errno));
#endif /*HAVE_W32_SYSTEM*/
#endif /*!HAVE_W32_SYSTEM*/
gpgsm_exit (2);
}