]> git.saurik.com Git - apt.git/commitdiff
deblistparser: Make PrioList const
authorJulian Andres Klode <jak@debian.org>
Fri, 23 Oct 2015 16:02:30 +0000 (18:02 +0200)
committerJulian Andres Klode <jak@debian.org>
Fri, 23 Oct 2015 16:06:23 +0000 (18:06 +0200)
More safety, less writeable memory.

apt-pkg/deb/deblistparser.cc
apt-pkg/deb/deblistparser.h

index b51ee815e363f11e7d79effd54f10f57da6b4d6c..229cfc29b2803c1628b99cb5c399c847f1e6e56f 100644 (file)
@@ -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++)
    {
index 0884479db7a512773da2db7f0f253c67031c666c..42111c83745f647fbb8b77189926c793a188222f 100644 (file)
@@ -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: