From 014d6d026ca0e7fd13818a6c1e3006aaeb606b12 Mon Sep 17 00:00:00 2001 From: yangjiukui Date: Tue, 7 Sep 2021 11:20:23 +0800 Subject: [PATCH] tools/nxstyle: Fix the check tool incorrectly reported no alignment. The nxstyle check tool recognizes the division operator as a comment. Check the following content to determine whether it is a comment. Change-Id: Id07c6668489895b45a1042794bc3acca66cd3c47 Signed-off-by: yangjiukui --- tools/nxstyle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/nxstyle.c b/tools/nxstyle.c index 3105e3ff70..978ab78955 100644 --- a/tools/nxstyle.c +++ b/tools/nxstyle.c @@ -2832,7 +2832,9 @@ int main(int argc, char **argv, char **envp) */ if ((bstatm || /* Begins with C keyword */ - (line[indent] == '/' && bfunctions)) && /* Comment in functions */ + (line[indent] == '/' && + bfunctions && + line[indent + 1] == '*')) && /* Comment in functions */ !bswitch && /* Not in a switch */ dnest == 0) /* Not a data definition */ {