From commits-return-4873-archive-asf-public=cust-asf.ponee.io@nuttx.apache.org Fri Mar 13 13:59:01 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 89A5418062C for ; Fri, 13 Mar 2020 14:59:01 +0100 (CET) Received: (qmail 85943 invoked by uid 500); 13 Mar 2020 13:59:00 -0000 Mailing-List: contact commits-help@nuttx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nuttx.apache.org Delivered-To: mailing list commits@nuttx.apache.org Received: (qmail 85934 invoked by uid 99); 13 Mar 2020 13:59:00 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2020 13:59:00 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id C830D8DACA; Fri, 13 Mar 2020 13:59:00 +0000 (UTC) Date: Fri, 13 Mar 2020 13:59:00 +0000 To: "commits@nuttx.apache.org" Subject: [incubator-nuttx] branch master updated: Handling of struct initializers changed. Break conditionals with || at the end. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <158410794073.18791.2460376300001685557@gitbox.apache.org> From: gnutt@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-nuttx X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 4686d7cf57ea94e8cbf87428f1b0c7da6b15f42c X-Git-Newrev: 645cf6d547cba8694c8598828037181f612b8231 X-Git-Rev: 645cf6d547cba8694c8598828037181f612b8231 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 645cf6d Handling of struct initializers changed. Break conditionals with || at the end. 645cf6d is described below commit 645cf6d547cba8694c8598828037181f612b8231 Author: Johanne Schock AuthorDate: Thu Mar 12 21:11:12 2020 +0100 Handling of struct initializers changed. Break conditionals with || at the end. --- tools/nxstyle.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/nxstyle.c b/tools/nxstyle.c index f379724..da536f8 100644 --- a/tools/nxstyle.c +++ b/tools/nxstyle.c @@ -751,7 +751,8 @@ int main(int argc, char **argv, char **envp) * another right brace, or a pre-processor directive like #endif */ - if (strchr(line, '}') == NULL && line[n] != '#' && + if (dnest == 0 && + strchr(line, '}') == NULL && line[n] != '#' && strncmp(&line[n], "else", 4) != 0 && strncmp(&line[n], "while", 5) != 0 && strncmp(&line[n], "break", 5) != 0) @@ -967,8 +968,8 @@ int main(int argc, char **argv, char **envp) rhcomment = -1; - if (ncomment > 0 && (!strncmp(&line[ii], "if", 2) - || !strncmp(&line[ii], "el", 2))) + if (ncomment > 0 && (strncmp(&line[ii], "if", 2) == 0 || + strncmp(&line[ii], "el", 2) == 0)) { /* in #if... and #el.. */ @@ -1608,7 +1609,7 @@ int main(int argc, char **argv, char **envp) { /* REVISIT: dnest is always > 0 here if bfunctions == false */ - if (dnest == 0 || !bfunctions) + if (dnest == 0 || !bfunctions || lineno == rbrace_lineno) { ERROR("Left bracket not on separate line", lineno, n); @@ -1754,6 +1755,13 @@ int main(int argc, char **argv, char **envp) lineno, endx); } } + else if (line[endx] == '=') + { + /* There's a struct initialization following */ + + check_spaces_leftright(line, lineno, endx, endx); + dnest = 1; + } else { ERROR("Garbage follows right bracket",