]> git.vomp.tv Git - vompserver.git/commitdiff
Fixes for new compiler with const char*, and fix for vdr 1.5
authorChris Tallon <chris@vomp.tv>
Mon, 29 Oct 2007 21:16:27 +0000 (21:16 +0000)
committerChris Tallon <chris@vomp.tv>
Mon, 29 Oct 2007 21:16:27 +0000 (21:16 +0000)
config.c
config.h
dsock.c
dsock.h
log.c
log.h
mvpclient.c
mvpreceiver.c

index 08a217a5ff393874b0d5d34fed2c313ba8adab4f..d4772e17d42b592c72b84389dac2a3f01e0092ac 100644 (file)
--- a/config.c
+++ b/config.c
@@ -164,7 +164,7 @@ int Config::copyRest(FILE* newFile)
   return 1;
 }
 
-int Config::deleteValue(char* section, char* key)
+int Config::deleteValue(const char* section, char* key)
 {
   if (!initted) return 0;
   if (!openFile()) return 0;
@@ -188,7 +188,7 @@ int Config::deleteValue(char* section, char* key)
   return copyRest(newFile);
 }
 
-int Config::setValueLong(char* section, char* key, long newValue)
+int Config::setValueLong(const char* section, char* key, long newValue)
 {
   char longBuffer[50];
   sprintf(longBuffer, "%li", newValue);
@@ -209,7 +209,7 @@ int Config::setValueDouble(char* section, char* key, double newValue)
   return setValueString(section, key, doubleBuffer);
 }
 
-int Config::setValueString(char* section, char* key, char* newValue)
+int Config::setValueString(const char* section, const char* key, const char* newValue)
 {
   if (!initted) return 0;
   if (!openFile()) return 0;
@@ -263,7 +263,7 @@ int Config::setValueString(char* section, char* key, char* newValue)
   }
 }
 
