1
0
Fork 0
forked from nuttx/nuttx-update

tools/nxstyle.c: Make sure that all files begin with a comment on line 1 (which should be the file header).

This commit is contained in:
Gregory Nutt 2019-02-08 08:30:06 -06:00
parent 0191117747
commit d280b0651f
2 changed files with 10 additions and 1 deletions

View file

@ -77,7 +77,8 @@ static void up_registerdump(const uint32_t * regs)
regs[REG_S8], regs[REG_S9], regs[REG_S10], regs[REG_S11]);
#ifdef MINERVA32_SAVE_GP
svcinfo("GP:%08x SP:%08x FP:%08x TP:%08x RA:%08x\n",
regs[REG_GP], regs[REG_SP], regs[REG_FP], regs[REG_TP], regs[REG_RA]);
regs[REG_GP], regs[REG_SP], regs[REG_FP], regs[REG_TP],
regs[REG_RA]);
#else
svcinfo("SP:%08x FP:%08x TP:%08x RA:%08x\n",
regs[REG_SP], regs[REG_FP], regs[REG_TP], regs[REG_RA]);

View file

@ -209,6 +209,14 @@ int main(int argc, char **argv, char **envp)
comment_lineno);
}
}
/* Files must begin with a comment (the file header) */
if (lineno == 1 && (line[n] != '/' || line[n + 1] != '*'))
{
fprintf(stderr,
"Missing file header comment block at line 1\n");
}
}
/* STEP 1: Find the indentation level and the start of real stuff on