This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 45a8edd  nxstyle: Output line numbers when complaining on block 
comments length
45a8edd is described below

commit 45a8edd227c4326ef70f755514a8db6069c3789f
Author: YAMAMOTO Takashi <[email protected]>
AuthorDate: Fri Mar 6 15:16:25 2020 +0900

    nxstyle: Output line numbers when complaining on block comments length
---
 tools/nxstyle.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/nxstyle.c b/tools/nxstyle.c
index 66bdb49..5a993c3 100644
--- a/tools/nxstyle.c
+++ b/tools/nxstyle.c
@@ -406,21 +406,27 @@ static int get_line_width(FILE *instream)
   char line[LINE_SIZE]; /* The current line being examined */
   int max = 0;
   int min = INT_MAX;
+  int lineno = 0;
+  int lineno_max;
+  int lineno_min;
   int len;
 
   while (fgets(line, LINE_SIZE, instream))
     {
+      lineno++;
       len = block_comment_width(line);
       if (len > 0)
         {
           if (len > max)
             {
               max = len;
+              lineno_max = lineno;
             }
 
           if (len < min)
             {
               min = len;
+              lineno_min = lineno_min;
             }
         }
     }
@@ -432,7 +438,8 @@ static int get_line_width(FILE *instream)
     }
   else if (max != min)
     {
-      ERRORFL("Block comments have different lengths", g_file_name);
+      ERROR("Block comments have different lengths", lineno_max, max);
+      ERROR("Block comments have different lengths", lineno_min, min);
       return DEFAULT_WIDTH;
     }
 

Reply via email to