tools/nxstyle: skip mixed case check for particular headers
Add header keywords into whitelist, skip the warning if the particular headers will contain the functions with mixed case Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
e9b5c25baf
commit
743d13c2b0
@ -127,6 +127,7 @@ static int g_rangenumber = 0;
|
|||||||
static int g_rangestart[RANGE_NUMBER];
|
static int g_rangestart[RANGE_NUMBER];
|
||||||
static int g_rangecount[RANGE_NUMBER];
|
static int g_rangecount[RANGE_NUMBER];
|
||||||
static char g_file_name[PATH_MAX];
|
static char g_file_name[PATH_MAX];
|
||||||
|
static bool g_skipmixedcase;
|
||||||
|
|
||||||
static const struct file_section_s g_section_info[] =
|
static const struct file_section_s g_section_info[] =
|
||||||
{
|
{
|
||||||
@ -540,6 +541,12 @@ static const char *g_white_list[] =
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char *g_white_headers[] =
|
||||||
|
{
|
||||||
|
"windows.h",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
@ -918,6 +925,16 @@ static bool white_list(const char *ident, int lineno)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (pptr = g_white_headers;
|
||||||
|
(str = *pptr) != NULL;
|
||||||
|
pptr++)
|
||||||
|
{
|
||||||
|
if (strstr(ident, str) != NULL)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
len2 = strlen(ident);
|
len2 = strlen(ident);
|
||||||
while (!isalnum(ident[len2 - 1]))
|
while (!isalnum(ident[len2 - 1]))
|
||||||
{
|
{
|
||||||
@ -1487,6 +1504,10 @@ int main(int argc, char **argv, char **envp)
|
|||||||
"section",
|
"section",
|
||||||
lineno, ii);
|
lineno, ii);
|
||||||
}
|
}
|
||||||
|
else if (white_list(&line[ii], lineno))
|
||||||
|
{
|
||||||
|
g_skipmixedcase = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (strncmp(&line[ii], "if", 2) == 0)
|
else if (strncmp(&line[ii], "if", 2) == 0)
|
||||||
{
|
{
|
||||||
@ -2023,7 +2044,8 @@ int main(int argc, char **argv, char **envp)
|
|||||||
{
|
{
|
||||||
/* Ignore symbols that begin with white-listed prefixes */
|
/* Ignore symbols that begin with white-listed prefixes */
|
||||||
|
|
||||||
if (white_list(&line[ident_index], lineno))
|
if (g_skipmixedcase ||
|
||||||
|
white_list(&line[ident_index], lineno))
|
||||||
{
|
{
|
||||||
/* No error */
|
/* No error */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user