MISRAC2012-Rule-12.1: add suggested parentheses

This commit is contained in:
Matthias Ringwald 2019-11-19 17:38:28 +01:00
parent f2597df949
commit 27bcc36f65
2 changed files with 11 additions and 10 deletions

View File

@ -67,9 +67,10 @@ Declarations of codec functions, data types, and macros.
#define SBC_HEADER_LEN 4
#define SBC_MAX_FRAME_LEN (SBC_HEADER_LEN + \
((SBC_MAX_BANDS * SBC_MAX_CHANNELS / 2) + \
(SBC_MAX_BANDS + SBC_MAX_BLOCKS * SBC_MAX_BITPOOL + 7)/8))
((SBC_MAX_BANDS + (SBC_MAX_BLOCKS * SBC_MAX_BITPOOL) + 7)/8)))
#define SBC_MAX_SAMPLES_PER_FRAME (SBC_MAX_BANDS * SBC_MAX_BLOCKS)
#define SBC_MAX_SCALEFACTOR_BYTES ((4*(SBC_MAX_CHANNELS * SBC_MAX_BANDS) + 7)/8)

18
3rd-party/yxml/yxml.c vendored
View File

@ -97,19 +97,19 @@ typedef enum {
#define yxml_isChar(c) 1
/* 0xd should be part of SP, too, but yxml_parse() already normalizes that into 0xa */
#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
#define yxml_isAlpha(c) ((c|32)-'a' < 26)
#define yxml_isNum(c) (c-'0' < 10)
#define yxml_isHex(c) (yxml_isNum(c) || (c|32)-'a' < 6)
#define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
#define yxml_isSP(c) ((c == 0x20) || (c == 0x09) || (c == 0x0a))
#define yxml_isAlpha(c) ( ((c|32)-'a') < 26)
#define yxml_isNum(c) ((c-'0') < 10)
#define yxml_isHex(c) (yxml_isNum(c) || ((c|32)-'a') < 6)
#define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || (c == '.') || (c == '_') || (c == '-'))
#define yxml_isNameStart(c) (yxml_isAlpha(c) || (c == ':') || (c == '_') || (c >= 128))
#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || (c == '-') || (c == '.'))
/* XXX: The valid characters are dependent on the quote char, hence the access to x->quote */
#define yxml_isAttValue(c) (yxml_isChar(c) && c != x->quote && c != '<' && c != '&')
#define yxml_isAttValue(c) (yxml_isChar(c) && (c != x->quote) && (c != '<') && (c != '&'))
/* Anything between '&' and ';', the yxml_ref* functions will do further
* validation. Strictly speaking, this is "yxml_isName(c) || c == '#'", but
* this parser doesn't understand entities with '.', ':', etc, anwyay. */
#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || (c == '#'))
#define INTFROM5CHARS(a, b, c, d, e) ((((uint64_t)(a))<<32) | (((uint64_t)(b))<<24) | (((uint64_t)(c))<<16) | (((uint64_t)(d))<<8) | (uint64_t)(e))