From ef74268b47fae1afd302a4a524b53143cbfd6ce1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 27 Feb 2014 03:32:13 +0100 Subject: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] Git-Dch: Ignore Reported-By: gcc -Wunsafe-loop-optimizations --- apt-pkg/contrib/strutl.cc | 2 +- apt-pkg/pkgcachegen.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 0d85b4fd3..61fcc6a7d 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -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; diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 96b35f669..006f3952b 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -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; -- cgit v1.2.3