Sfoglia il codice sorgente

do not inline virtual destructors with d-pointers

Reimplementing an inline method is opening a can of worms we don't want
to open if we ever want to us a d-pointer in those classes, so we do the
only thing which can save us from hell: move the destructors into the cc
sources and we are good.

Technically not an ABI break as the methods inline or not do the same
(nothing), so a program compiled against the old version still works
with the new version (beside that this version is still in experimental,
so nothing really has been build against this library anyway).

Git-Dch: Ignore
David Kalnischkies 11 anni fa
parent
commit
862bafea48

+ 2 - 0
apt-pkg/acquire-method.cc

@@ -477,3 +477,5 @@ void pkgAcqMethod::Dequeue() {						/*{{{*/
    delete Tmp;
 }
 									/*}}}*/
+
+pkgAcqMethod::~pkgAcqMethod() {}

+ 1 - 1
apt-pkg/acquire-method.h

@@ -108,7 +108,7 @@ class pkgAcqMethod
    inline void SetIP(std::string aIP) {IP = aIP;};
    
    pkgAcqMethod(const char *Ver,unsigned long Flags = 0);
-   virtual ~pkgAcqMethod() {};
+   virtual ~pkgAcqMethod();
    void DropPrivsOrDie();
    private:
    APT_HIDDEN void Dequeue();

+ 4 - 0
apt-pkg/acquire.cc

@@ -1016,3 +1016,7 @@ void pkgAcquireStatus::Fetched(unsigned long long Size,unsigned long long Resume
    FetchedBytes += Size - Resume;
 }
 									/*}}}*/
+
+pkgAcquire::UriIterator::~UriIterator() {}
+pkgAcquire::MethodConfig::~MethodConfig() {}
+pkgAcquireStatus::~pkgAcquireStatus() {}

+ 3 - 4
apt-pkg/acquire.h

@@ -603,7 +603,7 @@ class pkgAcquire::UriIterator
 	 CurQ = CurQ->Next;
       }
    }   
-   virtual ~UriIterator() {};
+   virtual ~UriIterator();
 };
 									/*}}}*/
 /** \brief Information about the properties of a single acquire method.	{{{*/
@@ -661,8 +661,7 @@ struct pkgAcquire::MethodConfig
     */
    MethodConfig();
 
-   /* \brief Destructor, empty currently */
-   virtual ~MethodConfig() {};
+   virtual ~MethodConfig();
 };
 									/*}}}*/
 /** \brief A monitor object for downloads controlled by the pkgAcquire class.	{{{
@@ -808,7 +807,7 @@ class pkgAcquireStatus
    
    /** \brief Initialize all counters to 0 and the time to the current time. */
    pkgAcquireStatus();
-   virtual ~pkgAcquireStatus() {};
+   virtual ~pkgAcquireStatus();
 };
 									/*}}}*/
 /** @} */

+ 2 - 0
apt-pkg/clean.cc

@@ -131,3 +131,5 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache)
    return true;
 }
 									/*}}}*/
+
+pkgArchiveCleaner::~pkgArchiveCleaner() {}

+ 4 - 4
apt-pkg/clean.h

@@ -24,13 +24,13 @@ class pkgArchiveCleaner
    void *d;
 
    protected:
-   
+
    virtual void Erase(const char * /*File*/,std::string /*Pkg*/,std::string /*Ver*/,struct stat & /*St*/) {};
 
-   public:   
-   
+   public:
+
    bool Go(std::string Dir,pkgCache &Cache);
-   virtual ~pkgArchiveCleaner() {};
+   virtual ~pkgArchiveCleaner();
 };
 
 #endif

+ 7 - 7
apt-pkg/deb/debindexfile.cc

@@ -806,8 +806,6 @@ unsigned long debDscFileIndex::Size() const
 }
 
 // DscFileIndex::CreateSrcParser - Get a parser for the .dsc file	/*{{{*/
-// ---------------------------------------------------------------------
-/* */
 pkgSrcRecords::Parser *debDscFileIndex::CreateSrcParser() const
 {
    if (!FileExists(DscFile))
@@ -816,11 +814,6 @@ pkgSrcRecords::Parser *debDscFileIndex::CreateSrcParser() const
    return new debDscRecordParser(DscFile,this);
 }
 									/*}}}*/
-
-
-
-
-// ---------------------------------------------------------------------
 // Index File types for Debian						/*{{{*/
 class debIFTypeSrc : public pkgIndexFile::Type
 {
@@ -919,3 +912,10 @@ const pkgIndexFile::Type *debDebianSourceDirIndex::GetType() const
    return &_apt_DebianSourceDir;
 }
 									/*}}}*/
+
+debStatusIndex::~debStatusIndex() {}
+debPackagesIndex::~debPackagesIndex() {}
+debTranslationsIndex::~debTranslationsIndex() {}
+debSourcesIndex::~debSourcesIndex() {}
+
+debDebPkgFileIndex::~debDebPkgFileIndex() {}

+ 6 - 6
apt-pkg/deb/debindexfile.h

@@ -52,7 +52,7 @@ class debStatusIndex : public pkgIndexFile
    virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
 
    debStatusIndex(std::string File);
