[Pcsclite-cvs-commit] r1741 - trunk/PCSC/src/PCSC

Ludovic Rousseau rousseau at costa.debian.org
Thu Nov 24 15:09:00 UTC 2005


Author: rousseau
Date: 2005-11-24 15:09:00 +0000 (Thu, 24 Nov 2005)
New Revision: 1741

Modified:
   trunk/PCSC/src/PCSC/reader.h.in
Log:
use uint8_t instead of int8_t since the fields are defined as BYTE,
USHORT and ULONG in PC/SC v2 part 10 specification

This avoids a "warning: overflow in implicit constant conversion" when
using values bigger than 127


Modified: trunk/PCSC/src/PCSC/reader.h.in
===================================================================
--- trunk/PCSC/src/PCSC/reader.h.in	2005-11-24 14:35:24 UTC (rev 1740)
+++ trunk/PCSC/src/PCSC/reader.h.in	2005-11-24 15:09:00 UTC (rev 1741)
@@ -124,9 +124,9 @@
 /* the structure must be 6-bytes long */
 typedef struct
 {
-	int8_t tag;
-	int8_t length;
-	int32_t value;
+	uint8_t tag;
+	uint8_t length;
+	uint32_t value;
 } PCSC_TLV_STRUCTURE;
 
 /* the wLangId and wPINMaxExtraDigit are 16-bits long so are subject to byte
@@ -136,58 +136,58 @@
 
 typedef struct
 {
-	int8_t bTimerOut;	/* timeout is seconds (00 means use default timeout) */
-	int8_t bTimerOut2; /* timeout in seconds after first key stroke */
-	int8_t bmFormatString; /* formatting options */
-	int8_t bmPINBlockString; /* bits 7-4 bit size of PIN length in APDU,
+	uint8_t bTimerOut;	/* timeout is seconds (00 means use default timeout) */
+	uint8_t bTimerOut2; /* timeout in seconds after first key stroke */
+	uint8_t bmFormatString; /* formatting options */
+	uint8_t bmPINBlockString; /* bits 7-4 bit size of PIN length in APDU,
 	                        * bits 3-0 PIN block size in bytes after
 	                        * justification and formatting */
-	int8_t bmPINLengthFormat; /* bits 7-5 RFU,
+	uint8_t bmPINLengthFormat; /* bits 7-5 RFU,
 	                         * bit 4 set if system units are bytes, clear if
 	                         * system units are bits,
 	                         * bits 3-0 PIN length position in system units */
-	int16_t wPINMaxExtraDigit; /* 0xXXYY where XX is minimum PIN size in digits,
+	uint16_t wPINMaxExtraDigit; /* 0xXXYY where XX is minimum PIN size in digits,
 	                            and YY is maximum PIN size in digits */
-	int8_t bEntryValidationCondition; /* Conditions under which PIN entry should
+	uint8_t bEntryValidationCondition; /* Conditions under which PIN entry should
 	                                 * be considered complete */
-	int8_t bNumberMessage; /* Number of messages to display for PIN verification */
-	int16_t wLangId; /* Language for messages */
-	int8_t bMsgIndex; /* Message index (should be 00) */
-	int8_t bTeoPrologue[3]; /* T=1 block prologue field to use (fill with 00) */
-	int32_t ulDataLength; /* length of Data to be sent to the ICC */
-	int8_t abData[1]; /* Data to send to the ICC */
+	uint8_t bNumberMessage; /* Number of messages to display for PIN verification */
+	uint16_t wLangId; /* Language for messages */
+	uint8_t bMsgIndex; /* Message index (should be 00) */
+	uint8_t bTeoPrologue[3]; /* T=1 block prologue field to use (fill with 00) */
+	uint32_t ulDataLength; /* length of Data to be sent to the ICC */
+	uint8_t abData[1]; /* Data to send to the ICC */
 } PIN_VERIFY_STRUCTURE;
 
 typedef struct
 {
-	int8_t bTimerOut;	/* timeout is seconds (00 means use default timeout) */
-	int8_t bTimerOut2; /* timeout in seconds after first key stroke */
-	int8_t bmFormatString; /* formatting options */
-	int8_t bmPINBlockString; /* bits 7-4 bit size of PIN length in APDU,
+	uint8_t bTimerOut;	/* timeout is seconds (00 means use default timeout) */
+	uint8_t bTimerOut2; /* timeout in seconds after first key stroke */
+	uint8_t bmFormatString; /* formatting options */
+	uint8_t bmPINBlockString; /* bits 7-4 bit size of PIN length in APDU,
 	                        * bits 3-0 PIN block size in bytes after
 	                        * justification and formatting */
-	int8_t bmPINLengthFormat; /* bits 7-5 RFU,
+	uint8_t bmPINLengthFormat; /* bits 7-5 RFU,
 	                         * bit 4 set if system units are bytes, clear if
 	                         * system units are bits,
 	                         * bits 3-0 PIN length position in system units */
-	int8_t bInsertionOffsetOld; /* Insertion position offset in bytes for
+	uint8_t bInsertionOffsetOld; /* Insertion position offset in bytes for
 	                             the current PIN */
-	int8_t bInsertionOffsetNew; /* Insertion position offset in bytes for
+	uint8_t bInsertionOffsetNew; /* Insertion position offset in bytes for
 	                             the new PIN */
-	int16_t wPINMaxExtraDigit;
+	uint16_t wPINMaxExtraDigit;
 	                         /* 0xXXYY where XX is minimum PIN size in digits,
 	                            and YY is maximum PIN size in digits */
-	int8_t bConfirmPIN; /* Flags governing need for confirmation of new PIN */
-	int8_t bEntryValidationCondition; /* Conditions under which PIN entry should
+	uint8_t bConfirmPIN; /* Flags governing need for confirmation of new PIN */
+	uint8_t bEntryValidationCondition; /* Conditions under which PIN entry should
 	                                 * be considered complete */
-	int8_t bNumberMessage; /* Number of messages to display for PIN verification*/
-	int16_t wLangId; /* Language for messages */
-	int8_t bMsgIndex1; /* index of 1st prompting message */
-	int8_t bMsgIndex2; /* index of 2d prompting message */
-	int8_t bMsgIndex3; /* index of 3d prompting message */
-	int8_t bTeoPrologue[3]; /* T=1 block prologue field to use (fill with 00) */
-	int32_t ulDataLength; /* length of Data to be sent to the ICC */
-	int8_t abData[1]; /* Data to send to the ICC */
+	uint8_t bNumberMessage; /* Number of messages to display for PIN verification*/
+	uint16_t wLangId; /* Language for messages */
+	uint8_t bMsgIndex1; /* index of 1st prompting message */
+	uint8_t bMsgIndex2; /* index of 2d prompting message */
+	uint8_t bMsgIndex3; /* index of 3d prompting message */
+	uint8_t bTeoPrologue[3]; /* T=1 block prologue field to use (fill with 00) */
+	uint32_t ulDataLength; /* length of Data to be sent to the ICC */
+	uint8_t abData[1]; /* Data to send to the ICC */
 } PIN_MODIFY_STRUCTURE;
 
 /* restore default structure elements alignment */




More information about the Pcsclite-cvs-commit mailing list