fix more compiler warnings, based on a patch by Rainer Keller
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>
Sat, 26 Jan 2008 20:21:59 +0000 (20:21 +0000)
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>
Sat, 26 Jan 2008 20:21:59 +0000 (20:21 +0000)
git-svn-id: https://svn.gnumonks.org/trunk/librfid@2052 e0336214-984f-0b4b-a45f-81c69e1f0ede

include/librfid/rfid_asic.h
include/librfid/rfid_layer2.h
include/librfid/rfid_protocol.h
include/librfid/rfid_reader.h
src/rfid_layer2_iso14443a.c
src/rfid_layer2_iso15693.c
src/rfid_protocol.c
src/rfid_reader_openpcd.c
utils/mifare-tool.c

index 113eb19..8768baf 100644 (file)
@@ -17,7 +17,7 @@ struct rfid_asic_transport {
 struct rfid_asic_transport_handle {
        void *data;             /* handle to stuff like even lower layers */
 
-       struct rfid_asic_transport *rat;
+       const struct rfid_asic_transport *rat;
 };
 
 /* Some implementation-specific data.  A reader will specify one of these for
index 84d4579..45ae953 100644 (file)
@@ -76,7 +76,7 @@ struct rfid_layer2_handle {
                struct iso14443b_handle iso14443b;
                struct iso15693_handle iso15693;
        } priv;
-       struct rfid_layer2 *l2;
+       const struct rfid_layer2 *l2;
 };
 
 #endif /* __LIBRFID__ */
index 06f704f..ea4dd34 100644 (file)
@@ -89,7 +89,7 @@ struct rfid_protocol {
 
 struct rfid_protocol_handle {
        struct rfid_layer2_handle *l2h;
-       struct rfid_protocol *proto;
+       const struct rfid_protocol *proto;
        union {
                struct tcl_handle tcl;
        } priv;                         /* priv has to be last, since
index 21b740d..296c66f 100644 (file)
@@ -76,7 +76,7 @@ struct rfid_reader_handle {
        union {
 
        } priv;
-       struct rfid_reader *reader;
+       const struct rfid_reader *reader;
 };
 
 extern struct rfid_reader_handle *
index 66914db..cdd6b23 100644 (file)
@@ -43,7 +43,7 @@ iso14443a_transceive_sf(struct rfid_layer2_handle *handle,
                         unsigned char cmd,
                         struct iso14443a_atqa *atqa)
 {
-       struct rfid_reader *rdr = handle->rh->reader;
+       const struct rfid_reader *rdr = handle->rh->reader;
 
        return rdr->iso14443a.transceive_sf(handle->rh, cmd, atqa);
 }
@@ -54,7 +54,7 @@ iso14443a_transceive_acf(struct rfid_layer2_handle *handle,
                         struct iso14443a_anticol_cmd *acf,
                         unsigned int *bit_of_col)
 {
-       struct rfid_reader *rdr = handle->rh->reader;
+       const struct rfid_reader *rdr = handle->rh->reader;
 
        return rdr->iso14443a.transceive_acf(handle->rh, acf, bit_of_col);
 }
@@ -289,7 +289,7 @@ iso14443a_setopt(struct rfid_layer2_handle *handle, int optname,
                 const void *optval, unsigned int optlen)
 {
        int ret = -EINVAL;
-       struct rfid_reader *rdr = handle->rh->reader;
+       const struct rfid_reader *rdr = handle->rh->reader;
        unsigned int speed;
 
        switch (optname) {
index 7c988db..1c1ee1c 100644 (file)
@@ -95,7 +95,7 @@ iso15693_anticol(struct rfid_layer2_handle *handle)
 
 static int
 iso15693_getopt(struct rfid_layer2_handle *handle,
-               int optname, void *optval, unsigned int optlen)
+               int optname, void *optval, unsigned int *optlen)
 {
        switch (optname) {
        case RFID_OPT_15693_MOD_DEPTH:
index 0cd4f66..9d70e90 100644 (file)
@@ -33,7 +33,7 @@ static const struct rfid_protocol *rfid_protocols[] = {
 struct rfid_protocol_handle *
 rfid_protocol_init(struct rfid_layer2_handle *l2h, unsigned int id)
 {
-       struct rfid_protocol *p;
+       const struct rfid_protocol *p;
        struct rfid_protocol_handle *ph = NULL;
 
        if (id >= ARRAY_SIZE(rfid_protocols))
index 8adf1ee..67b73b6 100644 (file)
@@ -269,8 +269,8 @@ static int openpcd_get_environment(
 
 static int openpcd_set_environment(
     struct rfid_reader_handle *rh, 
-    const unsigned char num_bytes,
-    unsigned char *buf)
+    unsigned char num_bytes,
+    const unsigned char *buf)
 {
        int ret;
        
index ce16835..812d9f9 100644 (file)
@@ -94,19 +94,6 @@ static void mifare_l3(void)
        printf("Mifare card available\n");
 }
 
-static void inc_key(char* key, int len)
-{
-       int i;
-
-       if (len <= 0)
-               return;
-       i = len - 1;
-       if (key[i] < 0xff)
-               key[i]++;
-       else
-               key[i] = 0;
-}
-
 int main(int argc, char **argv)
 {
        int len, rc, c, option_index = 0;