summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2019-03-28 17:19:38 +0100
committerJakub Jelen <jjelen@redhat.com>2019-07-04 16:05:09 +0200
commit04d897f91fbaa402e230661b453b7b502880bdc5 (patch)
tree0a66b7fe8728089f2c4876e7ec8daedcbf672bab /src
parent03bdafa0fc209584eb1ff2dc21aea1f0c7491bfd (diff)
Avoid unused arguments warnings
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/cac.c5
-rw-r--r--src/cac.h2
-rw-r--r--src/capcsc.c6
-rw-r--r--src/card_7816.c3
-rw-r--r--src/gp.c2
-rw-r--r--src/vcard_emul_type.c4
-rw-r--r--src/vscclient.c22
7 files changed, 21 insertions, 23 deletions
diff --git a/src/cac.c b/src/cac.c
index 687a828..e981e66 100644
--- a/src/cac.c
+++ b/src/cac.c
@@ -2024,7 +2024,7 @@ failure:
}
static VCardAppletPrivate *
-cac_new_passthrough_applet_private(VCard *card, const char *label,
+cac_new_passthrough_applet_private(G_GNUC_UNUSED VCard *card, const char *label,
const unsigned char *aid, unsigned int aid_len)
{
CACPTAppletData *pt_applet_data;
@@ -2240,8 +2240,7 @@ failure:
* the rest are connected through function pointers.
*/
VCardStatus
-cac_card_init(VReader *reader, VCard *card,
- const char *params,
+cac_card_init(G_GNUC_UNUSED VReader *reader, VCard *card,
unsigned char * const *cert,
int cert_len[],
VCardKey *key[] /* adopt the keys*/,
diff --git a/src/cac.h b/src/cac.h
index db8af2f..56c7526 100644
--- a/src/cac.h
+++ b/src/cac.h
@@ -73,7 +73,7 @@
* Initialize the cac card. This is the only public function in this file. All
* the rest are connected through function pointers.
*/
-VCardStatus cac_card_init(VReader *reader, VCard *card, const char *params,
+VCardStatus cac_card_init(VReader *reader, VCard *card,
unsigned char * const *cert, int cert_len[],
VCardKey *key[] /* adopt the keys*/,
int cert_count);
diff --git a/src/capcsc.c b/src/capcsc.c
index 236cba2..4da8a60 100644
--- a/src/capcsc.c
+++ b/src/capcsc.c
@@ -68,7 +68,7 @@ static void delete_reader_cb(VReaderEmul *ve)
g_mutex_unlock(&r->context->lock);
}
-static int new_reader(PCSCContext *pc, const char *name, DWORD state)
+static int new_reader(PCSCContext *pc, const char *name, G_GNUC_UNUSED DWORD state)
{
SCardReader *r;
VReader *vreader;
@@ -284,7 +284,7 @@ static VCardStatus apdu_cb(VCard *card, VCardAPDU *apdu,
return ret;
}
-static VCardStatus reset_cb(VCard *card, int channel)
+static VCardStatus reset_cb(VCard *card, G_GNUC_UNUSED int channel)
{
SCardReader *r = (SCardReader *) vcard_get_private(card);
LONG rc;
@@ -316,7 +316,7 @@ static void get_atr_cb(VCard *card, unsigned char *atr, int *atr_len)
}
}
-static void delete_card_cb(VCardEmul *ve)
+static void delete_card_cb(G_GNUC_UNUSED VCardEmul *ve)
{
fprintf(stderr, "TODO, got a delete_card_cb\n");
}
diff --git a/src/card_7816.c b/src/card_7816.c
index ca99e23..0389a82 100644
--- a/src/card_7816.c
+++ b/src/card_7816.c
@@ -564,7 +564,8 @@ vcard_make_response(vcard_7816_status_t status)
* Add File card support here if you need it.
*/
static VCardStatus
-vcard7816_file_system_process_apdu(VCard *card, VCardAPDU *apdu,
+vcard7816_file_system_process_apdu(G_GNUC_UNUSED VCard *card,
+ G_GNUC_UNUSED VCardAPDU *apdu,
VCardResponse **response)
{
/* TODO: if we want to support a virtual file system card, we do it here.
diff --git a/src/gp.c b/src/gp.c
index 0150b3c..5ad79f7 100644
--- a/src/gp.c
+++ b/src/gp.c
@@ -75,7 +75,7 @@ gp_applet_container_process_apdu(VCard *card, VCardAPDU *apdu,
* the rest are connected through function pointers.
*/
VCardStatus
-gp_card_init(VReader *reader, VCard *card)
+gp_card_init(G_GNUC_UNUSED VReader *reader, VCard *card)
{
VCardApplet *applet;
diff --git a/src/vcard_emul_type.c b/src/vcard_emul_type.c
index fc95ebe..ca7bbaa 100644
--- a/src/vcard_emul_type.c
+++ b/src/vcard_emul_type.c
@@ -29,8 +29,8 @@ VCardStatus vcard_init(VReader *vreader, VCard *vcard,
case VCARD_EMUL_NONE:
break;
case VCARD_EMUL_CAC:
- rv = cac_card_init(vreader, vcard, params,
- cert, cert_len, key, cert_count);
+ rv = cac_card_init(vreader, vcard,
+ cert, cert_len, key, cert_count);
if (rv == VCARD_DONE)
rv = gp_card_init(vreader, vcard);
return rv;
diff --git a/src/vscclient.c b/src/vscclient.c
index 89cb294..8ba9df1 100644
--- a/src/vscclient.c
+++ b/src/vscclient.c
@@ -157,9 +157,7 @@ static void
update_socket_watch(void);
static gboolean
-do_socket_send(GIOChannel *source,
- GIOCondition condition,
- gpointer data)
+do_socket_send(GIOCondition condition)
{
gsize bw;
GError *err = NULL;
@@ -183,7 +181,7 @@ do_socket_send(GIOChannel *source,
}
static gboolean
-socket_prepare_sending(gpointer user_data)
+socket_prepare_sending(G_GNUC_UNUSED gpointer user_data)
{
update_socket_watch();
@@ -224,14 +222,13 @@ static CompatGCond pending_reader_condition;
#define MAX_ATR_LEN 40
static gpointer
-event_thread(gpointer arg)
+event_thread(G_GNUC_UNUSED gpointer arg)
{
unsigned char atr[MAX_ATR_LEN];
int atr_len;
VEvent *event;
unsigned int reader_id;
-
while (1) {
const char *reader_name;
@@ -379,8 +376,7 @@ enum {
static gboolean
do_socket_read(GIOChannel *source,
- GIOCondition condition,
- gpointer data)
+ GIOCondition condition)
{
int rv;
int dwSendLength;
@@ -398,6 +394,8 @@ do_socket_read(GIOChannel *source,
static gsize br, to_read;
static int state = STATE_HEADER;
+ g_return_val_if_fail(condition & G_IO_IN, FALSE);
+
if (state == STATE_HEADER && to_read == 0) {
buf = (gchar *)&mhHeader;
to_read = sizeof(mhHeader);
@@ -552,17 +550,17 @@ do_socket_read(GIOChannel *source,
static gboolean
do_socket(GIOChannel *source,
GIOCondition condition,
- gpointer data)
+ G_GNUC_UNUSED gpointer data)
{
/* not sure if two watches work well with a single win32 sources */
if (condition & G_IO_OUT) {
- if (!do_socket_send(source, condition, data)) {
+ if (!do_socket_send(condition)) {
return FALSE;
}
}
if (condition & G_IO_IN) {
- if (!do_socket_read(source, condition, data)) {
+ if (!do_socket_read(source, condition)) {
return FALSE;
}
}
@@ -586,7 +584,7 @@ update_socket_watch(void)
static gboolean
do_command(GIOChannel *source,
GIOCondition condition,
- gpointer data)
+ G_GNUC_UNUSED gpointer data)
{
char *string;
VCardEmulError error;