diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-09-07 00:55:38 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-09-10 11:54:27 -0700 |
commit | 7ad9c7330ec73e763f2c6c1cc39cb41388cfd65f (patch) | |
tree | 94c540f6a1fa1e18a7e67987c4c2bc095df960d3 | |
parent | c350eb5a6c0ead8bb9fc75d8db84406b4a465eec (diff) | |
download | uhd-7ad9c7330ec73e763f2c6c1cc39cb41388cfd65f.tar.gz uhd-7ad9c7330ec73e763f2c6c1cc39cb41388cfd65f.tar.bz2 uhd-7ad9c7330ec73e763f2c6c1cc39cb41388cfd65f.zip |
x300: cdecode: Fix fallthrough warning
-rw-r--r-- | host/lib/usrp/x300/cdecode.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/host/lib/usrp/x300/cdecode.c b/host/lib/usrp/x300/cdecode.c index 424de6c6b..865423f3f 100644 --- a/host/lib/usrp/x300/cdecode.c +++ b/host/lib/usrp/x300/cdecode.c @@ -7,6 +7,12 @@ For details, see http://sourceforge.net/projects/libb64 #include "cdecode.h" +#if defined(__GNUC__) && __GNUC__ >= 7 +# define UHD_FALLTHROUGH __attribute__((fallthrough)); +#else +# define UHD_FALLTHROUGH +#endif + int base64_decode_value(char value_in){ static const char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; static const char decoding_size = sizeof(decoding); @@ -39,6 +45,7 @@ size_t base64_decode_block(const char* code_in, const size_t length_in, char* pl fragment = (char)base64_decode_value(*codechar++); } while ((signed char)fragment < 0); *plainchar = (fragment & 0x03f) << 2; + UHD_FALLTHROUGH case step_b: do{ @@ -51,6 +58,7 @@ size_t base64_decode_block(const char* code_in, const size_t length_in, char* pl } while ((signed char)fragment < 0); *plainchar++ |= (fragment & 0x030) >> 4; *plainchar = (fragment & 0x00f) << 4; + UHD_FALLTHROUGH case step_c: do{ if (codechar == code_in+length_in) @@ -63,6 +71,7 @@ size_t base64_decode_block(const char* code_in, const size_t length_in, char* pl } while ((signed char)fragment < 0); *plainchar++ |= (fragment & 0x03c) >> 2; *plainchar = (fragment & 0x003) << 6; + UHD_FALLTHROUGH case step_d: do{ if (codechar == code_in+length_in){ |