From 6c55f07a5fa3612a5d59c61a17da5fe640eadc8b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Jun 2015 09:29:00 +0200 Subject: make all d-pointer * const pointers Doing this disables the implicit copy assignment operator (among others) which would cause hovac if used on the classes as it would just copy the pointer, not the data the d-pointer points to. For most of the classes we don't need a copy assignment operator anyway and in many classes it was broken before as many contain a pointer of some sort. Only for our Cacheset Container interfaces we define an explicit copy assignment operator which could later be implemented to copy the data from one d-pointer to the other if we need it. Git-Dch: Ignore --- apt-pkg/edsp/edspindexfile.cc | 2 +- apt-pkg/edsp/edspindexfile.h | 2 +- apt-pkg/edsp/edsplistparser.cc | 2 +- apt-pkg/edsp/edsplistparser.h | 2 +- apt-pkg/edsp/edspsystem.cc | 8 ++------ apt-pkg/edsp/edspsystem.h | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) (limited to 'apt-pkg/edsp') diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index 5d9383e94..3bffc27e9 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -29,7 +29,7 @@ // edspIndex::edspIndex - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -edspIndex::edspIndex(std::string File) : debStatusIndex(File) +edspIndex::edspIndex(std::string File) : debStatusIndex(File), d(NULL) { } /*}}}*/ diff --git a/apt-pkg/edsp/edspindexfile.h b/apt-pkg/edsp/edspindexfile.h index 0f63b7b2a..265a016c5 100644 --- a/apt-pkg/edsp/edspindexfile.h +++ b/apt-pkg/edsp/edspindexfile.h @@ -21,7 +21,7 @@ class pkgCacheGenerator; class APT_HIDDEN edspIndex : public debStatusIndex { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; public: diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc index d1c0cf7e8..63f006628 100644 --- a/apt-pkg/edsp/edsplistparser.cc +++ b/apt-pkg/edsp/edsplistparser.cc @@ -22,7 +22,7 @@ /*}}}*/ // ListParser::edspListParser - Constructor /*{{{*/ -edspListParser::edspListParser(FileFd *File, std::string const &Arch) : debListParser(File, Arch) +edspListParser::edspListParser(FileFd *File, std::string const &Arch) : debListParser(File, Arch), d(NULL) {} /*}}}*/ // ListParser::NewVersion - Fill in the version structure /*{{{*/ diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index ef5179e68..98dde4bf5 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -27,7 +27,7 @@ class FileFd; class APT_HIDDEN edspListParser : public debListParser { - void *d; + void * const d; public: virtual bool NewVersion(pkgCache::VerIterator &Ver); virtual std::string Description(); diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc index 063517421..4fb34b896 100644 --- a/apt-pkg/edsp/edspsystem.cc +++ b/apt-pkg/edsp/edspsystem.cc @@ -26,13 +26,9 @@ #include /*}}}*/ -// System::debSystem - Constructor /*{{{*/ -edspSystem::edspSystem() +// System::edspSystem - Constructor /*{{{*/ +edspSystem::edspSystem() : pkgSystem("Debian APT solver interface", &debVS), d(NULL), StatusFile(NULL) { - StatusFile = 0; - - Label = "Debian APT solver interface"; - VS = &debVS; } /*}}}*/ // System::~debSystem - Destructor /*{{{*/ diff --git a/apt-pkg/edsp/edspsystem.h b/apt-pkg/edsp/edspsystem.h index 1e27d2cb0..156b02bb5 100644 --- a/apt-pkg/edsp/edspsystem.h +++ b/apt-pkg/edsp/edspsystem.h @@ -25,7 +25,7 @@ class edspIndex; class APT_HIDDEN edspSystem : public pkgSystem { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; edspIndex *StatusFile; -- cgit v1.2.3