summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2015-10-23 18:02:30 +0200
committerJulian Andres Klode <jak@debian.org>2015-10-23 18:06:23 +0200
commitf77ea39c94988ab6adcb2d6bbf5466b0bc65953b (patch)
tree4d6eba1ade3c5ca1ba92adc79c59cc93b57d2964
parent6586d1dbdbbd19b53ce6f348ea3643f42da354eb (diff)
deblistparser: Make PrioList const
More safety, less writeable memory.
-rw-r--r--apt-pkg/deb/deblistparser.cc4
-rw-r--r--apt-pkg/deb/deblistparser.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index b51ee815e..229cfc29b 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -35,7 +35,7 @@
using std::string;
-static debListParser::WordList PrioList[] = {
+static const debListParser::WordList PrioList[] = {
{"required",pkgCache::State::Required},
{"important",pkgCache::State::Important},
{"standard",pkgCache::State::Standard},
@@ -921,7 +921,7 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver)
// ListParser::GrabWord - Matches a word and returns /*{{{*/
// ---------------------------------------------------------------------
/* Looks for a word in a list of words - for ParseStatus */
-bool debListParser::GrabWord(string Word,WordList *List,unsigned char &Out)
+bool debListParser::GrabWord(string Word,const WordList *List,unsigned char &Out)
{
for (unsigned int C = 0; List[C].Str != 0; C++)
{
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index 0884479db..42111c837 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/apt-pkg/deb/deblistparser.h
@@ -50,7 +50,7 @@ class APT_HIDDEN debListParser : public pkgCacheListParser
bool ParseDepends(pkgCache::VerIterator &Ver,const char *Tag,
unsigned int Type);
bool ParseProvides(pkgCache::VerIterator &Ver);
- static bool GrabWord(std::string Word,WordList *List,unsigned char &Out);
+ static bool GrabWord(std::string Word,const WordList *List,unsigned char &Out);
APT_HIDDEN unsigned char ParseMultiArch(bool const showErrors);
public: