mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-19 21:03:23 -07:00
Fix gcc10 compiler warnings
- fix attribute format for MINGW in tinycbor/cbor.h - add pragma to prevent "unaligned pointer" warning in cmddata.c. We know what we are doing there. - whitespace fixes
This commit is contained in:
parent
ad326d84ad
commit
8ac5d5cba1
2 changed files with 59 additions and 52 deletions
|
@ -1206,13 +1206,16 @@ int getSamples(int n, bool silent)
|
||||||
uint8_t bits_per_sample = 8;
|
uint8_t bits_per_sample = 8;
|
||||||
|
|
||||||
//Old devices without this feature would send 0 at arg[0]
|
//Old devices without this feature would send 0 at arg[0]
|
||||||
if(response.arg[0] > 0)
|
if(response.arg[0] > 0) {
|
||||||
{
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
|
||||||
sample_config *sc = (sample_config *) response.d.asBytes;
|
sample_config *sc = (sample_config *) response.d.asBytes;
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
if (!silent) PrintAndLog("Samples @ %d bits/smpl, decimation 1:%d ", sc->bits_per_sample
|
if (!silent) PrintAndLog("Samples @ %d bits/smpl, decimation 1:%d ", sc->bits_per_sample
|
||||||
, sc->decimation);
|
, sc->decimation);
|
||||||
bits_per_sample = sc->bits_per_sample;
|
bits_per_sample = sc->bits_per_sample;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bits_per_sample < 8)
|
if(bits_per_sample < 8)
|
||||||
{
|
{
|
||||||
if (!silent) PrintAndLog("Unpacking...");
|
if (!silent) PrintAndLog("Unpacking...");
|
||||||
|
|
|
@ -581,8 +581,12 @@ enum CborPrettyFlags {
|
||||||
|
|
||||||
typedef CborError (*CborStreamFunction)(void *token, const char *fmt, ...)
|
typedef CborError (*CborStreamFunction)(void *token, const char *fmt, ...)
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
#if defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
|
__attribute__((__format__(__MINGW_PRINTF_FORMAT, 2, 3)))
|
||||||
|
#else
|
||||||
__attribute__((__format__(printf, 2, 3)))
|
__attribute__((__format__(printf, 2, 3)))
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
CBOR_API CborError cbor_value_to_pretty_stream(CborStreamFunction streamFunction, void *token, CborValue *value, int flags);
|
CBOR_API CborError cbor_value_to_pretty_stream(CborStreamFunction streamFunction, void *token, CborValue *value, int flags);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue