[Spice-devel] [PATCH 3/9] client/smartcard: s/reader_id_t/uint32_t/ (libcacard changed)

Alon Levy alevy at redhat.com
Wed Feb 9 02:20:42 PST 2011


---
 client/smartcard_channel.cpp |   10 +++++-----
 client/smartcard_channel.h   |   12 ++++++------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/client/smartcard_channel.cpp b/client/smartcard_channel.cpp
index 994671f..e7f3870 100644
--- a/client/smartcard_channel.cpp
+++ b/client/smartcard_channel.cpp
@@ -66,7 +66,7 @@ ReaderData* SmartCardChannel::reader_data_from_vreader(VReader* vreader)
     return _unallocated_readers_by_vreader.find(vreader)->second;
 }
 
-ReaderData* SmartCardChannel::reader_data_from_reader_id(reader_id_t reader_id)
+ReaderData* SmartCardChannel::reader_data_from_reader_id(uint32_t reader_id)
 {
     if (_readers_by_id.count(reader_id) > 0) {
         return _readers_by_id.find(reader_id)->second;
@@ -88,7 +88,7 @@ void SmartCardChannel::add_unallocated_reader(VReader* vreader, const char* name
 
 /** called upon the VSC_ReaderAddResponse
  */
-ReaderData* SmartCardChannel::add_reader(reader_id_t reader_id)
+ReaderData* SmartCardChannel::add_reader(uint32_t reader_id)
 {
     ReaderData* data;
     size_t unallocated = _unallocated_readers_by_vreader.size();
@@ -99,7 +99,7 @@ ReaderData* SmartCardChannel::add_reader(reader_id_t reader_id)
     _readers_by_vreader.insert(
         std::pair<VReader*, ReaderData*>(data->vreader, data));
     assert(_readers_by_vreader.count(data->vreader) == 1);
-    _readers_by_id.insert(std::pair<reader_id_t, ReaderData*>(reader_id, data));
+    _readers_by_id.insert(std::pair<uint32_t, ReaderData*>(reader_id, data));
     assert(_readers_by_id.count(reader_id) == 1);
     _unallocated_readers_by_vreader.erase(_unallocated_readers_by_vreader.begin());
     assert(_unallocated_readers_by_vreader.size() == unallocated - 1);
@@ -328,7 +328,7 @@ void SmartCardChannel::on_disconnect()
 }
 
 
-void SmartCardChannel::send_reader_removed(reader_id_t reader_id)
+void SmartCardChannel::send_reader_removed(uint32_t reader_id)
 {
     send_message(reader_id, VSC_ReaderRemove, NULL, 0);
 }
@@ -343,7 +343,7 @@ void SmartCardChannel::send_atr(VReader* vreader)
 {
     unsigned char atr[ MAX_ATR_LEN];
     int atr_len = MAX_ATR_LEN;
-    reader_id_t reader_id = reader_data_from_vreader(vreader)->reader_id;
+    uint32_t reader_id = reader_data_from_vreader(vreader)->reader_id;
 
     assert(reader_id != VSCARD_UNDEFINED_READER_ID);
     vreader_power_on(vreader, atr, &atr_len);
diff --git a/client/smartcard_channel.h b/client/smartcard_channel.h
index 60c6db5..1d512a6 100644
--- a/client/smartcard_channel.h
+++ b/client/smartcard_channel.h
@@ -29,7 +29,7 @@ struct ReaderData {
         card_insert_pending(false)
     {}
     VReader *vreader;
-    reader_id_t reader_id;
+    uint32_t reader_id;
     char* name;
     bool card_insert_pending;
 };
@@ -102,26 +102,26 @@ protected:
 private:
     static void* cac_card_events_thread_entry(void* data);
     void cac_card_events_thread_main();
-    void send_message(reader_id_t reader_id, VSCMsgType type, uint8_t* data, uint32_t len);
+    void send_message(uint32_t reader_id, VSCMsgType type, uint8_t* data, uint32_t len);
 
     Thread* _event_thread;
 
     Application* _app;
 
     VReaderList *_reader_list;
-    typedef std::map<reader_id_t, ReaderData*> readers_by_id_t;
+    typedef std::map<uint32_t, ReaderData*> readers_by_id_t;
     readers_by_id_t _readers_by_id;
     typedef std::map<VReader*, ReaderData*> readers_by_vreader_t;
     readers_by_vreader_t _readers_by_vreader;
     readers_by_vreader_t _unallocated_readers_by_vreader;
 
     ReaderData* reader_data_from_vreader(VReader* vreader);
-    ReaderData* reader_data_from_reader_id(reader_id_t reader_id);
+    ReaderData* reader_data_from_reader_id(uint32_t reader_id);
     void add_unallocated_reader(VReader* vreader, const char* name);
-    ReaderData* add_reader(reader_id_t reader_id);
+    ReaderData* add_reader(uint32_t reader_id);
     void remove_reader(ReaderData* data);
     void send_reader_added(const char* reader_name);
-    void send_reader_removed(reader_id_t reader_id);
+    void send_reader_removed(uint32_t reader_id);
     void send_atr(VReader* vreader);
 
     friend class ReaderAddEvent;
-- 
1.7.4



More information about the Spice-devel mailing list