From patchwork Thu Oct 20 05:38:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Che-liang Chiou X-Patchwork-Id: 120723 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7A8B3B6FAF for ; Thu, 20 Oct 2011 16:39:45 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AE8D628DF1; Thu, 20 Oct 2011 07:39:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FgQ3pSde-Pde; Thu, 20 Oct 2011 07:39:32 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9128F28DF7; Thu, 20 Oct 2011 07:39:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0222D28839 for ; Thu, 20 Oct 2011 07:39:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2vOnGyJcZzDj for ; Thu, 20 Oct 2011 07:39:07 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by theia.denx.de (Postfix) with ESMTPS id 6176C28801 for ; Thu, 20 Oct 2011 07:39:05 +0200 (CEST) Received: by yxj19 with SMTP id 19so2388181yxj.3 for ; Wed, 19 Oct 2011 22:39:04 -0700 (PDT) Received: by 10.236.131.40 with SMTP id l28mr14014039yhi.6.1319089144697; Wed, 19 Oct 2011 22:39:04 -0700 (PDT) Received: from localhost.localdomain (weier.tpe.corp.google.com [172.30.210.5]) by mx.google.com with ESMTPS id w69sm12285070yhl.15.2011.10.19.22.39.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Oct 2011 22:39:04 -0700 (PDT) From: Che-Liang Chiou To: u-boot@lists.denx.de Date: Thu, 20 Oct 2011 13:38:45 +0800 Message-Id: <1319089126-7358-3-git-send-email-clchiou@chromium.org> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1319089126-7358-1-git-send-email-clchiou@chromium.org> References: <1319089126-7358-1-git-send-email-clchiou@chromium.org> In-Reply-To: References: Subject: [U-Boot] [PATCH V4 2/3] tools: logo: add static and unused to bmp arrays X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The generated header bmp_logo.h is useful even outside common/lcd.c for the logo dimension. However, the problem is, the generated bmp_logo.h cannot be included multiple times because bmp_logo_palette[] and bmp_logo_bitmap[] are defined in the bmp_logo.h. We may remedy this by adding static __attribute__((unused)) to the array definitions so that bmp_logo.h can be included multiple times, and these arrays is used in only one inclusion (lcd.c). Signed-off-by: Che-Liang Chiou --- Changes in V4 None Changes in V3 Add to the patch set tools/bmp_logo.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/bmp_logo.c b/tools/bmp_logo.c index 47228d2..3d11284 100644 --- a/tools/bmp_logo.c +++ b/tools/bmp_logo.c @@ -113,7 +113,8 @@ int main (int argc, char *argv[]) error ("Error allocating memory for file", fp); /* read and print the palette information */ - printf ("unsigned short bmp_logo_palette[] = {\n"); + printf("static __attribute__((unused)) " + "unsigned short bmp_logo_palette[] = {\n"); for (i=0; ipalette[(int)(i*3+2)] = fgetc(fp); @@ -137,7 +138,8 @@ int main (int argc, char *argv[]) printf ("\n"); printf ("};\n"); printf ("\n"); - printf ("unsigned char bmp_logo_bitmap[] = {\n"); + printf("static __attribute__((unused)) " + "unsigned char bmp_logo_bitmap[] = {\n"); for (i=(b->height-1)*b->width; i>=0; i-=b->width) { for (x = 0; x < b->width; x++) { b->data[(uint16_t) i + x] = (uint8_t) fgetc (fp) \