Remove dead code
apdu.c:166:5: warning: Value stored to 'p' is never read *p++ = (u8)apdu->le; ^~~ apdu.c:156:4: warning: Value stored to 'p' is never read p += apdu->lc & 0xff; ^ ~~~~~~~~~~~~~~~ apdu.c:147:5: warning: Value stored to 'p' is never read *p++ = (u8)apdu->le; ^~~ apdu.c:139:3: warning: Value stored to 'p' is never read p += apdu->lc; ^ ~~~~~~~~ apdu.c:118:3: warning: Value stored to 'p' is never read p += apdu->lc; ^ ~~~~~~~~ apdu.c:112:5: warning: Value stored to 'p' is never read *p++ = (u8)apdu->le; ^~~ apdu.c:107:5: warning: Value stored to 'p' is never read *p++ = (u8)apdu->le; ^~~ apdu.c:102:4: warning: Value stored to 'p' is never read *p++ = (u8)apdu->le; ^~~ apdu.c:99:5: warning: Value stored to 'p' is never read *p++ = (u8)0x00; ^~~ git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5157 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
46946f285f
commit
f76600b901
|
@ -96,26 +96,25 @@ static int sc_apdu2bytes(sc_context_t *ctx, const sc_apdu_t *apdu,
|
||||||
case SC_APDU_CASE_1:
|
case SC_APDU_CASE_1:
|
||||||
/* T0 needs an additional 0x00 byte */
|
/* T0 needs an additional 0x00 byte */
|
||||||
if (proto == SC_PROTO_T0)
|
if (proto == SC_PROTO_T0)
|
||||||
*p++ = (u8)0x00;
|
*p = (u8)0x00;
|
||||||
break;
|
break;
|
||||||
case SC_APDU_CASE_2_SHORT:
|
case SC_APDU_CASE_2_SHORT:
|
||||||
*p++ = (u8)apdu->le;
|
*p = (u8)apdu->le;
|
||||||
break;
|
break;
|
||||||
case SC_APDU_CASE_2_EXT:
|
case SC_APDU_CASE_2_EXT:
|
||||||
if (proto == SC_PROTO_T0)
|
if (proto == SC_PROTO_T0)
|
||||||
/* T0 extended APDUs look just like short APDUs */
|
/* T0 extended APDUs look just like short APDUs */
|
||||||
*p++ = (u8)apdu->le;
|
*p = (u8)apdu->le;
|
||||||
else {
|
else {
|
||||||
/* in case of T1 always use 3 bytes for length */
|
/* in case of T1 always use 3 bytes for length */
|
||||||
*p++ = (u8)0x00;
|
*p++ = (u8)0x00;
|
||||||
*p++ = (u8)(apdu->le >> 8);
|
*p++ = (u8)(apdu->le >> 8);
|
||||||
*p++ = (u8)apdu->le;
|
*p = (u8)apdu->le;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SC_APDU_CASE_3_SHORT:
|
case SC_APDU_CASE_3_SHORT:
|
||||||
*p++ = (u8)apdu->lc;
|
*p++ = (u8)apdu->lc;
|
||||||
memcpy(p, apdu->data, apdu->lc);
|
memcpy(p, apdu->data, apdu->lc);
|
||||||
p += apdu->lc;
|
|
||||||
break;
|
break;
|
||||||
case SC_APDU_CASE_3_EXT:
|
case SC_APDU_CASE_3_EXT:
|
||||||
if (proto == SC_PROTO_T0) {
|
if (proto == SC_PROTO_T0) {
|
||||||
|
@ -136,7 +135,6 @@ static int sc_apdu2bytes(sc_context_t *ctx, const sc_apdu_t *apdu,
|
||||||
*p++ = (u8)apdu->lc;
|
*p++ = (u8)apdu->lc;
|
||||||
}
|
}
|
||||||
memcpy(p, apdu->data, apdu->lc);
|
memcpy(p, apdu->data, apdu->lc);
|
||||||
p += apdu->lc;
|
|
||||||
break;
|
break;
|
||||||
case SC_APDU_CASE_4_SHORT:
|
case SC_APDU_CASE_4_SHORT:
|
||||||
*p++ = (u8)apdu->lc;
|
*p++ = (u8)apdu->lc;
|
||||||
|
@ -144,7 +142,7 @@ static int sc_apdu2bytes(sc_context_t *ctx, const sc_apdu_t *apdu,
|
||||||
p += apdu->lc;
|
p += apdu->lc;
|
||||||
/* in case of T0 no Le byte is added */
|
/* in case of T0 no Le byte is added */
|
||||||
if (proto != SC_PROTO_T0)
|
if (proto != SC_PROTO_T0)
|
||||||
*p++ = (u8)apdu->le;
|
*p = (u8)apdu->le;
|
||||||
break;
|
break;
|
||||||
case SC_APDU_CASE_4_EXT:
|
case SC_APDU_CASE_4_EXT:
|
||||||
if (proto == SC_PROTO_T0) {
|
if (proto == SC_PROTO_T0) {
|
||||||
|
@ -153,7 +151,6 @@ static int sc_apdu2bytes(sc_context_t *ctx, const sc_apdu_t *apdu,
|
||||||
* transferred using ENVELOPE and GET RESPONSE */
|
* transferred using ENVELOPE and GET RESPONSE */
|
||||||
*p++ = (u8)apdu->lc;
|
*p++ = (u8)apdu->lc;
|
||||||
memcpy(p, apdu->data, apdu->lc);
|
memcpy(p, apdu->data, apdu->lc);
|
||||||
p += apdu->lc & 0xff;
|
|
||||||
} else {
|
} else {
|
||||||
*p++ = (u8)0x00;
|
*p++ = (u8)0x00;
|
||||||
*p++ = (u8)(apdu->lc >> 8);
|
*p++ = (u8)(apdu->lc >> 8);
|
||||||
|
@ -163,7 +160,7 @@ static int sc_apdu2bytes(sc_context_t *ctx, const sc_apdu_t *apdu,
|
||||||
/* only 2 bytes are use to specify the length of the
|
/* only 2 bytes are use to specify the length of the
|
||||||
* expected data */
|
* expected data */
|
||||||
*p++ = (u8)(apdu->le >> 8);
|
*p++ = (u8)(apdu->le >> 8);
|
||||||
*p++ = (u8)apdu->le;
|
*p = (u8)apdu->le;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue