From 1b21de309451786deb6e54c96b068dcaa55e1485 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 19:42:13 +0000 Subject: Apply patch 0001-Don-t-emit-errors-unless-compiled-for-debug.patch patch_name: 0001-Don-t-emit-errors-unless-compiled-for-debug.patch present_in_specfile: true --- diff --git a/include/musicbrainz5/Entity.h b/include/musicbrainz5/Entity.h index fca7a14..0f92d55 100644 --- a/include/musicbrainz5/Entity.h +++ b/include/musicbrainz5/Entity.h @@ -76,10 +76,12 @@ namespace MusicBrainz5 os >> RetVal; if (os.fail()) { +#ifdef _MB5_DEBUG_ std::cerr << "Error parsing value '"; if (Node.getText()) std::cerr << Node.getText(); std::cerr << "'" << std::endl; +#endif } } @@ -92,7 +94,9 @@ namespace MusicBrainz5 os >> RetVal; if (os.fail()) { +#ifdef _MB5_DEBUG_ std::cerr << "Error parsing value '" << Text << "'" << std::endl; +#endif } } diff --git a/src/Alias.cc b/src/Alias.cc index bdafc99..29dbe15 100644 --- a/src/Alias.cc +++ b/src/Alias.cc @@ -106,14 +106,18 @@ void MusicBrainz5::CAlias::ParseAttribute(const std::string& Name, const std::st m_d->m_EndDate=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised alias attribute: '" << Name << "'" << std::endl; +#endif } } void MusicBrainz5::CAlias::ParseElement(const XMLNode& Node) { std::string NodeName=Node.getName(); +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised alias element: '" << NodeName << std::endl; +#endif } std::string MusicBrainz5::CAlias::GetElementName() diff --git a/src/Annotation.cc b/src/Annotation.cc index e138c83..3091973 100644 --- a/src/Annotation.cc +++ b/src/Annotation.cc @@ -87,7 +87,9 @@ void MusicBrainz5::CAnnotation::ParseAttribute(const std::string& Name, const st m_d->m_Type=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised annotation attribute: '" << Name << "'" << std::endl; +#endif } } @@ -109,7 +111,9 @@ void MusicBrainz5::CAnnotation::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised annotation element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Artist.cc b/src/Artist.cc index bcf37c3..528ff96 100644 --- a/src/Artist.cc +++ b/src/Artist.cc @@ -234,7 +234,9 @@ void MusicBrainz5::CArtist::ParseAttribute(const std::string& Name, const std::s m_d->m_Type=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised artist attribute: '" << Name << "'" << std::endl; +#endif } } @@ -320,7 +322,9 @@ void MusicBrainz5::CArtist::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised artist element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/ArtistCredit.cc b/src/ArtistCredit.cc index 6ad7e64..b31f549 100644 --- a/src/ArtistCredit.cc +++ b/src/ArtistCredit.cc @@ -98,7 +98,11 @@ MusicBrainz5::CArtistCredit *MusicBrainz5::CArtistCredit::Clone() void MusicBrainz5::CArtistCredit::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised artistcredit attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CArtistCredit::ParseElement(const XMLNode& Node) @@ -112,7 +116,9 @@ void MusicBrainz5::CArtistCredit::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised artistcredit element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Attribute.cc b/src/Attribute.cc index 9e0afce..dafc0a9 100644 --- a/src/Attribute.cc +++ b/src/Attribute.cc @@ -80,14 +80,20 @@ MusicBrainz5::CAttribute *MusicBrainz5::CAttribute::Clone() void MusicBrainz5::CAttribute::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised attribute attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CAttribute::ParseElement(const XMLNode& Node) { std::string NodeName=Node.getName(); +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised attribute element: '" << NodeName << "'" << std::endl; +#endif } std::string MusicBrainz5::CAttribute::GetElementName() diff --git a/src/CDStub.cc b/src/CDStub.cc index f237351..707429d 100644 --- a/src/CDStub.cc +++ b/src/CDStub.cc @@ -111,7 +111,9 @@ void MusicBrainz5::CCDStub::ParseAttribute(const std::string& Name, const std::s m_d->m_ID=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised cdstub attribute: '" << Name << "'" << std::endl; +#endif } } @@ -141,7 +143,9 @@ void MusicBrainz5::CCDStub::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised cd stub element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Collection.cc b/src/Collection.cc index 293af2c..8cb2c72 100644 --- a/src/Collection.cc +++ b/src/Collection.cc @@ -106,7 +106,9 @@ void MusicBrainz5::CCollection::ParseAttribute(const std::string& Name, const st m_d->m_ID=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised collection attribute: '" << Name << "'" << std::endl; +#endif } } @@ -128,7 +130,9 @@ void MusicBrainz5::CCollection::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised collection element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Disc.cc b/src/Disc.cc index 0616ea7..bbd0922 100644 --- a/src/Disc.cc +++ b/src/Disc.cc @@ -106,7 +106,9 @@ void MusicBrainz5::CDisc::ParseAttribute(const std::string& Name, const std::str ProcessItem(Value,m_d->m_ID); else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised disc attribute: '" << Name << "'" << std::endl; +#endif } } @@ -124,7 +126,9 @@ void MusicBrainz5::CDisc::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised disc element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/FreeDBDisc.cc b/src/FreeDBDisc.cc index a888192..4d5f1a3 100644 --- a/src/FreeDBDisc.cc +++ b/src/FreeDBDisc.cc @@ -111,7 +111,9 @@ void MusicBrainz5::CFreeDBDisc::ParseAttribute(const std::string& Name, const st m_d->m_ID=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised freedb disc attribute: '" << Name << "'" << std::endl; +#endif } } @@ -141,7 +143,9 @@ void MusicBrainz5::CFreeDBDisc::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised freedb disc element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/HTTPFetch.cc b/src/HTTPFetch.cc index ac3f9b4..baec359 100644 --- a/src/HTTPFetch.cc +++ b/src/HTTPFetch.cc @@ -36,6 +36,26 @@ #include "ne_string.h" #include "ne_request.h" +#if defined(__GNUC__) +__attribute__((constructor)) +#else + #error Non GCC compiler detected +#endif +static void initialize_neon() +{ + ne_sock_init(); +} + +#if defined(__GNUC__) +__attribute__((destructor)) +#else + #error Non GCC compiler detected +#endif +static void destroy_neon() +{ + ne_sock_exit(); +} + class MusicBrainz5::CHTTPFetchPrivate { public: @@ -147,8 +167,6 @@ int MusicBrainz5::CHTTPFetch::Fetch(const std::string& URL, const std::string& R m_d->m_Data.clear(); - ne_sock_init(); - ne_session *sess=ne_session_create("http", m_d->m_Host.c_str(), m_d->m_Port); if (sess) { @@ -230,8 +248,6 @@ int MusicBrainz5::CHTTPFetch::Fetch(const std::string& URL, const std::string& R } } - ne_sock_exit(); - return Ret; } diff --git a/src/IPI.cc b/src/IPI.cc index 8c5e9ad..1722540 100644 --- a/src/IPI.cc +++ b/src/IPI.cc @@ -86,14 +86,20 @@ MusicBrainz5::CIPI *MusicBrainz5::CIPI::Clone() void MusicBrainz5::CIPI::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised IPI attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CIPI::ParseElement(const XMLNode& Node) { std::string Name=Node.getName(); +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised IPI element: '" << Name << "'" << std::endl; +#endif } std::string MusicBrainz5::CIPI::GetElementName() diff --git a/src/ISRC.cc b/src/ISRC.cc index bd63a76..81509a2 100644 --- a/src/ISRC.cc +++ b/src/ISRC.cc @@ -103,7 +103,9 @@ void MusicBrainz5::CISRC::ParseAttribute(const std::string& Name, const std::str m_d->m_ID=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised isrc attribute: '" << Name << "'" << std::endl; +#endif } } @@ -117,7 +119,9 @@ void MusicBrainz5::CISRC::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised ISRC element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/ISWC.cc b/src/ISWC.cc index d8d75a4..1220d99 100644 --- a/src/ISWC.cc +++ b/src/ISWC.cc @@ -92,14 +92,20 @@ MusicBrainz5::CISWC *MusicBrainz5::CISWC::Clone() void MusicBrainz5::CISWC::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised ISWC attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CISWC::ParseElement(const XMLNode& Node) { std::string NodeName=Node.getName(); +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised ISWC element: '" << NodeName << "'" << std::endl; +#endif } std::string MusicBrainz5::CISWC::GetElementName() diff --git a/src/Label.cc b/src/Label.cc index 8add21c..8007cdc 100644 --- a/src/Label.cc +++ b/src/Label.cc @@ -197,7 +197,9 @@ void MusicBrainz5::CLabel::ParseAttribute(const std::string& Name, const std::st m_d->m_Type=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised label attribute: '" << Name << "'" << std::endl; +#endif } } @@ -267,7 +269,9 @@ void MusicBrainz5::CLabel::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised label element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/LabelInfo.cc b/src/LabelInfo.cc index ad04652..6c07bbc 100644 --- a/src/LabelInfo.cc +++ b/src/LabelInfo.cc @@ -98,7 +98,11 @@ MusicBrainz5::CLabelInfo *MusicBrainz5::CLabelInfo::Clone() void MusicBrainz5::CLabelInfo::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised labelinfo attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CLabelInfo::ParseElement(const XMLNode& Node) @@ -115,7 +119,9 @@ void MusicBrainz5::CLabelInfo::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised label info element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Lifespan.cc b/src/Lifespan.cc index 35b49d1..a97aa8b 100644 --- a/src/Lifespan.cc +++ b/src/Lifespan.cc @@ -81,7 +81,11 @@ MusicBrainz5::CLifespan *MusicBrainz5::CLifespan::Clone() void MusicBrainz5::CLifespan::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised lifespan attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CLifespan::ParseElement(const XMLNode& Node) @@ -102,7 +106,9 @@ void MusicBrainz5::CLifespan::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised lifespan element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/List.cc b/src/List.cc index 6a8a47c..3bf1982 100644 --- a/src/List.cc +++ b/src/List.cc @@ -109,7 +109,9 @@ void MusicBrainz5::CList::ParseAttribute(const std::string& Name, const std::str ProcessItem(Value,m_d->m_Count); else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised list attribute: '" << Name << "'" << std::endl; +#endif } } @@ -117,7 +119,9 @@ void MusicBrainz5::CList::ParseElement(const XMLNode& Node) { std::string NodeName=Node.getName(); +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised list element: '" << NodeName << "'" << std::endl; +#endif } std::string MusicBrainz5::CList::GetElementName() diff --git a/src/Medium.cc b/src/Medium.cc index 03e27da..e9495e3 100644 --- a/src/Medium.cc +++ b/src/Medium.cc @@ -114,7 +114,11 @@ MusicBrainz5::CMedium *MusicBrainz5::CMedium::Clone() void MusicBrainz5::CMedium::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised medium attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CMedium::ParseElement(const XMLNode& Node) @@ -143,7 +147,9 @@ void MusicBrainz5::CMedium::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised medium element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Message.cc b/src/Message.cc index 63e034b..cc283e0 100644 --- a/src/Message.cc +++ b/src/Message.cc @@ -77,7 +77,11 @@ MusicBrainz5::CMessage *MusicBrainz5::CMessage::Clone() void MusicBrainz5::CMessage::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised message attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CMessage::ParseElement(const XMLNode& Node) @@ -88,7 +92,9 @@ void MusicBrainz5::CMessage::ParseElement(const XMLNode& Node) ProcessItem(Node,m_d->m_Text); else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised message element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Metadata.cc b/src/Metadata.cc index 57b4732..66d76cc 100644 --- a/src/Metadata.cc +++ b/src/Metadata.cc @@ -362,7 +362,9 @@ void MusicBrainz5::CMetadata::ParseAttribute(const std::string& Name, const std: m_d->m_Created=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised metadata attribute: '" << Name << "'" << std::endl; +#endif } } @@ -480,7 +482,9 @@ void MusicBrainz5::CMetadata::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised metadata element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/NameCredit.cc b/src/NameCredit.cc index f587caa..cdeb401 100644 --- a/src/NameCredit.cc +++ b/src/NameCredit.cc @@ -104,7 +104,9 @@ void MusicBrainz5::CNameCredit::ParseAttribute(const std::string& Name, const st m_d->m_JoinPhrase=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised namecredit attribute: '" << Name << "'" << std::endl; +#endif } } @@ -122,7 +124,9 @@ void MusicBrainz5::CNameCredit::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised name credit element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/NonMBTrack.cc b/src/NonMBTrack.cc index 0bd6367..b47ec48 100644 --- a/src/NonMBTrack.cc +++ b/src/NonMBTrack.cc @@ -86,7 +86,11 @@ MusicBrainz5::CNonMBTrack *MusicBrainz5::CNonMBTrack::Clone() void MusicBrainz5::CNonMBTrack::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised non MB track attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CNonMBTrack::ParseElement(const XMLNode& Node) @@ -107,7 +111,9 @@ void MusicBrainz5::CNonMBTrack::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised non MB track element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/PUID.cc b/src/PUID.cc index 153d13a..18289ef 100644 --- a/src/PUID.cc +++ b/src/PUID.cc @@ -103,7 +103,9 @@ void MusicBrainz5::CPUID::ParseAttribute(const std::string& Name, const std::str m_d->m_ID=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised puid attribute: '" << Name << "'" << std::endl; +#endif } } @@ -117,7 +119,9 @@ void MusicBrainz5::CPUID::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised PUID element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Rating.cc b/src/Rating.cc index 2e6e754..2c6708c 100644 --- a/src/Rating.cc +++ b/src/Rating.cc @@ -96,7 +96,9 @@ void MusicBrainz5::CRating::ParseAttribute(const std::string& Name, const std::s } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised rating attribute: '" << Name << "'" << std::endl; +#endif } } @@ -104,7 +106,9 @@ void MusicBrainz5::CRating::ParseElement(const XMLNode& Node) { std::string NodeName=Node.getName(); +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised rating attribute: '" << NodeName << "'" << std::endl; +#endif } std::string MusicBrainz5::CRating::GetElementName() diff --git a/src/Recording.cc b/src/Recording.cc index 76536f3..2eb2dbd 100644 --- a/src/Recording.cc +++ b/src/Recording.cc @@ -157,7 +157,9 @@ void MusicBrainz5::CRecording::ParseAttribute(const std::string& Name, const std m_d->m_ID=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised recording attribute: '" << Name << "'" << std::endl; +#endif } } @@ -215,7 +217,9 @@ void MusicBrainz5::CRecording::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised recording element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Relation.cc b/src/Relation.cc index df044c7..789c317 100644 --- a/src/Relation.cc +++ b/src/Relation.cc @@ -168,7 +168,9 @@ void MusicBrainz5::CRelation::ParseAttribute(const std::string& Name, const std: m_d->m_Type=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised relation attribute: '" << Name << "'" << std::endl; +#endif } } @@ -226,7 +228,9 @@ void MusicBrainz5::CRelation::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised relation element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Release.cc b/src/Release.cc index 59a58b5..e98886f 100644 --- a/src/Release.cc +++ b/src/Release.cc @@ -180,7 +180,9 @@ void MusicBrainz5::CRelease::ParseAttribute(const std::string& Name, const std:: m_d->m_ID=Value; else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised release attribute: '" << Name << "'" << std::endl; +#endif } } @@ -254,7 +256,9 @@ void MusicBrainz5::CRelease::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised release element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/ReleaseGroup.cc b/src/ReleaseGroup.cc index a8c4edd..0dbd563 100644 --- a/src/ReleaseGroup.cc +++ b/src/ReleaseGroup.cc @@ -183,7 +183,9 @@ void MusicBrainz5::CReleaseGroup::ParseAttribute(const std::string& Name, const } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised releasegroup attribute: '" << Name << "'" << std::endl; +#endif } } @@ -241,7 +243,9 @@ void MusicBrainz5::CReleaseGroup::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised release group element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/SecondaryType.cc b/src/SecondaryType.cc index 46db98d..094f549 100644 --- a/src/SecondaryType.cc +++ b/src/SecondaryType.cc @@ -93,14 +93,20 @@ MusicBrainz5::CSecondaryType *MusicBrainz5::CSecondaryType::Clone() void MusicBrainz5::CSecondaryType::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised secondary type attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CSecondaryType::ParseElement(const XMLNode& Node) { std::string NodeName=Node.getName(); +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised secondary type element: '" << NodeName << "'" << std::endl; +#endif } std::string MusicBrainz5::CSecondaryType::GetElementName() diff --git a/src/Tag.cc b/src/Tag.cc index e9f2d6b..e8d4017 100644 --- a/src/Tag.cc +++ b/src/Tag.cc @@ -90,7 +90,9 @@ void MusicBrainz5::CTag::ParseAttribute(const std::string& Name, const std::stri } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised tag attribute: '" << Name << "'" << std::endl; +#endif } } @@ -104,7 +106,9 @@ void MusicBrainz5::CTag::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised tag element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/TextRepresentation.cc b/src/TextRepresentation.cc index 0d08414..cc4e1be 100644 --- a/src/TextRepresentation.cc +++ b/src/TextRepresentation.cc @@ -79,7 +79,11 @@ MusicBrainz5::CTextRepresentation *MusicBrainz5::CTextRepresentation::Clone() void MusicBrainz5::CTextRepresentation::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised textrepresentation attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CTextRepresentation::ParseElement(const XMLNode& Node) @@ -96,7 +100,9 @@ void MusicBrainz5::CTextRepresentation::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised textrepresentation element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Track.cc b/src/Track.cc index a1b0730..5459efa 100644 --- a/src/Track.cc +++ b/src/Track.cc @@ -117,7 +117,11 @@ MusicBrainz5::CTrack *MusicBrainz5::CTrack::Clone() void MusicBrainz5::CTrack::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised track attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CTrack::ParseElement(const XMLNode& Node) @@ -150,7 +154,9 @@ void MusicBrainz5::CTrack::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised track element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/UserRating.cc b/src/UserRating.cc index 8890786..2b29ae2 100644 --- a/src/UserRating.cc +++ b/src/UserRating.cc @@ -87,14 +87,20 @@ MusicBrainz5::CUserRating *MusicBrainz5::CUserRating::Clone() void MusicBrainz5::CUserRating::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised userrating attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CUserRating::ParseElement(const XMLNode& Node) { std::string Name=Node.getName(); +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised userrating element: '" << Name << "'" << std::endl; +#endif } std::string MusicBrainz5::CUserRating::GetElementName() diff --git a/src/UserTag.cc b/src/UserTag.cc index 157a31f..9acb49c 100644 --- a/src/UserTag.cc +++ b/src/UserTag.cc @@ -77,7 +77,11 @@ MusicBrainz5::CUserTag *MusicBrainz5::CUserTag::Clone() void MusicBrainz5::CUserTag::ParseAttribute(const std::string& Name, const std::string& /*Value*/) { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised usertag attribute: '" << Name << "'" << std::endl; +#else + (void)Name; +#endif } void MusicBrainz5::CUserTag::ParseElement(const XMLNode& Node) @@ -90,7 +94,9 @@ void MusicBrainz5::CUserTag::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised UserTag element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/src/Work.cc b/src/Work.cc index 3dd8683..df4ca13 100644 --- a/src/Work.cc +++ b/src/Work.cc @@ -181,7 +181,11 @@ void MusicBrainz5::CWork::ParseAttribute(const std::string& Name, const std::str else if ("type"==Name) m_d->m_Type=Value; else + { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised work attribute: '" << Name << "'" << std::endl; +#endif + } } void MusicBrainz5::CWork::ParseElement(const XMLNode& Node) @@ -234,7 +238,9 @@ void MusicBrainz5::CWork::ParseElement(const XMLNode& Node) } else { +#ifdef _MB5_DEBUG_ std::cerr << "Unrecognised work element: '" << NodeName << "'" << std::endl; +#endif } } diff --git a/tests/mbtest.cc b/tests/mbtest.cc index 99b9258..8725d11 100644 --- a/tests/mbtest.cc +++ b/tests/mbtest.cc @@ -66,7 +66,7 @@ void PrintRelationList(MusicBrainz5::CRelationList *RelationList) int main(int argc, const char *argv[]) { - MusicBrainz5::CQuery MB2("MBTest/v1.0","test.musicbrainz.org"); + MusicBrainz5::CQuery MB2("MBTest/v1.0","musicbrainz.org"); MusicBrainz5::CQuery::tParamMap Params5; Params5["inc"]="aliases"; @@ -83,11 +83,11 @@ int main(int argc, const char *argv[]) } } - return 0; +// return 0; MusicBrainz5::CMetadata Metadata8=MB2.Query("release-group","2eefe885-f050-426d-93f0-29c5eb8b4f9a"); std::cout << Metadata8 << std::endl; - return 0; +// return 0; MusicBrainz5::CMetadata Metadata7=MB2.Query("artist","4b585938-f271-45e2-b19a-91c634b5e396"); Artist=Metadata7.Artist(); @@ -107,7 +107,7 @@ int main(int argc, const char *argv[]) } } - return 0; +// return 0; MusicBrainz5::CMetadata Metadata6=MB2.Query("release-group","2eefe885-f050-426d-93f0-29c5eb8b4f9a"); MusicBrainz5::CReleaseGroup *ReleaseGroup=Metadata6.ReleaseGroup(); @@ -133,7 +133,7 @@ int main(int argc, const char *argv[]) } } - return 0; +// return 0; MusicBrainz5::CMetadata Metadata4=MB2.Query("work","b0d17375-5593-390e-a936-1a65ce74c630"); @@ -192,7 +192,7 @@ int main(int argc, const char *argv[]) } } - return 0; +// return 0; MusicBrainz5::CQuery MB("MBTest/v1.0"); @@ -222,7 +222,7 @@ int main(int argc, const char *argv[]) } } - return 0; +// return 0; MusicBrainz5::CQuery::tParamMap Params; Params["inc"]="artists labels recordings release-groups url-rels discids recording-level-rels work-level-rels work-rels artist-rels"; @@ -271,7 +271,7 @@ int main(int argc, const char *argv[]) } } - return 0; +// return 0; MusicBrainz5::CMetadata Metadata=MB.Query("collection"); MusicBrainz5::CCollectionList *CollectionList=Metadata.CollectionList(); @@ -298,7 +298,7 @@ int main(int argc, const char *argv[]) MB.Query("collection",Collection->ID(),"releases"); } - return 0; +// return 0; std::string DiscID="arIS30RPWowvwNEqsqdDnZzDGhk-";