-char* Config::getSectionKeyNames(char* section, int& numberOfReturns, int& allKeysSize)
+char* Config::getSectionKeyNames(const char* section, int& numberOfReturns, int& allKeysSize)
 {
   numberOfReturns = 0;
   allKeysSize = 0;
@@ -305,7 +305,7 @@ char* Config::getSectionKeyNames(char* section, int& numberOfReturns, int& allKe
 
 // END HERE
 
-int Config::findSection(char* section)
+int Config::findSection(const char* section)
 {
   if (!initted || !file) return 0;
   if (strlen(section) > (BUFFER_LENGTH-2))
@@ -328,7 +328,7 @@ int Config::findSection(char* section)
   return 0;
 }
 
-int Config::findKey(char* key)
+int Config::findKey(const char* key)
 {
   if (!initted || !file) return 0;
 
@@ -369,7 +369,7 @@ int Config::findKey(char* key)
   return 0;
 }
 
-char* Config::getValueString(char* section, char* key)
+char* Config::getValueString(const char* section, const char* key)
 {
   if (!initted) return NULL;
   if (!openFile()) return NULL;
@@ -395,7 +395,7 @@ char* Config::getValueString(char* section, char* key)
   return returnString;
 }
 
-long Config::getValueLong(char* section, char* key, int* failure)
+long Config::getValueLong(const char* section, const char* key, int* failure)
 {
   *failure = 1;
   if (!initted) return 0;
index 58c92d442a2ee3c6b4cc9bad21823b0f9940b468..e93c221d1138cc1af8e2429a7fe338c7fd2500fa 100644 (file)
--- a/config.h
+++ b/config.h
@@ -42,18 +42,18 @@ class Config
     int shutdown();
     int status();
 
-    char* getValueString(char* section, char* key);
-    long getValueLong(char* section, char* key, int* failure);
+    char* getValueString(const char* section, const char* key);
+    long getValueLong(const char* section, const char* key, int* failure);
     long long getValueLongLong(char* section, char* key, int* failure);
     double getValueDouble(char* section, char* key, int* failure);
 
-    int setValueString(char* section, char* key, char* newValue);
-    int setValueLong(char* section, char* key, long newValue);
+    int setValueString(const char* section, const char* key, const char* newValue);
+    int setValueLong(const char* section, char* key, long newValue);
     int setValueLongLong(char* section, char* key, long long newValue);
     int setValueDouble(char* section, char* key, double newValue);
 
-    int deleteValue(char* section, char* key); // err.. delete "key".
-    char* getSectionKeyNames(char* section, int& numberOfReturns, int& length);
+    int deleteValue(const char* section, char* key); // err.. delete "key".
+    char* getSectionKeyNames(const char* section, int& numberOfReturns, int& length);
 
   private:
     pthread_mutex_t fileLock;
@@ -70,8 +70,8 @@ class Config
     int openFile();
     void closeFile();
     int readLine();
-    int findSection(char* section);
-    int findKey(char* key);
+    int findSection(const char* section);
+    int findKey(const char* key);
     void trim(char* sting);
     FILE* copyToHere(long position);
     int copyRest(FILE* newFile);
diff --git a/dsock.c b/dsock.c
index 4e7b8d96bc79cc410463ca3dd537427d11046eaa..cd8c880e84d8230f467fcb6d7c74ee4628603ec1 100644 (file)
--- a/dsock.c
+++ b/dsock.c
@@ -126,7 +126,7 @@ unsigned char DatagramSocket::waitforMessage(unsigned char how)
   */
 }
 
-void DatagramSocket::send(char *ipa, USHORT port, char *message, int length)
+void DatagramSocket::send(const char *ipa, USHORT port, char *message, int length)
 {
   int sentLength = 0;
 
diff --git a/dsock.h b/dsock.h
index 9ce3b9d6aa52fa5b1ebcfddb5af36b6cebcb3008..ba67360fe056de0f43b765132386a91595cf4fb6 100644 (file)
--- a/dsock.h
+++ b/dsock.h
@@ -47,7 +47,7 @@ class DatagramSocket
     bool init(USHORT);                 // port
     void shutdown();
     unsigned char waitforMessage(unsigned char); // int =0-block =1-new wait =2-continue wait
-    void send(char *, USHORT, char *, int); // send wants: IP Address ddn style, port,
+    void send(const char *, USHORT, char *, int); // send wants: IP Address ddn style, port,
                                             // data, length of data
 
     char*  getData(void)             { return buf; }      // returns a pointer to the data
diff --git a/log.c b/log.c
index a3cb8ce5b9749722541f039e082a62c4e99c4b97..335d27d530edfda9ea92277efd63481d091f9147 100755 (executable)
--- a/log.c
+++ b/log.c
@@ -94,7 +94,7 @@ int Log::shutdown()
   return 1;
 }
 
-int Log::log(char *fromModule, int level, char* message, ...)
+int Log::log(const char *fromModule, int level, const char* message, ...)
 {
   if (!initted) return 0;
 
diff --git a/log.h b/log.h
index 6e4316b09121f7114b49b4d1f6ef0116a7a53b2e..6946ade12b76ea3cc9cc2143a09fa9d0a0840878 100755 (executable)
--- a/log.h
+++ b/log.h
@@ -37,7 +37,7 @@ class Log
 
     int init(int defaultLevel, char* fileName);
     int shutdown();
-    int log(char *fromModule, int level, char *message, ...);
+    int log(const char *fromModule, int level, const char *message, ...);
     void upLogLevel();
     void downLogLevel();
 
index 6a8c4840e821091c09336b963d108b7f84c2cc9f..52602404e1f0023bed12f9bce1e61098c245ec39 100644 (file)
@@ -1006,7 +1006,7 @@ int MVPClient::processGetChannelSchedule(UCHAR* data, int length)
   ULONG sendBufferLength = 100000;
   ULONG sendBufferUsed = sizeof(ULONG); // leave a hole for the entire packet length
 
-  char* empty = "";
+  const char* empty = "";
 
   // assign all the event info to temp vars then we know exactly what size they are
   ULONG thisEventID;
index ff8b3b0a199e8709f680cde144d32217abd5ead8..a7dccea3b022e84d2c80cb6dfbd0be7a32c2d505 100755 (executable)
@@ -25,8 +25,10 @@ MVPReceiver* MVPReceiver::create(cChannel* channel, int priority)
 MVPReceiver::MVPReceiver(cChannel* channel, cDevice* device)
 #if VDRVERSNUM < 10300
 : cReceiver(channel->Ca(), 0, 7, channel->Vpid(), channel->Ppid(), channel->Apid1(), channel->Apid2(), channel->Dpid1(), channel->Dpid2(), channel->Tpid())
-#else
+#elif VDRVERSNUM < 10500
 : cReceiver(channel->Ca(), 0, channel->Vpid(), channel->Apids(), channel->Dpids(), channel->Spids())
+#else
+: cReceiver(channel->GetChannelID(), 0, channel->Vpid(), channel->Apids(), channel->Dpids(), channel->Spids())
 #endif
 {
   logger = Log::getInstance();