diff --git a/lib/xmltree/xmlinterface.cpp b/lib/xmltree/xmlinterface.cpp index 82d262534..47a4647f7 100644 --- a/lib/xmltree/xmlinterface.cpp +++ b/lib/xmltree/xmlinterface.cpp @@ -1,5 +1,5 @@ /* - * $Header: /cvs/tuxbox/apps/dvb/zapit/src/xmlinterface.cpp,v 1.25 2004/04/07 19:33:21 thegoodguy Exp $ + * $Header: /cvs/tuxbox/apps/misc/libs/libxmltree/xmlinterface.cpp,v 1.3 2009/02/18 17:51:55 seife Exp $ * * xmlinterface for zapit - d-box2 linux project * @@ -18,14 +18,22 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + + + * those files (xmlinterface.cpp and xmlinterface.h) lived at three different places + in the tuxbox-cvs before, so look there for history information: + - apps/dvb/zapit/include/zapit/xmlinterface.h + - apps/dvb/zapit/src/xmlinterface.cpp + - apps/tuxbox/neutrino/daemons/sectionsd/xmlinterface.cpp + - apps/tuxbox/neutrino/src/system/xmlinterface.cpp + - apps/tuxbox/neutrino/src/system/xmlinterface.h */ #include -#include #include +#include -#include +#include "xmlinterface.h" #ifdef USE_LIBXML #include @@ -36,7 +44,7 @@ #endif /* USE_LIBXML */ -unsigned long xmlGetNumericAttribute(const xmlNodePtr node, char *name, const int base) +unsigned long xmlGetNumericAttribute(const xmlNodePtr node, const char *name, const int base) { char *ptr = xmlGetAttribute(node, name); @@ -46,7 +54,7 @@ unsigned long xmlGetNumericAttribute(const xmlNodePtr node, char *name, const in return strtoul(ptr, 0, base); } -long xmlGetSignedNumericAttribute(const xmlNodePtr node, char *name, const int base) +long xmlGetSignedNumericAttribute(const xmlNodePtr node, const char *name, const int base) { char *ptr = xmlGetAttribute(node, name); @@ -77,17 +85,53 @@ std::string Unicode_Character_to_UTF8(const int character) #endif /* USE_LIBXML */ } +std::string convert_UTF8_To_UTF8_XML(const char* s) +{ + std::string r; + + while ((*s) != 0) + { + /* cf. + * http://www.w3.org/TR/2004/REC-xml-20040204/#syntax + * and + * http://www.w3.org/TR/2004/REC-xml-20040204/#sec-predefined-ent + */ + switch (*s) + { + case '<': + r += "<"; + break; + case '>': + r += ">"; + break; + case '&': + r += "&"; + break; + case '\"': + r += """; + break; + case '\'': + r += "'"; + break; + default: + r += *s; + } + s++; + } + return r; +} + #ifdef USE_LIBXML -xmlDocPtr parseXmlFile(const char * filename) +xmlDocPtr parseXml(const char * data) { xmlDocPtr doc; xmlNodePtr cur; - - doc = xmlParseFile(filename); + + doc = xmlParseMemory(data, strlen(data)); if (doc == NULL) { - WARN("Error parsing \"%s\"", filename); + WARN("Error parsing XML Data"); return NULL; } else @@ -103,6 +147,32 @@ xmlDocPtr parseXmlFile(const char * filename) return doc; } } + +xmlDocPtr parseXmlFile(const char * filename, bool warning_by_nonexistence /* = true */) +{ + xmlDocPtr doc; + xmlNodePtr cur; + + doc = xmlParseFile(filename); + + if (doc == NULL) + { + fprintf(stderr, "%s: Error parsing \"%s\"", __FUNCTION__, filename); + return NULL; + } + else + { + cur = xmlDocGetRootElement(doc); + if (cur == NULL) + { + fprintf(stderr, "%s: Empty document\n", __FUNCTION__); + xmlFreeDoc(doc); + return NULL; + } + else + return doc; + } +} #else /* USE_LIBXML */ xmlDocPtr parseXml(const char * data) { @@ -112,24 +182,24 @@ xmlDocPtr parseXml(const char * data) if (!tree_parser->Parse(data, strlen(data), true)) { - printf("Error parsing XML Data: %s at line %d\n", - tree_parser->ErrorString(tree_parser->GetErrorCode()), - tree_parser->GetCurrentLineNumber()); + printf("Error parsing XML Data: %s at line %d\n", + tree_parser->ErrorString(tree_parser->GetErrorCode()), + tree_parser->GetCurrentLineNumber()); - delete tree_parser; - return NULL; - } + delete tree_parser; + return NULL; + } if (!tree_parser->RootNode()) { - printf("Error: No Root Node\n"); + printf("Error: No Root Node\n"); delete tree_parser; return NULL; } return tree_parser; } -xmlDocPtr parseXmlFile(const char * filename) +xmlDocPtr parseXmlFile(const char * filename, bool warning_by_nonexistence /* = true */) { char buffer[2048]; XMLTreeParser* tree_parser; @@ -141,7 +211,8 @@ xmlDocPtr parseXmlFile(const char * filename) if (xml_file == NULL) { - perror(filename); + if (warning_by_nonexistence) + perror(filename); return NULL; } @@ -154,10 +225,11 @@ xmlDocPtr parseXmlFile(const char * filename) if (!tree_parser->Parse(buffer, length, done)) { - printf("Error parsing \"%s\": %s at line %d\n", - filename, - tree_parser->ErrorString(tree_parser->GetErrorCode()), - tree_parser->GetCurrentLineNumber()); + fprintf(stderr, "%s: Error parsing \"%s\": %s at line %d\n", + __FUNCTION__, + filename, + tree_parser->ErrorString(tree_parser->GetErrorCode()), + tree_parser->GetCurrentLineNumber()); fclose(xml_file); delete tree_parser; diff --git a/lib/xmltree/xmlinterface.h b/lib/xmltree/xmlinterface.h index c1faddd46..cf3736f40 100644 --- a/lib/xmltree/xmlinterface.h +++ b/lib/xmltree/xmlinterface.h @@ -1,5 +1,5 @@ /* - * $Header: /cvs/tuxbox/apps/dvb/zapit/include/zapit/xmlinterface.h,v 1.21 2004/04/07 19:33:21 thegoodguy Exp $ + * $Header: /cvs/tuxbox/apps/misc/libs/libxmltree/xmlinterface.h,v 1.2 2009/02/18 17:51:55 seife Exp $ * * xmlinterface for zapit - d-box2 linux project * @@ -18,7 +18,15 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + + + * those files (xmlinterface.cpp and xmlinterface.h) lived at three different places + in the tuxbox-cvs before, so look there for history information: + - apps/dvb/zapit/include/zapit/xmlinterface.h + - apps/dvb/zapit/src/xmlinterface.cpp + - apps/tuxbox/neutrino/daemons/sectionsd/xmlinterface.cpp + - apps/tuxbox/neutrino/src/system/xmlinterface.cpp + - apps/tuxbox/neutrino/src/system/xmlinterface.h */ #ifndef __xmlinterface_h__ @@ -37,57 +45,28 @@ inline char* xmlGetAttribute (xmlNodePtr cur, const char * s) { return inline char* xmlGetName (xmlNodePtr cur) { return (char *)(cur->name); }; #else /* use libxmltree */ -#include +#include "xmltree.h" typedef XMLTreeParser* xmlDocPtr; typedef XMLTreeNode* xmlNodePtr; #define xmlChildrenNode GetChild() #define xmlNextNode GetNext() inline xmlNodePtr xmlDocGetRootElement(xmlDocPtr doc) { return doc->RootNode(); }; inline void xmlFreeDoc (xmlDocPtr doc) { delete doc; }; -inline char* xmlGetAttribute (xmlNodePtr cur, char * s) { return cur->GetAttributeValue(s); }; +inline char* xmlGetAttribute (xmlNodePtr cur, const char *s) { return cur->GetAttributeValue(s); }; inline char* xmlGetName (xmlNodePtr cur) { return cur->GetType(); }; inline char* xmlGetData (xmlNodePtr cur) { return cur->GetData(); }; #endif /* USE_LIBXML */ -unsigned long xmlGetNumericAttribute (const xmlNodePtr node, char *name, const int base); -long xmlGetSignedNumericAttribute (const xmlNodePtr node, char *name, const int base); +unsigned long xmlGetNumericAttribute (const xmlNodePtr node, const char *name, const int base); +long xmlGetSignedNumericAttribute (const xmlNodePtr node, const char *name, const int base); xmlNodePtr xmlGetNextOccurence (xmlNodePtr cur, const char * s); std::string Unicode_Character_to_UTF8(const int character); -inline std::string convert_UTF8_To_UTF8_XML(const char * s) -{ - std::string r; +std::string convert_UTF8_To_UTF8_XML(const char *s); - while ((*s) != 0) - { - /* cf. http://www.w3.org/TR/xhtml1/dtds.html */ - switch (*s) - { - case '<': - r += "<"; - break; - case '>': - r += ">"; - break; - case '&': - r += "&"; - break; - case '\"': - r += """; - break; - case '\'': - r += "'"; - break; - default: - r += *s; - } - s++; - } - return r; -} xmlDocPtr parseXml(const char *data); -xmlDocPtr parseXmlFile(const char * filename); +xmlDocPtr parseXmlFile(const char * filename, bool warning_by_nonexistence = true); #endif /* __xmlinterface_h__ */ diff --git a/lib/xmltree/xmltree.cpp b/lib/xmltree/xmltree.cpp index 470d00211..e485a710b 100644 --- a/lib/xmltree/xmltree.cpp +++ b/lib/xmltree/xmltree.cpp @@ -187,7 +187,7 @@ XMLTreeNode::~XMLTreeNode() next=0; } -XMLAttribute *XMLTreeNode::GetAttribute(char *name) const +XMLAttribute *XMLTreeNode::GetAttribute(const char *name) const { XMLAttribute *a; @@ -213,7 +213,7 @@ XMLAttribute *XMLTreeNode::GetAttribute(char *name) const return 0; } -char *XMLTreeNode::GetAttributeValue(char *name) const +char *XMLTreeNode::GetAttributeValue(const char *name) const { XMLAttribute *a; diff --git a/lib/xmltree/xmltree.h b/lib/xmltree/xmltree.h index 4e9abdf53..43b55826d 100644 --- a/lib/xmltree/xmltree.h +++ b/lib/xmltree/xmltree.h @@ -107,8 +107,8 @@ class XMLTreeNode XMLTreeNode *GetParent() const { return parent; }; XMLAttribute *GetAttributes() const { return attributes; } - XMLAttribute *GetAttribute(char *name) const; - char *GetAttributeValue(char *name) const; + XMLAttribute *GetAttribute(const char *name) const; + char *GetAttributeValue(const char *name) const; matchmode GetMatchingMode() const { return mmode; } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index fcb0a9b9a..341c9710a 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1205,10 +1205,10 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag, else if (strcmp("mp3", type) == 0) skip = false; else if (strcmp("application/mp3", type) == 0) skip = false; } else { - url = xmlGetAttribute(element, (char *) urltag); - name = xmlGetAttribute(element, (char *) nametag); + url = xmlGetAttribute(element, urltag); + name = xmlGetAttribute(element, nametag); if (bitratetag) { - ptr = xmlGetAttribute(element, (char *) bitratetag); + ptr = xmlGetAttribute(element, bitratetag); if (ptr) bitrate = atoi(ptr); } diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 6215e9260..bc2551ff3 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -575,14 +575,14 @@ bool CFileBrowser::readDir_vlc(const std::string & dirname, CFileList* flist) } else { while (element) { CFile file; - ptr = xmlGetAttribute(element, (char *) "type"); + ptr = xmlGetAttribute(element, "type"); if (strcmp(ptr, "directory")==0) file.Mode = S_IFDIR + 0777 ; else file.Mode = S_IFREG + 0777 ; - file.Name = dirname + xmlGetAttribute(element, (char *) "name"); - ptr = xmlGetAttribute(element, (char *) "size"); + file.Name = dirname + xmlGetAttribute(element, "name"); + ptr = xmlGetAttribute(element, "size"); if (ptr) file.Size = atoi(ptr); else @@ -725,7 +725,7 @@ printf("CFileBrowser::readDir_sc: read done, size %d\n", answer.size()); CFile file; if (xml_decode == 1) { file.Mode = S_IFDIR + 0777 ; - file.Name = xmlGetAttribute(element, (char *) "name"); + file.Name = xmlGetAttribute(element, "name"); file.Url = "/sbin/newxml.phtml?genre=" + file.Name; file.Size = 0; file.Time = 0; @@ -735,17 +735,17 @@ printf("CFileBrowser::readDir_sc: read done, size %d\n", answer.size()); ptr = xmlGetName(element); if (ptr != NULL) { if (strcmp(ptr, "tunein")==0) { - ptr = xmlGetAttribute(element, (char *) "base"); + ptr = xmlGetAttribute(element, "base"); if (ptr) tunein_base = ptr; } else if (strcmp(ptr, "station")==0) { - ptr = xmlGetAttribute(element, (char *) "mt"); + ptr = xmlGetAttribute(element, "mt"); if (ptr && (strcmp(ptr, "audio/mpeg")==0)) { file.Mode = S_IFREG + 0777 ; - file.Name = xmlGetAttribute(element, (char *) "name"); - file.Url = base + tunein_base + (std::string)"?id=" + xmlGetAttribute(element, (char *) "id"); + file.Name = xmlGetAttribute(element, "name"); + file.Url = base + tunein_base + (std::string)"?id=" + xmlGetAttribute(element, "id"); //printf("adding %s (%s)\n", file.Name.c_str(), file.Url.c_str()); - ptr = xmlGetAttribute(element, (char *) "br"); + ptr = xmlGetAttribute(element, "br"); if (ptr) { file.Size = atoi(ptr); file.Time = atoi(ptr); diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 020cca1fd..1b1d168b8 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -367,10 +367,10 @@ bool CMovieInfo::parseXmlTree(char */*text*/, MI_MOVIE_INFO * /*movie_info*/) for (XMLTreeNode * xam2 = xam1->GetChild(); xam2; xam2 = xam2->GetNext()) { if (!strcmp(xam2->GetType(), MI_XML_TAG_AUDIO)) { EPG_AUDIO_PIDS pids; - pids.epgAudioPid = atoi(xam2->GetAttributeValue((char *)MI_XML_TAG_PID)); - pids.atype = atoi(xam2->GetAttributeValue((char *)MI_XML_TAG_ATYPE)); - pids.selected = atoi(xam2->GetAttributeValue((char *)MI_XML_TAG_SELECTED)); - pids.epgAudioPidName = xam2->GetAttributeValue((char *)MI_XML_TAG_NAME); + pids.epgAudioPid = atoi(xam2->GetAttributeValue(MI_XML_TAG_PID)); + pids.atype = atoi(xam2->GetAttributeValue(MI_XML_TAG_ATYPE)); + pids.selected = atoi(xam2->GetAttributeValue(MI_XML_TAG_SELECTED)); + pids.epgAudioPidName = xam2->GetAttributeValue(MI_XML_TAG_NAME); //printf("MOVIE INFO: apid %d type %d name %s selected %d\n", pids.epgAudioPid, pids.atype, pids.epgAudioPidName.c_str(), pids.selected); movie_info->audioPids.push_back(pids); } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 6e6888ebd..6e82dc669 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -223,7 +223,7 @@ std::vector *CUpnpBrowserGui::decodeResult(std::string result) { bool isdir; std::string title, artist = "", album = "", id, children; - char *type, *p; + const char *type, *p; if (!strcmp(node->GetType(), "container")) { @@ -239,18 +239,18 @@ std::vector *CUpnpBrowserGui::decodeResult(std::string result) { p=snode->GetData(); if (!p) - p=(char *) ""; + p = ""; title=std::string(p); } } - p = node->GetAttributeValue((char *) "id"); + p = node->GetAttributeValue("id"); if (!p) - p=(char *) ""; + p = ""; id=std::string(p); - p = node->GetAttributeValue((char *) "childCount"); + p = node->GetAttributeValue("childCount"); if (!p) - p=(char *) ""; + p = ""; children=std::string(p); UPnPEntry entry={id, isdir, title, artist, album, children, resources, -1}; @@ -275,40 +275,40 @@ std::vector *CUpnpBrowserGui::decodeResult(std::string result) { p=snode->GetData(); if (!p) - p=(char *) ""; + p = ""; title=std::string(p); } else if (!strcmp(type,"artist")) { p=snode->GetData(); if (!p) - p=(char *) ""; + p = ""; artist=std::string(p); } else if (!strcmp(type,"album")) { p=snode->GetData(); if (!p) - p=(char *) ""; + p = ""; album=std::string(p); } else if (!strcmp(type,"res")) { p = snode->GetData(); if (!p) - p=(char *) ""; + p = ""; url=std::string(p); - p = snode->GetAttributeValue((char *) "size"); + p = snode->GetAttributeValue("size"); if (!p) - p=(char *) "0"; + p = "0"; size=std::string(p); - p = snode->GetAttributeValue((char *) "duration"); + p = snode->GetAttributeValue("duration"); if (!p) - p=(char *) ""; + p = ""; duration=std::string(p); - p = snode->GetAttributeValue((char *) "protocolInfo"); + p = snode->GetAttributeValue("protocolInfo"); if (!p) - p=(char *) ""; + p = ""; protocol=std::string(p); UPnPResource resource = {url, protocol, size, duration}; resources.push_back(resource); @@ -345,14 +345,14 @@ std::vector *CUpnpBrowserGui::decodeResult(std::string result) } } } - p = node->GetAttributeValue((char *) "id"); + p = node->GetAttributeValue("id"); if (!p) - p=(char *) ""; + p = ""; id=std::string(p); - p = node->GetAttributeValue((char *) "childCount"); + p = node->GetAttributeValue("childCount"); if (!p) - p=(char *) ""; + p = ""; children=std::string(p); UPnPEntry entry={id, isdir, title, artist, album, children, resources, preferred}; diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index d2909b282..7c7e80682 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -740,8 +740,8 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings bool found = false; while (search) { if (!strcmp(xmlGetName(search), "zone")) { - std::string name = xmlGetAttribute(search, (char *) "name"); - std::string zone = xmlGetAttribute(search, (char *) "zone"); + std::string name = xmlGetAttribute(search, "name"); + std::string zone = xmlGetAttribute(search, "zone"); //printf("Timezone: %s -> %s\n", name.c_str(), zone.c_str()); tzSelect->addOption(name.c_str()); found = true; diff --git a/src/sectionsd/sectionsd.cpp b/src/sectionsd/sectionsd.cpp index 6c710730b..8f12ebcf4 100644 --- a/src/sectionsd/sectionsd.cpp +++ b/src/sectionsd/sectionsd.cpp @@ -4385,7 +4385,7 @@ static void *insertEventsfromFile(void *) eventfile = xmlDocGetRootElement(index_parser)->xmlChildrenNode; while (eventfile) { - filename = xmlGetAttribute(eventfile, (char *) "name"); + filename = xmlGetAttribute(eventfile, "name"); epgname = epg_dir + filename; if (!(event_parser = parseXmlFile(epgname.c_str()))) { dprintf("unable to open %s for reading\n", epgname.c_str()); @@ -4394,39 +4394,39 @@ static void *insertEventsfromFile(void *) service = xmlDocGetRootElement(event_parser)->xmlChildrenNode; while (service) { - onid = xmlGetNumericAttribute(service, (char *) "original_network_id", 16); - tsid = xmlGetNumericAttribute(service, (char *) "transport_stream_id", 16); - sid = xmlGetNumericAttribute(service, (char *) "service_id", 16); + onid = xmlGetNumericAttribute(service, "original_network_id", 16); + tsid = xmlGetNumericAttribute(service, "transport_stream_id", 16); + sid = xmlGetNumericAttribute(service, "service_id", 16); event = service->xmlChildrenNode; while (event) { - SIevent e(onid,tsid,sid,xmlGetNumericAttribute(event, (char *) "id", 16)); + SIevent e(onid,tsid,sid,xmlGetNumericAttribute(event, "id", 16)); node = event->xmlChildrenNode; - while (xmlGetNextOccurence(node, (char *) "name") != NULL) { - e.setName( std::string(UTF8_to_Latin1(xmlGetAttribute(node, (char *) "lang"))), - std::string(xmlGetAttribute(node, (char *) "string"))); + while (xmlGetNextOccurence(node, "name") != NULL) { + e.setName( std::string(UTF8_to_Latin1(xmlGetAttribute(node, "lang"))), + std::string(xmlGetAttribute(node, "string"))); node = node->xmlNextNode; } - while (xmlGetNextOccurence(node, (char *) "text") != NULL) { - e.setText( std::string(UTF8_to_Latin1(xmlGetAttribute(node, (char *) "lang"))), - std::string(xmlGetAttribute(node, (char *) "string"))); + while (xmlGetNextOccurence(node, "text") != NULL) { + e.setText( std::string(UTF8_to_Latin1(xmlGetAttribute(node, "lang"))), + std::string(xmlGetAttribute(node, "string"))); node = node->xmlNextNode; } - while (xmlGetNextOccurence(node, (char *) "item") != NULL) { - e.item = std::string(xmlGetAttribute(node, (char *) "string")); + while (xmlGetNextOccurence(node, "item") != NULL) { + e.item = std::string(xmlGetAttribute(node, "string")); node = node->xmlNextNode; } - while (xmlGetNextOccurence(node, (char *) "item_description") != NULL) { - e.itemDescription = std::string(xmlGetAttribute(node, (char *) "string")); + while (xmlGetNextOccurence(node, "item_description") != NULL) { + e.itemDescription = std::string(xmlGetAttribute(node, "string")); node = node->xmlNextNode; } - while (xmlGetNextOccurence(node, (char *) "extended_text") != NULL) { - e.appendExtendedText( std::string(UTF8_to_Latin1(xmlGetAttribute(node, (char *) "lang"))), - std::string(xmlGetAttribute(node, (char *) "string"))); + while (xmlGetNextOccurence(node, "extended_text") != NULL) { + e.appendExtendedText( std::string(UTF8_to_Latin1(xmlGetAttribute(node, "lang"))), + std::string(xmlGetAttribute(node, "string"))); node = node->xmlNextNode; } /* @@ -4450,42 +4450,42 @@ static void *insertEventsfromFile(void *) node = node->xmlNextNode; } */ - while (xmlGetNextOccurence(node, (char *) "time") != NULL) { - e.times.insert(SItime(xmlGetNumericAttribute(node, (char *) "start_time", 10), - xmlGetNumericAttribute(node, (char *) "duration", 10))); + while (xmlGetNextOccurence(node, "time") != NULL) { + e.times.insert(SItime(xmlGetNumericAttribute(node, "start_time", 10), + xmlGetNumericAttribute(node, "duration", 10))); node = node->xmlNextNode; } int count = 0; - while (xmlGetNextOccurence(node, (char *) "content") != NULL) { - cclass[count] = xmlGetNumericAttribute(node, (char *) "class", 16); - cuser[count] = xmlGetNumericAttribute(node, (char *) "user", 16); + while (xmlGetNextOccurence(node, "content") != NULL) { + cclass[count] = xmlGetNumericAttribute(node, "class", 16); + cuser[count] = xmlGetNumericAttribute(node, "user", 16); node = node->xmlNextNode; count++; } e.contentClassification = std::string(cclass, count); e.userClassification = std::string(cuser, count); - while (xmlGetNextOccurence(node, (char *) "component") != NULL) { + while (xmlGetNextOccurence(node, "component") != NULL) { SIcomponent c; - c.streamContent = xmlGetNumericAttribute(node, (char *) "stream_content", 16); - c.componentType = xmlGetNumericAttribute(node, (char *) "type", 16); - c.componentTag = xmlGetNumericAttribute(node, (char *) "tag", 16); - c.component = std::string(xmlGetAttribute(node, (char *) "text")); + c.streamContent = xmlGetNumericAttribute(node, "stream_content", 16); + c.componentType = xmlGetNumericAttribute(node, "type", 16); + c.componentTag = xmlGetNumericAttribute(node, "tag", 16); + c.component = std::string(xmlGetAttribute(node, "text")); e.components.insert(c); node = node->xmlNextNode; } - while (xmlGetNextOccurence(node, (char *) "parental_rating") != NULL) { - e.ratings.insert(SIparentalRating(std::string(UTF8_to_Latin1(xmlGetAttribute(node, (char *) "country"))), (unsigned char) xmlGetNumericAttribute(node, (char *) "rating", 10))); + while (xmlGetNextOccurence(node, "parental_rating") != NULL) { + e.ratings.insert(SIparentalRating(std::string(UTF8_to_Latin1(xmlGetAttribute(node, "country"))), (unsigned char) xmlGetNumericAttribute(node, "rating", 10))); node = node->xmlNextNode; } - while (xmlGetNextOccurence(node, (char *) "linkage") != NULL) { + while (xmlGetNextOccurence(node, "linkage") != NULL) { SIlinkage l; - l.linkageType = xmlGetNumericAttribute(node, (char *) "type", 16); - l.transportStreamId = xmlGetNumericAttribute(node, (char *) "transport_stream_id", 16); - l.originalNetworkId = xmlGetNumericAttribute(node, (char *) "original_network_id", 16); - l.serviceId = xmlGetNumericAttribute(node, (char *) "service_id", 16); - l.name = std::string(xmlGetAttribute(node, (char *) "linkage_descriptor")); + l.linkageType = xmlGetNumericAttribute(node, "type", 16); + l.transportStreamId = xmlGetNumericAttribute(node, "transport_stream_id", 16); + l.originalNetworkId = xmlGetNumericAttribute(node, "original_network_id", 16); + l.serviceId = xmlGetNumericAttribute(node, "service_id", 16); + l.name = std::string(xmlGetAttribute(node, "linkage_descriptor")); e.linkage_descs.insert(e.linkage_descs.end(), l); node = node->xmlNextNode; @@ -8256,18 +8256,18 @@ static void readEPGFilter(void) dprintf("Reading EPGFilters\n"); xmlNodePtr filter = xmlDocGetRootElement(filter_parser); - if (xmlGetNumericAttribute(filter, (char *) "is_whitelist", 10) == 1) + if (xmlGetNumericAttribute(filter, "is_whitelist", 10) == 1) epg_filter_is_whitelist = true; - if (xmlGetNumericAttribute(filter, (char *) "except_current_next", 10) == 1) + if (xmlGetNumericAttribute(filter, "except_current_next", 10) == 1) epg_filter_except_current_next = true; filter = filter->xmlChildrenNode; while (filter) { - onid = xmlGetNumericAttribute(filter, (char *) "onid", 16); - tsid = xmlGetNumericAttribute(filter, (char *) "tsid", 16); - sid = xmlGetNumericAttribute(filter, (char *) "serviceID", 16); - if (xmlGetNumericAttribute(filter, (char *) "blacklist", 10) == 1) + onid = xmlGetNumericAttribute(filter, "onid", 16); + tsid = xmlGetNumericAttribute(filter, "tsid", 16); + sid = xmlGetNumericAttribute(filter, "serviceID", 16); + if (xmlGetNumericAttribute(filter, "blacklist", 10) == 1) addBlacklist(onid, tsid, sid); else addEPGFilter(onid, tsid, sid); @@ -8295,9 +8295,9 @@ static void readDVBTimeFilter(void) while (filter) { - onid = xmlGetNumericAttribute(filter, (char *) "onid", 16); - tsid = xmlGetNumericAttribute(filter, (char *) "tsid", 16); - sid = xmlGetNumericAttribute(filter, (char *) "serviceID", 16); + onid = xmlGetNumericAttribute(filter, "onid", 16); + tsid = xmlGetNumericAttribute(filter, "tsid", 16); + sid = xmlGetNumericAttribute(filter, "serviceID", 16); addNoDVBTimelist(onid, tsid, sid); filter = filter->xmlNextNode; @@ -8326,13 +8326,13 @@ static void readBouquetFilter(void) while ((xmlGetNextOccurence(mybouquets, "filter") != NULL) || (xmlGetNextOccurence(mybouquets, "adder") != NULL)) { if (strcmp(xmlGetName(mybouquets), "filter") == 0) { - if (xmlGetNumericAttribute(mybouquets, (char *) "is_whitelist", 10) == 1) + if (xmlGetNumericAttribute(mybouquets, "is_whitelist", 10) == 1) bouquet_filter_is_whitelist = true; xmlNodePtr filter = mybouquets->xmlChildrenNode; while (filter) { - bid = xmlGetNumericAttribute(filter, (char *) "bouquet_id", 16); + bid = xmlGetNumericAttribute(filter, "bouquet_id", 16); addBouquetFilter(bid); @@ -8344,8 +8344,8 @@ static void readBouquetFilter(void) { BouquetAdder *bouquet = new BouquetAdder; snprintf(bouquet->BouquetName, MAX_SIZE_MYBOUQUETS_STR, - xmlGetAttribute(mybouquets, (char *) "name")); - bouquet->bid = xmlGetNumericAttribute(mybouquets, (char *) "bouquet_id", 16); + xmlGetAttribute(mybouquets, "name")); + bouquet->bid = xmlGetNumericAttribute(mybouquets, "bouquet_id", 16); bouquet->bae = NULL; bouquet->next = CurrentBouquetAdder; CurrentBouquetAdder = bouquet; @@ -8353,11 +8353,11 @@ static void readBouquetFilter(void) while (entry) { BouquetAdderEntry *adderentry = new BouquetAdderEntry; snprintf(adderentry->ProviderName, MAX_SIZE_MYBOUQUETS_STR, - xmlGetAttribute(entry,(char *) "provider")); + xmlGetAttribute(entry, "provider")); adderentry->onid = - xmlGetNumericAttribute(entry, (char *) "onid", 16); + xmlGetNumericAttribute(entry, "onid", 16); adderentry->tsid = - xmlGetNumericAttribute(entry, (char *) "tsid", 16); + xmlGetNumericAttribute(entry, "tsid", 16); adderentry->es = NULL; adderentry->next = bouquet->bae; bouquet->bae = adderentry; @@ -8369,7 +8369,7 @@ static void readBouquetFilter(void) ExceptService; eservice->sid = xmlGetNumericAttribute(entry, - (char *) "service_id", 16); + "service_id", 16); eservice->next = adderentry->es; adderentry->es = eservice; excepts = excepts->xmlNextNode; diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 4fca8ee0d..94712fd12 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -873,8 +873,8 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data) xmlNodePtr search = xmlDocGetRootElement(parser)->xmlChildrenNode; while (search) { if (!strcmp(xmlGetName(search), "zone")) { - name = xmlGetAttribute(search, (char *) "name"); - zone = xmlGetAttribute(search, (char *) "zone"); + name = xmlGetAttribute(search, "name"); + zone = xmlGetAttribute(search, "zone"); if(!strcmp(g_settings.timezone, name.c_str())) { found = true; break; diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 3b46e789c..b2524470f 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -367,24 +367,24 @@ void CBouquetManager::parseBouquetsXml(const xmlNodePtr root, bool bUser) INFO("reading bouquets"); while ((search = xmlGetNextOccurence(search, "Bouquet")) != NULL) { - char * name = xmlGetAttribute(search, (char *) "name"); + char * name = xmlGetAttribute(search, "name"); if(name == NULL) name = const_cast("Unknown"); - //CZapitBouquet* newBouquet = addBouquet(xmlGetAttribute(search, (char *) "name"), bUser); + //CZapitBouquet* newBouquet = addBouquet(xmlGetAttribute(search, "name"), bUser); CZapitBouquet* newBouquet = addBouquet(name, bUser); - char* hidden = xmlGetAttribute(search, (char *) "hidden"); - char* locked = xmlGetAttribute(search, (char *) "locked"); + char* hidden = xmlGetAttribute(search, "hidden"); + char* locked = xmlGetAttribute(search, "locked"); newBouquet->bHidden = hidden ? (strcmp(hidden, "1") == 0) : false; newBouquet->bLocked = locked ? (strcmp(locked, "1") == 0) : false; newBouquet->bFav = (strcmp(name, "favorites") == 0); channel_node = search->xmlChildrenNode; while ((channel_node = xmlGetNextOccurence(channel_node, "S")) != NULL) { - std::string name = xmlGetAttribute(channel_node, (char *) "n"); - GET_ATTR(channel_node, (char *) "i", SCANF_SERVICE_ID_TYPE, service_id); - GET_ATTR(channel_node, (char *) "on", SCANF_ORIGINAL_NETWORK_ID_TYPE, original_network_id); - GET_ATTR(channel_node, (char *) "s", SCANF_SATELLITE_POSITION_TYPE, satellitePosition); - GET_ATTR(channel_node, (char *) "t", SCANF_TRANSPORT_STREAM_ID_TYPE, transport_stream_id); - GET_ATTR(channel_node, (char *) "frq", SCANF_SATELLITE_POSITION_TYPE, freq); + std::string name = xmlGetAttribute(channel_node, "n"); + GET_ATTR(channel_node, "i", SCANF_SERVICE_ID_TYPE, service_id); + GET_ATTR(channel_node, "on", SCANF_ORIGINAL_NETWORK_ID_TYPE, original_network_id); + GET_ATTR(channel_node, "s", SCANF_SATELLITE_POSITION_TYPE, satellitePosition); + GET_ATTR(channel_node, "t", SCANF_TRANSPORT_STREAM_ID_TYPE, transport_stream_id); + GET_ATTR(channel_node, "frq", SCANF_SATELLITE_POSITION_TYPE, freq); if(freq > 20000) freq = freq/1000; CZapitChannel* chan; @@ -393,7 +393,7 @@ void CBouquetManager::parseBouquetsXml(const xmlNodePtr root, bool bUser) //printf("Bouquet Channel-ID freq %d pos %d id %llx\n", freq, satellitePosition, CREATE_CHANNEL_ID64); if (chan != NULL) { //printf("found\n"); -DBG("%04x %04x %04x %s\n", transport_stream_id, original_network_id, service_id, xmlGetAttribute(channel_node, (char *) "n")); +DBG("%04x %04x %04x %s\n", transport_stream_id, original_network_id, service_id, xmlGetAttribute(channel_node, "n")); #if 0 if(bUser && (name.length() > 1)) chan->setName(name); diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 84fcc57a9..cb3f0bf90 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -70,23 +70,23 @@ void ParseTransponders(xmlNodePtr node, t_satellite_position satellitePosition, /* read all transponders */ while ((node = xmlGetNextOccurence(node, "TS")) != NULL) { - transport_stream_id = xmlGetNumericAttribute(node, (char *) "id", 16); - original_network_id = xmlGetNumericAttribute(node, (char *) "on", 16); - feparams.frequency = xmlGetNumericAttribute(node, (char *) "frq", 0); - feparams.inversion = (fe_spectral_inversion) xmlGetNumericAttribute(node, (char *) "inv", 0); + transport_stream_id = xmlGetNumericAttribute(node, "id", 16); + original_network_id = xmlGetNumericAttribute(node, "on", 16); + feparams.frequency = xmlGetNumericAttribute(node, "frq", 0); + feparams.inversion = (fe_spectral_inversion) xmlGetNumericAttribute(node, "inv", 0); if(cable) { - feparams.u.qam.symbol_rate = xmlGetNumericAttribute(node, (char *) "sr", 0); - feparams.u.qam.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(node, (char *) "fec", 0); - feparams.u.qam.modulation = (fe_modulation_t) xmlGetNumericAttribute(node, (char *) "mod", 0); + feparams.u.qam.symbol_rate = xmlGetNumericAttribute(node, "sr", 0); + feparams.u.qam.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(node, "fec", 0); + feparams.u.qam.modulation = (fe_modulation_t) xmlGetNumericAttribute(node, "mod", 0); if (feparams.frequency > 1000*1000) feparams.frequency=feparams.frequency/1000; //transponderlist was read from tuxbox } else { - feparams.u.qpsk.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(node, (char *) "fec", 0); - feparams.u.qpsk.symbol_rate = xmlGetNumericAttribute(node, (char *) "sr", 0); + feparams.u.qpsk.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(node, "fec", 0); + feparams.u.qpsk.symbol_rate = xmlGetNumericAttribute(node, "sr", 0); - polarization = xmlGetNumericAttribute(node, (char *) "pol", 0); + polarization = xmlGetNumericAttribute(node, "pol", 0); if(feparams.u.qpsk.symbol_rate < 50000) feparams.u.qpsk.symbol_rate = feparams.u.qpsk.symbol_rate * 1000; @@ -128,19 +128,19 @@ void ParseChannels(xmlNodePtr node, const t_transport_stream_id transport_stream t_channel_id chid; while ((node = xmlGetNextOccurence(node, "S")) != NULL) { - service_id = xmlGetNumericAttribute(node, (char *) "i", 16); - name = xmlGetAttribute(node, (char *) "n"); - service_type = xmlGetNumericAttribute(node, (char *) "t", 16); - vpid = xmlGetNumericAttribute(node, (char *) "v", 16); - apid = xmlGetNumericAttribute(node, (char *) "a", 16); - pcrpid = xmlGetNumericAttribute(node, (char *) "p", 16); - pmtpid = xmlGetNumericAttribute(node, (char *) "pmt", 16); - txpid = xmlGetNumericAttribute(node, (char *) "tx", 16); - vtype = xmlGetNumericAttribute(node, (char *) "vt", 16); - scrambled = xmlGetNumericAttribute(node, (char *) "s", 16); + service_id = xmlGetNumericAttribute(node, "i", 16); + name = xmlGetAttribute(node, "n"); + service_type = xmlGetNumericAttribute(node, "t", 16); + vpid = xmlGetNumericAttribute(node, "v", 16); + apid = xmlGetNumericAttribute(node, "a", 16); + pcrpid = xmlGetNumericAttribute(node, "p", 16); + pmtpid = xmlGetNumericAttribute(node, "pmt", 16); + txpid = xmlGetNumericAttribute(node, "tx", 16); + vtype = xmlGetNumericAttribute(node, "vt", 16); + scrambled = xmlGetNumericAttribute(node, "s", 16); chid = CREATE_CHANNEL_ID64; - char *ptr = xmlGetAttribute(node, (char *) "action"); + char *ptr = xmlGetAttribute(node, "action"); bool remove = ptr ? (!strcmp(ptr, "remove") || !strcmp(ptr, "replace")) : false; bool add = ptr ? (!strcmp(ptr, "add") || !strcmp(ptr, "replace")) : true; if (remove) { @@ -225,8 +225,8 @@ void FindTransponder(xmlNodePtr search) continue; } - satellitePosition = xmlGetSignedNumericAttribute(search, (char *) "position", 10); - DBG("going to parse dvb-%c provider %s\n", xmlGetName(search)[0], xmlGetAttribute(search, (char *) "name")); + satellitePosition = xmlGetSignedNumericAttribute(search, "position", 10); + DBG("going to parse dvb-%c provider %s\n", xmlGetName(search)[0], xmlGetAttribute(search, "name")); ParseTransponders(search->xmlChildrenNode, satellitePosition, cable); newfound++; search = search->xmlNextNode; @@ -248,7 +248,7 @@ void ParseSatTransponders(fe_type_t frontendType, xmlNodePtr search, t_satellite while ((tps = xmlGetNextOccurence(tps, "transponder")) != NULL) { memset(&feparams, 0x00, sizeof(FrontendParameters)); - feparams.frequency = xmlGetNumericAttribute(tps, (char *) "frequency", 0); + feparams.frequency = xmlGetNumericAttribute(tps, "frequency", 0); if (frontendType == FE_QAM) { if (feparams.frequency > 1000*1000) feparams.frequency=feparams.frequency/1000; //transponderlist was read from tuxbox @@ -260,16 +260,16 @@ void ParseSatTransponders(fe_type_t frontendType, xmlNodePtr search, t_satellite feparams.inversion = INVERSION_AUTO; if (frontendType == FE_QAM) { - feparams.u.qam.symbol_rate = xmlGetNumericAttribute(tps, (char *) "symbol_rate", 0); - feparams.u.qam.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(tps, (char *) "fec_inner", 0); - feparams.u.qam.modulation = (fe_modulation_t) xmlGetNumericAttribute(tps, (char *) "modulation", 0); + feparams.u.qam.symbol_rate = xmlGetNumericAttribute(tps, "symbol_rate", 0); + feparams.u.qam.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(tps, "fec_inner", 0); + feparams.u.qam.modulation = (fe_modulation_t) xmlGetNumericAttribute(tps, "modulation", 0); } else if (frontendType == FE_QPSK) { - feparams.u.qpsk.symbol_rate = xmlGetNumericAttribute(tps, (char *) "symbol_rate", 0); - polarization = xmlGetNumericAttribute(tps, (char *) "polarization", 0); - system = xmlGetNumericAttribute(tps, (char *) "system", 0); - modulation = xmlGetNumericAttribute(tps, (char *) "modulation", 0); - xml_fec = xmlGetNumericAttribute(tps, (char *) "fec_inner", 0); + feparams.u.qpsk.symbol_rate = xmlGetNumericAttribute(tps, "symbol_rate", 0); + polarization = xmlGetNumericAttribute(tps, "polarization", 0); + system = xmlGetNumericAttribute(tps, "system", 0); + modulation = xmlGetNumericAttribute(tps, "modulation", 0); + xml_fec = xmlGetNumericAttribute(tps, "fec_inner", 0); xml_fec = CFrontend::getCodeRate(xml_fec, system); if(modulation == 2) xml_fec += 9; @@ -396,15 +396,15 @@ int LoadServices(fe_type_t frontendType, diseqc_t /*diseqcType*/, bool only_curr xmlNodePtr search = xmlDocGetRootElement(scanInputParser)->xmlChildrenNode; while (search) { if (!(strcmp(xmlGetName(search), "sat"))) { - position = xmlGetSignedNumericAttribute(search, (char *) "position", 10); - char * name = xmlGetAttribute(search,(char *) "name"); + position = xmlGetSignedNumericAttribute(search, "position", 10); + char * name = xmlGetAttribute(search, "name"); if(satellitePositions.find(position) == satellitePositions.end()) { init_sat(position); } satellitePositions[position].name = name; } else if(!(strcmp(xmlGetName(search), "cable"))) { - char * name = xmlGetAttribute(search,(char *) "name"); + char * name = xmlGetAttribute(search, "name"); if(satellitePositions.find(position) == satellitePositions.end()) { init_sat(position); } @@ -421,8 +421,8 @@ int LoadServices(fe_type_t frontendType, diseqc_t /*diseqcType*/, bool only_curr xmlNodePtr search = xmlDocGetRootElement(parser)->xmlChildrenNode; while (search) { if (!(strcmp(xmlGetName(search), "sat"))) { - t_satellite_position position = xmlGetSignedNumericAttribute(search, (char *) "position", 10); - char * name = xmlGetAttribute(search,(char *) "name"); + t_satellite_position position = xmlGetSignedNumericAttribute(search, "position", 10); + char * name = xmlGetAttribute(search, "name"); if(satellitePositions.find(position) == satellitePositions.end()) { init_sat(position); satellitePositions[position].name = name; diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp index d9365b286..153fe6e78 100644 --- a/src/zapit/src/scan.cpp +++ b/src/zapit/src/scan.cpp @@ -318,7 +318,7 @@ int scan_transponder(xmlNodePtr transponder, uint8_t diseqc_pos, t_satellite_pos FrontendParameters feparams; memset(&feparams, 0x00, sizeof(FrontendParameters)); - feparams.frequency = xmlGetNumericAttribute(transponder, (char *) "frequency", 0); + feparams.frequency = xmlGetNumericAttribute(transponder, "frequency", 0); if(cable) { if (feparams.frequency > 1000*1000) feparams.frequency=feparams.frequency/1000; //transponderlist was read from tuxbox @@ -329,17 +329,17 @@ int scan_transponder(xmlNodePtr transponder, uint8_t diseqc_pos, t_satellite_pos feparams.inversion = INVERSION_AUTO; if (cable) { - feparams.u.qam.symbol_rate = xmlGetNumericAttribute(transponder, (char *) "symbol_rate", 0); - feparams.u.qam.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(transponder, (char *) "fec_inner", 0); - feparams.u.qam.modulation = (fe_modulation_t) xmlGetNumericAttribute(transponder, (char *) "modulation", 0); + feparams.u.qam.symbol_rate = xmlGetNumericAttribute(transponder, "symbol_rate", 0); + feparams.u.qam.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(transponder, "fec_inner", 0); + feparams.u.qam.modulation = (fe_modulation_t) xmlGetNumericAttribute(transponder, "modulation", 0); diseqc_pos = 0; } else if (frontend->getInfo()->type == FE_QPSK) { - feparams.u.qpsk.symbol_rate = xmlGetNumericAttribute(transponder, (char *) "symbol_rate", 0); - polarization = xmlGetNumericAttribute(transponder, (char *) "polarization", 0); - system = xmlGetNumericAttribute(transponder, (char *) "system", 0); - modulation = xmlGetNumericAttribute(transponder, (char *) "modulation", 0); - xml_fec = xmlGetNumericAttribute(transponder, (char *) "fec_inner", 0); + feparams.u.qpsk.symbol_rate = xmlGetNumericAttribute(transponder, "symbol_rate", 0); + polarization = xmlGetNumericAttribute(transponder, "polarization", 0); + system = xmlGetNumericAttribute(transponder, "system", 0); + modulation = xmlGetNumericAttribute(transponder, "modulation", 0); + xml_fec = xmlGetNumericAttribute(transponder, "fec_inner", 0); xml_fec = CFrontend::getCodeRate(xml_fec, system); if(modulation == 2) xml_fec += 9; @@ -443,7 +443,7 @@ void *start_scanthread(void *scanmode) { scan_list_iterator_t spI; char providerName[80] = ""; - char *frontendType; + const char *frontendType; uint8_t diseqc_pos = 0; scanBouquetManager = new CBouquetManager(); processed_transponders = 0; @@ -463,10 +463,10 @@ void *start_scanthread(void *scanmode) nittransponders.clear(); cable = (frontend->getInfo()->type == FE_QAM); - if(cable) - frontendType = (char *) "cable"; - else - frontendType = (char *) "sat"; + if (cable) + frontendType = "cable"; + else + frontendType = "sat"; scan_mode = mode & 0xFF;// NIT (0) or fast (1) scan_sat_mode = mode & 0xFF00; // single = 0, all = 1 @@ -480,10 +480,10 @@ void *start_scanthread(void *scanmode) /* read all sat or cable sections */ while ((search = xmlGetNextOccurence(search, frontendType)) != NULL) { - t_satellite_position position = xmlGetSignedNumericAttribute(search, (char *) "position", 10); + t_satellite_position position = xmlGetSignedNumericAttribute(search, "position", 10); if(cable) { - strcpy(providerName, xmlGetAttribute(search, const_cast("name"))); + strcpy(providerName, xmlGetAttribute(search, "name")); for (spI = scanProviders.begin(); spI != scanProviders.end(); spI++) if (!strcmp(spI->second.c_str(), providerName)) { position = spI->first; @@ -499,10 +499,10 @@ void *start_scanthread(void *scanmode) /* provider is not wanted - jump to the next one */ if (spI != scanProviders.end()) { /* get name of current satellite oder cable provider */ - strcpy(providerName, xmlGetAttribute(search, (char *) "name")); + strcpy(providerName, xmlGetAttribute(search, "name")); - if (cable && xmlGetAttribute(search, (char *) "satfeed")) { - if (!strcmp(xmlGetAttribute(search, (char *) "satfeed"), "true")) + if (cable && xmlGetAttribute(search, "satfeed")) { + if (!strcmp(xmlGetAttribute(search, "satfeed"), "true")) satfeed = true; }