coding style fixes
[librfid] / src / rfid_layer2_iso14443a.c
index 2c4cb1e..cdd6b23 100644 (file)
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-// #define DEBUG_LIBRFID
+#ifdef  __MINGW32__
+#include <windows.h>
+#endif/*__MINGW32__*/
 
 #include <librfid/rfid.h>
 #include <librfid/rfid_layer2.h>
@@ -42,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);
 }
@@ -53,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);
 }
@@ -288,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) {
@@ -350,6 +351,12 @@ iso14443a_init(struct rfid_reader_handle *rh)
 
        memset(h, 0, sizeof(*h));
        
+#ifdef  __MINGW32__
+       randctx[0] ^= GetTickCount();
+#endif/*__MINGW32__*/
+        for(ret=0;ret<23;ret++)
+            random_bit();
+       
        h->l2 = &rfid_layer2_iso14443a;
        h->rh = rh;
        h->priv.iso14443a.state = ISO14443A_STATE_NONE;