]> git.saurik.com Git - apt.git/commitdiff
warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizat...
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 27 Feb 2014 02:32:13 +0000 (03:32 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Thu, 13 Mar 2014 12:58:45 +0000 (13:58 +0100)
Git-Dch: Ignore
Reported-By: gcc -Wunsafe-loop-optimizations
apt-pkg/contrib/strutl.cc
apt-pkg/pkgcachegen.cc

index 0d85b4fd3d115c9f57414116682aecc060a17f57..61fcc6a7d79095f46254a542f0b971915621001f 100644 (file)
@@ -1184,7 +1184,7 @@ unsigned long RegexChoice(RxChoiceList *Rxs,const char **ListBegin,
       R->Hit = false;
 
    unsigned long Hits = 0;
-   for (; ListBegin != ListEnd; ListBegin++)
+   for (; ListBegin < ListEnd; ++ListBegin)
    {
       // Check if the name is a regex
       const char *I;
index 96b35f6694f4d7a1b811b9da2f0a1ca60979b38c..006f3952b3b049d8486dd61db82cb983f780a5dc 100644 (file)
@@ -1249,10 +1249,10 @@ static bool CheckValidity(const string &CacheFile,
 static unsigned long ComputeSize(FileIterator Start,FileIterator End)
 {
    unsigned long TotalSize = 0;
-   for (; Start != End; ++Start)
+   for (; Start < End; ++Start)
    {
       if ((*Start)->HasPackages() == false)
-        continue;      
+        continue;
       TotalSize += (*Start)->Size();
    }
    return TotalSize;