From patchwork Mon Aug 20 13:16:41 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schwarzott X-Patchwork-Id: 12510 Received: from mail-out.m-online.net ([212.18.0.10]) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1IN77d-0001vB-SE for vdr@linuxtv.org; Mon, 20 Aug 2007 15:16:45 +0200 Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 9F984223B98 for ; Mon, 20 Aug 2007 15:16:43 +0200 (CEST) Received: from gauss.x.fun (DSL01.83.171.166.63.ip-pool.NEFkom.net [83.171.166.63]) by mail.nefkom.net (Postfix) with ESMTP id 77F4890150 for ; Mon, 20 Aug 2007 15:16:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by gauss.x.fun (Postfix) with ESMTP id F07AA1761DA for ; Mon, 20 Aug 2007 15:16:42 +0200 (CEST) From: Matthias Schwarzott To: vdr@linuxtv.org Date: Mon, 20 Aug 2007 15:16:41 +0200 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Message-Id: <200708201516.42228.zzam@gentoo.org> Subject: [vdr] [PATCH] Fix compiler warnings with gcc-4.2.0 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2007 13:16:46 -0000 Status: O X-Status: X-Keywords: X-UID: 13854 Hi there! This patch fixes a compiler warning gcc-4.2.0 now prints. This is about assigning constant strings to non-const char variables. Matthias Index: vdr-1.5.7/i18n.c =================================================================== --- vdr-1.5.7.orig/i18n.c +++ vdr-1.5.7/i18n.c @@ -61,7 +61,7 @@ const char *LanguageCodeList[] = { NULL }; -static char *I18nLocaleDir = LOCDIR; +static const char *I18nLocaleDir = LOCDIR; static cStringList LanguageLocales; static cStringList LanguageNames; Index: vdr-1.5.7/keys.h =================================================================== --- vdr-1.5.7.orig/keys.h +++ vdr-1.5.7/keys.h @@ -82,7 +82,7 @@ enum eKeys { // "Up" and "Down" must be struct tKey { eKeys type; - char *name; + const char *name; }; class cKey : public cListObject { Index: vdr-1.5.7/menu.c =================================================================== --- vdr-1.5.7.orig/menu.c +++ vdr-1.5.7/menu.c @@ -1040,7 +1040,7 @@ int cMenuScheduleItem::Compare(const cLi return r; } -static char *TimerMatchChars = " tT"; +static const char *TimerMatchChars = " tT"; bool cMenuScheduleItem::Update(bool Force) { Index: vdr-1.5.7/rcu.c =================================================================== --- vdr-1.5.7.orig/rcu.c +++ vdr-1.5.7/rcu.c @@ -257,7 +257,7 @@ void cRcuRemote::SetNumber(int n, bool H data = m; } -void cRcuRemote::SetString(char *s) +void cRcuRemote::SetString(const char *s) { const char *chars = mode == modeH ? "0123456789ABCDEF" : "0123456789-EHLP "; int n = 0; Index: vdr-1.5.7/rcu.h =================================================================== --- vdr-1.5.7.orig/rcu.h +++ vdr-1.5.7/rcu.h @@ -31,7 +31,7 @@ private: void SetMode(unsigned char Mode); void SetNumber(int n, bool Hex = false); void SetPoints(unsigned char Dp, bool On); - void SetString(char *s); + void SetString(const char *s); bool DetectCode(unsigned char *Code); virtual void Action(void); virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber); Index: vdr-1.5.7/thread.c =================================================================== --- vdr-1.5.7.orig/thread.c +++ vdr-1.5.7/thread.c @@ -416,7 +416,7 @@ bool cPipe::Open(const char *Command, co return false; } - char *mode = "w"; + const char *mode = "w"; int iopipe = 0; if (pid > 0) { // parent process