Fix some make checkcodebase errors

- Reorder checkpatch ignore flags alphabetically
- Fix checkpatch WARNINGs and CHECKs when they make sense
- Add more checkpatch ignores
This commit is contained in:
ISSOtm
2019-12-04 00:16:28 +01:00
parent a290e19f46
commit 2d7d9eef9f
14 changed files with 63 additions and 46 deletions

View File

@@ -163,8 +163,8 @@ int32_t charmap_Add(char *input, uint8_t output)
int32_t i;
uint8_t v;
struct Charmap *charmap;
struct Charnode *curr_node, *temp_node;
struct Charmap *charmap;
struct Charnode *curr_node, *temp_node;
/*
* If the user tries to define a character mapping inside a section
@@ -217,8 +217,8 @@ int32_t charmap_Add(char *input, uint8_t output)
int32_t charmap_Convert(char **input)
{
struct Charmap *charmap;
struct Charnode *charnode;
struct Charmap *charmap;
struct Charnode *charnode;
char *output;
char outchar[8];
@@ -249,11 +249,11 @@ int32_t charmap_Convert(char **input)
charnode = &charmap->nodes[0];
/*
* find the longest valid match which has been registered in charmap.
* note that there could be either multiple matches or no match.
* and it possibly takes the longest match between them,
* which means that it ignores partial matches shorter than the longest one.
*/
* Find the longest valid match which has been registered in
* charmap, possibly yielding multiple or no matches.
* The longest match is taken, meaning partial matches shorter
* than the longest one are ignored.
*/
for (i = match = 0; (v = (*input)[i]);) {
if (!charnode->next[v])
break;

View File

@@ -317,7 +317,8 @@ void fstk_AddIncludePath(char *s)
if (NextIncPath == MAXINCPATHS)
fatalerror("Too many include directories passed from command line");
if (snprintf(IncludePaths[NextIncPath++], _MAX_PATH, "%s", s) >= _MAX_PATH)
if (snprintf(IncludePaths[NextIncPath++], _MAX_PATH, "%s",
s) >= _MAX_PATH)
fatalerror("Include path too long '%s'", s);
}

View File

@@ -1029,6 +1029,7 @@ static uint32_t yylex_MACROARGS(void)
int yylex(void)
{
int returnedChar;
switch (lexerstate) {
case LEX_STATE_NORMAL:
returnedChar = yylex_NORMAL();

View File

@@ -265,13 +265,12 @@ static void writesymbol(struct sSymbol *pSym, FILE *f)
uint32_t offset;
int32_t sectid;
if (!(pSym->nType & SYMF_DEFINED)) {
if (!(pSym->nType & SYMF_DEFINED))
type = SYMTYPE_IMPORT;
} else if (pSym->nType & SYMF_EXPORT) {
else if (pSym->nType & SYMF_EXPORT)
type = SYMTYPE_EXPORT;
} else {
else
type = SYMTYPE_LOCAL;
}
switch (type) {
case SYMTYPE_LOCAL: