HCoop
/
ntk
/
apt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f7f0d6c
)
fix a few more cppcheck performance and scope warnings
author
David Kalnischkies
<kalnischkies@gmail.com>
Thu, 11 Aug 2011 21:01:15 +0000
(23:01 +0200)
committer
David Kalnischkies
<kalnischkies@gmail.com>
Thu, 11 Aug 2011 21:01:15 +0000
(23:01 +0200)
apt-pkg/contrib/netrc.cc
patch
|
blob
|
blame
|
history
apt-pkg/indexcopy.cc
patch
|
blob
|
blame
|
history
apt-pkg/orderlist.cc
patch
|
blob
|
blame
|
history
apt-pkg/packagemanager.cc
patch
|
blob
|
blame
|
history
cmdline/apt-sortpkgs.cc
patch
|
blob
|
blame
|
history
diff --git
a/apt-pkg/contrib/netrc.cc
b/apt-pkg/contrib/netrc.cc
index
34f472e
..
9ff5796
100644
(file)
--- a/
apt-pkg/contrib/netrc.cc
+++ b/
apt-pkg/contrib/netrc.cc
@@
-47,10
+47,7
@@
int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL)
int specific_login = (login[0] != 0);
char *home = NULL;
bool netrc_alloc = false;
int specific_login = (login[0] != 0);
char *home = NULL;
bool netrc_alloc = false;
- int state = NOTHING;
- char state_login = 0; /* Found a login keyword */
- char state_password = 0; /* Found a password keyword */
int state_our_login = false; /* With specific_login,
found *our* login name */
int state_our_login = false; /* With specific_login,
found *our* login name */
@@
-81,6
+78,10
@@
int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL)
bool done = false;
char netrcbuffer[256];
bool done = false;
char netrcbuffer[256];
+ int state = NOTHING;
+ char state_login = 0; /* Found a login keyword */
+ char state_password = 0; /* Found a password keyword */
+
while (!done && fgets(netrcbuffer, sizeof (netrcbuffer), file)) {
tok = strtok_r (netrcbuffer, " \t\n", &tok_buf);
while (!done && tok) {
while (!done && fgets(netrcbuffer, sizeof (netrcbuffer), file)) {
tok = strtok_r (netrcbuffer, " \t\n", &tok_buf);
while (!done && tok) {
diff --git
a/apt-pkg/indexcopy.cc
b/apt-pkg/indexcopy.cc
index
b262e21
..
747e464
100644
(file)
--- a/
apt-pkg/indexcopy.cc
+++ b/
apt-pkg/indexcopy.cc
@@
-885,7
+885,6
@@
bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
this->Section = &Section;
string Prefix;
unsigned long Hits = 0;
this->Section = &Section;
string Prefix;
unsigned long Hits = 0;
- unsigned long Chop = 0;
while (Parser.Step(Section) == true)
{
if(Progress)
while (Parser.Step(Section) == true)
{
if(Progress)
@@
-903,7
+902,7
@@
bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
fclose(TargetFl);
if (Debug == true)
fclose(TargetFl);
if (Debug == true)
- cout << " Processed by using Prefix '" << Prefix << "' and chop " <<
Chop <<
endl;
+ cout << " Processed by using Prefix '" << Prefix << "' and chop " << endl;
if (_config->FindB("APT::CDROM::NoAct",false) == false)
{
if (_config->FindB("APT::CDROM::NoAct",false) == false)
{
diff --git
a/apt-pkg/orderlist.cc
b/apt-pkg/orderlist.cc
index
6034138
..
a58efa9
100644
(file)
--- a/
apt-pkg/orderlist.cc
+++ b/
apt-pkg/orderlist.cc
@@
-145,13
+145,13
@@
bool pkgOrderList::DoRun()
Depth = 0;
WipeFlags(Added | AddPending | Loop | InList);
Depth = 0;
WipeFlags(Added | AddPending | Loop | InList);
- for (iterator I = List; I != End;
I++
)
+ for (iterator I = List; I != End;
++I
)
Flag(*I,InList);
// Rebuild the main list into the temp list.
iterator OldEnd = End;
End = NList;
Flag(*I,InList);
// Rebuild the main list into the temp list.
iterator OldEnd = End;
End = NList;
- for (iterator I = List; I != OldEnd;
I++
)
+ for (iterator I = List; I != OldEnd;
++I
)
if (VisitNode(PkgIterator(Cache,*I)) == false)
{
End = OldEnd;
if (VisitNode(PkgIterator(Cache,*I)) == false)
{
End = OldEnd;
@@
-197,7
+197,7
@@
bool pkgOrderList::OrderCritical()
{
clog << "** Critical Unpack ordering done" << endl;
{
clog << "** Critical Unpack ordering done" << endl;
- for (iterator I = List; I != End;
I++
)
+ for (iterator I = List; I != End;
++I
)
{
PkgIterator P(Cache,*I);
if (IsNow(P) == true)
{
PkgIterator P(Cache,*I);
if (IsNow(P) == true)
@@
-222,7
+222,7
@@
bool pkgOrderList::OrderUnpack(string *FileList)
WipeFlags(After);
// Set the inlist flag
WipeFlags(After);
// Set the inlist flag
- for (iterator I = List; I != End;
I++
)
+ for (iterator I = List; I != End;
++I
)
{
PkgIterator P(Cache,*I);
if (IsMissing(P) == true && IsNow(P) == true)
{
PkgIterator P(Cache,*I);
if (IsMissing(P) == true && IsNow(P) == true)
@@
-270,7
+270,7
@@
bool pkgOrderList::OrderUnpack(string *FileList)
{
clog << "** Unpack ordering done" << endl;
{
clog << "** Unpack ordering done" << endl;
- for (iterator I = List; I != End;
I++
)
+ for (iterator I = List; I != End;
++I
)
{
PkgIterator P(Cache,*I);
if (IsNow(P) == true)
{
PkgIterator P(Cache,*I);
if (IsNow(P) == true)
diff --git
a/apt-pkg/packagemanager.cc
b/apt-pkg/packagemanager.cc
index
999a7b0
..
060cd32
100644
(file)
--- a/
apt-pkg/packagemanager.cc
+++ b/
apt-pkg/packagemanager.cc
@@
-63,7
+63,7
@@
bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
if (ordering == false)
return _error->Error("Internal ordering error");
if (ordering == false)
return _error->Error("Internal ordering error");
- for (pkgOrderList::iterator I = List->begin(); I != List->end();
I++
)
+ for (pkgOrderList::iterator I = List->begin(); I != List->end();
++I
)
{
PkgIterator Pkg(Cache,*I);
FileNames[Pkg->ID] = string();
{
PkgIterator Pkg(Cache,*I);
FileNames[Pkg->ID] = string();
@@
-262,7
+262,7
@@
bool pkgPackageManager::ConfigureAll()
pkgOrderList OList(&Cache);
// Populate the order list
pkgOrderList OList(&Cache);
// Populate the order list
- for (pkgOrderList::iterator I = List->begin(); I != List->end();
I++
)
+ for (pkgOrderList::iterator I = List->begin(); I != List->end();
++I
)
if (List->IsFlag(pkgCache::PkgIterator(Cache,*I),
pkgOrderList::UnPacked) == true)
OList.push_back(*I);
if (List->IsFlag(pkgCache::PkgIterator(Cache,*I),
pkgOrderList::UnPacked) == true)
OList.push_back(*I);
@@
-274,7
+274,7
@@
bool pkgPackageManager::ConfigureAll()
bool const ConfigurePkgs = (conf == "all");
// Perform the configuring
bool const ConfigurePkgs = (conf == "all");
// Perform the configuring
- for (pkgOrderList::iterator I = OList.begin(); I != OList.end();
I++
)
+ for (pkgOrderList::iterator I = OList.begin(); I != OList.end();
++I
)
{
PkgIterator Pkg(Cache,*I);
{
PkgIterator Pkg(Cache,*I);
@@
-309,7
+309,7
@@
bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
return false;
// Perform the configuring
return false;
// Perform the configuring
- for (pkgOrderList::iterator I = OList.begin(); I != OList.end();
I++
)
+ for (pkgOrderList::iterator I = OList.begin(); I != OList.end();
++I
)
{
PkgIterator Pkg(Cache,*I);
{
PkgIterator Pkg(Cache,*I);
@@
-652,7
+652,7
@@
pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
clog << "Done ordering" << endl;
bool DoneSomething = false;
clog << "Done ordering" << endl;
bool DoneSomething = false;
- for (pkgOrderList::iterator I = List->begin(); I != List->end();
I++
)
+ for (pkgOrderList::iterator I = List->begin(); I != List->end();
++I
)
{
PkgIterator Pkg(Cache,*I);
{
PkgIterator Pkg(Cache,*I);
@@
-701,7
+701,7
@@
pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
return Failed;
// Sanity check
return Failed;
// Sanity check
- for (pkgOrderList::iterator I = List->begin(); I != List->end();
I++
)
+ for (pkgOrderList::iterator I = List->begin(); I != List->end();
++I
)
{
if (List->IsFlag(*I,pkgOrderList::Configured) == false)
{
{
if (List->IsFlag(*I,pkgOrderList::Configured) == false)
{
diff --git
a/cmdline/apt-sortpkgs.cc
b/cmdline/apt-sortpkgs.cc
index
171b0ba
..
f95a434
100644
(file)
--- a/
cmdline/apt-sortpkgs.cc
+++ b/
cmdline/apt-sortpkgs.cc
@@
-106,7
+106,7
@@
bool DoIt(string InFile)
// Emit
unsigned char *Buffer = new unsigned char[Largest+1];
// Emit
unsigned char *Buffer = new unsigned char[Largest+1];
- for (vector<PkgName>::iterator I = List.begin(); I != List.end();
I++
)
+ for (vector<PkgName>::iterator I = List.begin(); I != List.end();
++I
)
{
// Read in the Record.
if (Fd.Seek(I->Offset) == false || Fd.Read(Buffer,I->Length) == false)
{
// Read in the Record.
if (Fd.Seek(I->Offset) == false || Fd.Read(Buffer,I->Length) == false)