From 45a8edd227c4326ef70f755514a8db6069c3789f Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 6 Mar 2020 15:16:25 +0900 Subject: [PATCH] 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 66bdb493dd..5a993c361a 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; }