From e1730a134f0c2f1ca8f4383b62d6c2798d9e567f Mon Sep 17 00:00:00 2001 From: Andreas Oberritter Date: Tue, 25 Mar 2008 22:57:37 +0000 Subject: [PATCH] fix deprecated conversion from string constant to char* by using const char* instead where possible --- lib/base/init.h | 10 +++++----- lib/driver/avswitch.cpp | 24 ++++++++++++------------ lib/dvb/epgcache.cpp | 6 +++--- lib/gui/evideo.cpp | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/base/init.h b/lib/base/init.h index 6ffd04c7..4b40bea0 100644 --- a/lib/base/init.h +++ b/lib/base/init.h @@ -27,9 +27,9 @@ class eAutoInit virtual void closeNow()=0; protected: int rl; - char *description; + const char *description; public: - eAutoInit(int rl, char *description): rl(rl), description(description) + eAutoInit(int rl, const char *description): rl(rl), description(description) { } virtual ~eAutoInit(); @@ -54,7 +54,7 @@ public: { return t; } - eAutoInitP1(const T2 &arg, int runl, char *description): eAutoInit(runl, description), arg(arg) + eAutoInitP1(const T2 &arg, int runl, const char *description): eAutoInit(runl, description), arg(arg) { eInit::add(rl, this); } @@ -85,7 +85,7 @@ public: { return t; } - eAutoInitP0(int runl, char *description): eAutoInit(runl, description) + eAutoInitP0(int runl, const char *description): eAutoInit(runl, description) { eInit::add(rl, this); } @@ -116,7 +116,7 @@ public: { return t; } - eAutoInitPtr(int runl, char *description): eAutoInit(runl, description) + eAutoInitPtr(int runl, const char *description): eAutoInit(runl, description) { eInit::add(rl, this); } diff --git a/lib/driver/avswitch.cpp b/lib/driver/avswitch.cpp index a936aa54..0fc53da5 100644 --- a/lib/driver/avswitch.cpp +++ b/lib/driver/avswitch.cpp @@ -103,7 +103,7 @@ void eAVSwitch::setInput(int val) 2-aux */ - char *input[] = {"encoder", "scart", "aux"}; + const char *input[] = {"encoder", "scart", "aux"}; int fd; @@ -122,7 +122,7 @@ void eAVSwitch::setInput(int val) void eAVSwitch::setFastBlank(int val) { int fd; - char *fb[] = {"low", "high", "vcr"}; + const char *fb[] = {"low", "high", "vcr"}; if((fd = open("/proc/stb/avs/0/fb", O_WRONLY)) < 0) { eDebug("cannot open /proc/stb/avs/0/fb"); @@ -140,10 +140,10 @@ void eAVSwitch::setColorFormat(int format) 1-RGB 2-S-Video */ - char *cvbs="cvbs"; - char *rgb="rgb"; - char *svideo="svideo"; - char *yuv="yuv"; + const char *cvbs="cvbs"; + const char *rgb="rgb"; + const char *svideo="svideo"; + const char *yuv="yuv"; int fd; if((fd = open("/proc/stb/avs/0/colorformat", O_WRONLY)) < 0) { @@ -178,8 +178,8 @@ void eAVSwitch::setAspectRatio(int ratio) 5-16:10 PanScan 6-16:9 forced ("letterbox") */ - char *aspect[] = {"4:3", "4:3", "any", "16:9", "16:10", "16:10", "16:9", "16:9"}; - char *policy[] = {"letterbox", "panscan", "bestfit", "panscan", "letterbox", "panscan", "letterbox"}; + const char *aspect[] = {"4:3", "4:3", "any", "16:9", "16:10", "16:10", "16:9", "16:9"}; + const char *policy[] = {"letterbox", "panscan", "bestfit", "panscan", "letterbox", "panscan", "letterbox"}; int fd; if((fd = open("/proc/stb/video/aspect", O_WRONLY)) < 0) { @@ -202,8 +202,8 @@ void eAVSwitch::setAspectRatio(int ratio) void eAVSwitch::setVideomode(int mode) { - char *pal="pal"; - char *ntsc="ntsc"; + const char *pal="pal"; + const char *ntsc="ntsc"; if (mode == m_video_mode) return; @@ -256,7 +256,7 @@ void eAVSwitch::setWSS(int val) // 0 = auto, 1 = auto(4:3_off) eDebug("cannot open /proc/stb/denc/0/wss"); return; } - char *wss[] = { + const char *wss[] = { "off", "auto", "auto(4:3_off)", "4:3_full_format", "16:9_full_format", "14:9_letterbox_center", "14:9_letterbox_top", "16:9_letterbox_center", "16:9_letterbox_top", ">16:9_letterbox_center", "14:9_full_format" @@ -273,7 +273,7 @@ void eAVSwitch::setSlowblank(int val) eDebug("cannot open /proc/stb/avs/0/sb"); return; } - char *sb[] = {"0", "6", "12", "vcr", "auto"}; + const char *sb[] = {"0", "6", "12", "vcr", "auto"}; write(fd, sb[val], strlen(sb[val])); // eDebug("set slow blanking to %s", sb[val]); close(fd); diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index e70ed0ab..cab02201 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -1600,7 +1600,7 @@ RESULT eEPGCache::getNextTimeEntry(ePtr &result) return -1; } -void fillTuple(ePyObject tuple, char *argstring, int argcount, ePyObject service, eServiceEvent *ptr, ePyObject nowTime, ePyObject service_name ) +void fillTuple(ePyObject tuple, const char *argstring, int argcount, ePyObject service, eServiceEvent *ptr, ePyObject nowTime, ePyObject service_name ) { ePyObject tmp; int spos=0, tpos=0; @@ -1661,7 +1661,7 @@ void fillTuple(ePyObject tuple, char *argstring, int argcount, ePyObject service } } -int handleEvent(eServiceEvent *ptr, ePyObject dest_list, char* argstring, int argcount, ePyObject service, ePyObject nowTime, ePyObject service_name, ePyObject convertFunc, ePyObject convertFuncArgs) +int handleEvent(eServiceEvent *ptr, ePyObject dest_list, const char* argstring, int argcount, ePyObject service, ePyObject nowTime, ePyObject service_name, ePyObject convertFunc, ePyObject convertFuncArgs) { if (convertFunc) { @@ -1725,7 +1725,7 @@ PyObject *eEPGCache::lookupEvent(ePyObject list, ePyObject convertFunc) { ePyObject convertFuncArgs; int argcount=0; - char *argstring=NULL; + const char *argstring=NULL; if (!PyList_Check(list)) { PyErr_SetString(PyExc_StandardError, diff --git a/lib/gui/evideo.cpp b/lib/gui/evideo.cpp index f7f16803..328d95e4 100644 --- a/lib/gui/evideo.cpp +++ b/lib/gui/evideo.cpp @@ -40,7 +40,7 @@ void eVideoWidget::updatePosition(int disable) for (int i=0; i<4; ++i) { - char *targets[]={"left", "top", "width", "height"}; + const char *targets[]={"left", "top", "width", "height"}; char filename[128]; snprintf(filename, 128, "/proc/stb/vmpeg/%d/dst_%s", m_decoder, targets[i]); FILE *f = fopen(filename, "w"); -- 2.30.2