-   virtual ~debStatusIndex() {};
+   virtual ~debStatusIndex();
 };
     
 class debPackagesIndex : public pkgIndexFile
@@ -89,7 +89,7 @@ class debPackagesIndex : public pkgIndexFile
 
    debPackagesIndex(std::string const &URI, std::string const &Dist, std::string const &Section,
 			bool const &Trusted, std::string const &Arch = "native");
-   virtual ~debPackagesIndex() {};
+   virtual ~debPackagesIndex();
 };
 
 class debTranslationsIndex : public pkgIndexFile
@@ -124,7 +124,7 @@ class debTranslationsIndex : public pkgIndexFile
    virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
 
    debTranslationsIndex(std::string URI,std::string Dist,std::string Section, char const * const Language);
-   virtual ~debTranslationsIndex() {};
+   virtual ~debTranslationsIndex();
 };
 
 class debSourcesIndex : public pkgIndexFile
@@ -161,7 +161,7 @@ class debSourcesIndex : public pkgIndexFile
    virtual unsigned long Size() const;
    
    debSourcesIndex(std::string URI,std::string Dist,std::string Section,bool Trusted);
-   virtual ~debSourcesIndex() {};
+   virtual ~debSourcesIndex();
 };
 
 class debDebPkgFileIndex : public pkgIndexFile
@@ -191,8 +191,8 @@ class debDebPkgFileIndex : public pkgIndexFile
    virtual std::string ArchiveURI(std::string /*File*/) const;
 
    debDebPkgFileIndex(std::string DebFile);
-   virtual ~debDebPkgFileIndex() {};
-};   
+   virtual ~debDebPkgFileIndex();
+};
 
 class debDscFileIndex : public pkgIndexFile
 {

+ 1 - 2
apt-pkg/deb/deblistparser.cc

@@ -1015,5 +1015,4 @@ bool debDebFileParser::UsePackage(pkgCache::PkgIterator &Pkg,
    return res;
 }
 
-
-
+debListParser::~debListParser() {}

+ 1 - 1
apt-pkg/deb/deblistparser.h

@@ -100,7 +100,7 @@ class debListParser : public pkgCacheGenerator::ListParser
    static const char *ConvertRelation(const char *I,unsigned int &Op);
 
    debListParser(FileFd *File, std::string const &Arch = "");
-   virtual ~debListParser() {};
+   virtual ~debListParser();
 };
 
 class debDebFileParser : public debListParser

+ 2 - 0
apt-pkg/deb/debrecords.cc

@@ -207,3 +207,5 @@ void debRecordParser::GetRec(const char *&Start,const char *&Stop)
    Section.GetSection(Start,Stop);
 }
 									/*}}}*/
+
+debRecordParser::~debRecordParser() {};

+ 1 - 1
apt-pkg/deb/debrecords.h

@@ -60,7 +60,7 @@ class debRecordParser : public pkgRecords::Parser
    virtual void GetRec(const char *&Start,const char *&Stop);
    
    debRecordParser(std::string FileName,pkgCache &Cache);
-   virtual ~debRecordParser() {};
+   virtual ~debRecordParser();
 };
 
 // custom record parser that reads deb files directly

+ 2 - 0
apt-pkg/indexcopy.cc

@@ -793,3 +793,5 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name,	/*{{{*/
    return true;
 }
 									/*}}}*/
+
+IndexCopy::~IndexCopy() {}

+ 1 - 1
apt-pkg/indexcopy.h

@@ -53,7 +53,7 @@ class IndexCopy								/*{{{*/
 
    bool CopyPackages(std::string CDROM,std::string Name,std::vector<std::string> &List,
 		     pkgCdromStatus *log);
-   virtual ~IndexCopy() {};
+   virtual ~IndexCopy();
 };
 									/*}}}*/
 class PackageCopy : public IndexCopy					/*{{{*/

+ 2 - 0
apt-pkg/indexrecords.cc

@@ -261,3 +261,5 @@ indexRecords::indexRecords(const string ExpectedDist) :
    ExpectedDist(ExpectedDist), ValidUntil(0), SupportsAcquireByHash(false)
 {
 }
+
+indexRecords::~indexRecords() {}

+ 1 - 1
apt-pkg/indexrecords.h

@@ -56,7 +56,7 @@ class indexRecords
    time_t GetValidUntil() const;
    virtual bool CheckDist(const std::string MaybeDist) const;
    std::string GetExpectedDist() const;
-   virtual ~indexRecords(){};
+   virtual ~indexRecords();
 };
 
 #if __GNUC__ >= 4

+ 2 - 0
apt-pkg/tagfile.cc

@@ -757,3 +757,5 @@ bool TFRewrite(FILE *Output,pkgTagSection const &Tags,const char *Order[],
    return true;
 }
 									/*}}}*/
+
+pkgTagSection::~pkgTagSection() {}

+ 1 - 1
apt-pkg/tagfile.h

@@ -109,7 +109,7 @@ class pkgTagSection
    };
    
    pkgTagSection();
-   virtual ~pkgTagSection() {};
+   virtual ~pkgTagSection();
 };
 
 class pkgTagFilePrivate;