cppcheck fix, make var conditional

This commit is contained in:
iceman1001 2020-04-29 20:34:47 +02:00
parent fa44eee82c
commit 00fb88ee4c

View file

@ -62,7 +62,9 @@ int reply_old(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *d
} }
} }
#ifdef WITH_FPC_USART_HOST
int resultfpc = PM3_EUNDEF; int resultfpc = PM3_EUNDEF;
#endif
int resultusb = PM3_EUNDEF; int resultusb = PM3_EUNDEF;
// Send frame and make sure all bytes are transmitted // Send frame and make sure all bytes are transmitted
@ -79,7 +81,9 @@ int reply_old(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *d
} }
// we got two results, let's prioritize the faulty one and USB over FPC. // we got two results, let's prioritize the faulty one and USB over FPC.
if (reply_via_usb && (resultusb != PM3_SUCCESS)) return resultusb; if (reply_via_usb && (resultusb != PM3_SUCCESS)) return resultusb;
#ifdef WITH_FPC_USART_HOST
if (reply_via_fpc && (resultfpc != PM3_SUCCESS)) return resultfpc; if (reply_via_fpc && (resultfpc != PM3_SUCCESS)) return resultfpc;
#endif
return PM3_SUCCESS; return PM3_SUCCESS;
} }
@ -117,7 +121,9 @@ static int reply_ng_internal(uint16_t cmd, int16_t status, uint8_t *data, size_t
} }
txBufferNGLen = sizeof(PacketResponseNGPreamble) + len + sizeof(PacketResponseNGPostamble); txBufferNGLen = sizeof(PacketResponseNGPreamble) + len + sizeof(PacketResponseNGPostamble);
#ifdef WITH_FPC_USART_HOST
int resultfpc = PM3_EUNDEF; int resultfpc = PM3_EUNDEF;
#endif
int resultusb = PM3_EUNDEF; int resultusb = PM3_EUNDEF;
// Send frame and make sure all bytes are transmitted // Send frame and make sure all bytes are transmitted
@ -133,7 +139,9 @@ static int reply_ng_internal(uint16_t cmd, int16_t status, uint8_t *data, size_t
} }
// we got two results, let's prioritize the faulty one and USB over FPC. // we got two results, let's prioritize the faulty one and USB over FPC.
if (reply_via_usb && (resultusb != PM3_SUCCESS)) return resultusb; if (reply_via_usb && (resultusb != PM3_SUCCESS)) return resultusb;
#ifdef WITH_FPC_USART_HOST
if (reply_via_fpc && (resultfpc != PM3_SUCCESS)) return resultfpc; if (reply_via_fpc && (resultfpc != PM3_SUCCESS)) return resultfpc;
#endif
return PM3_SUCCESS; return PM3_SUCCESS;
} }