[PATCH] Fix compiler warnings with gcc-4.2.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Matthias Schwarzott (zzam)
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
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux