From patchwork Fri Mar 31 01:44:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 9655381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BB26260113 for ; Fri, 31 Mar 2017 01:46:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD8C728617 for ; Fri, 31 Mar 2017 01:46:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A25FD28693; Fri, 31 Mar 2017 01:46:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 594F928617 for ; Fri, 31 Mar 2017 01:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934785AbdCaBqj (ORCPT ); Thu, 30 Mar 2017 21:46:39 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:35160 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934997AbdCaBqi (ORCPT ); Thu, 30 Mar 2017 21:46:38 -0400 Received: by mail-wr0-f194.google.com with SMTP id p52so16621355wrc.2 for ; Thu, 30 Mar 2017 18:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EcAQSxIEida0rMSAcOM261KdQdwRaFyJeJV657NqJno=; b=qJxIKoGBA9M4dWgqeR7VP8fJHcwrjqtY4xKvoDoVWquoCBlj9UO3vMquXypFKIjbjB Zje58Ppmci5VnJ5x0kJNZS59SCQSBt8Byg1htEdk9QNs38KBudl70+SwIi4u8AomwyjJ waKhhAYTprWoIOY4mmkV6t9o9KWcjhunQ5omv6No7i9i1Ad0E4FkgFtD8fgG4mcm+SlO GdNwC5SueQ05GbC6hzl8wlIdIe8qEzJGmi8Cuv5OqKpQx/L84jYm47RCLBiDaQxzrBNc TYojZrERx4D4jFejKorusLoqjnyQPlDOzBaK8j9QH9MY1u9zx7u6ezx6lyebltPROPrz DXQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EcAQSxIEida0rMSAcOM261KdQdwRaFyJeJV657NqJno=; b=cxkOK1NjPp5P1ingi9V1hvwCtToT2uDDF9cC5nX0FjqkSMFwsVuZH+Dd+y+GlM3FJX A3d2ymqlKNmS9M6Qr+4iPfN87CLdzDIl8ivJG5G+ytgyMm330C+usk/5qemwOjbnrZC6 s2TswRWCl2IJmX/62M8HwzXXxP8vmKBD/fjYk1wrcISwdrMV9hDwmxgPXmSk28YpOFOa +5y0ok2pLXfR6QeaatHm+j+rlmfMcei2DIK2KQdvuYpEJPwATYCF9R552erPgIf8kY6W fiVGQdMpDb+DiaoyeN72lO9ZiY9EBzwnOxUPjc02vrXWmAKHC8y+hyFRSV51HTOzMc0/ hiSQ== X-Gm-Message-State: AFeK/H06tvajcwacunNpZ+mJniVhb+/mJFgag+l9ag2qMF2mnSYP/woQ0uQW4W7cFCA+Cg== X-Received: by 10.223.153.108 with SMTP id x99mr339114wrb.55.1490924796432; Thu, 30 Mar 2017 18:46:36 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:88d:1900:cdad:92b8:5279:ae19]) by smtp.gmail.com with ESMTPSA id 189sm917023wmm.31.2017.03.30.18.46.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 18:46:35 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Christopher Li , Nicolai Stange , Luc Van Oostenryck Subject: [PATCH v4 09/25] constexpr: rename handle_simple_initializer() to handle_initializer() Date: Fri, 31 Mar 2017 03:44:43 +0200 Message-Id: <20170331014459.9351-10-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170331014459.9351-1-luc.vanoostenryck@gmail.com> References: <20170331014459.9351-1-luc.vanoostenryck@gmail.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This function, with a quite long name, not only handle simple initializer but also complex ones. So, rename it to the shorter and more correct form. Signed-off-by: Luc Van Oostenryck --- evaluate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/evaluate.c b/evaluate.c index 68a2d5ebf..07edda41b 100644 --- a/evaluate.c +++ b/evaluate.c @@ -2450,7 +2450,7 @@ static struct expression *next_designators(struct expression *old, return new; } -static int handle_simple_initializer(struct expression **ep, int nested, +static int handle_initializer(struct expression **ep, int nested, int class, struct symbol *ctype); /* @@ -2515,7 +2515,7 @@ found: else v = &top->ident_expression; - if (handle_simple_initializer(v, 1, lclass, top->ctype)) + if (handle_initializer(v, 1, lclass, top->ctype)) continue; if (!(lclass & TYPE_COMPOUND)) { @@ -2607,7 +2607,7 @@ static struct expression *handle_scalar(struct expression *e, int nested) * { "string", ...} - we need to preserve that string literal recognizable * until we dig into the inner struct. */ -static int handle_simple_initializer(struct expression **ep, int nested, +static int handle_initializer(struct expression **ep, int nested, int class, struct symbol *ctype) { int is_string = is_string_type(ctype); @@ -2696,7 +2696,7 @@ static void evaluate_initializer(struct symbol *ctype, struct expression **ep) { struct symbol *type; int class = classify_type(ctype, &type); - if (!handle_simple_initializer(ep, 0, class, ctype)) + if (!handle_initializer(ep, 0, class, ctype)) expression_error(*ep, "invalid initializer"); }