summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:57:13 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:57:13 +0000
commit500827ed367c8ac277abbd582d389f6738905a09 (patch)
tree858f2638647a3ae5ad14006f2c3be28bd0456811 /apt-pkg/contrib
parent678bc33eaf95356d1b63090d220b65162478b89a (diff)
Pedantic fixes
Author: jgg Date: 2001-03-11 07:22:19 GMT Pedantic fixes
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/configuration.cc4
-rw-r--r--apt-pkg/contrib/configuration.h4
-rw-r--r--apt-pkg/contrib/sptr.h10
-rw-r--r--apt-pkg/contrib/strutl.cc4
4 files changed, 11 insertions, 11 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc
index e15bc67ca..97d99210f 100644
--- a/apt-pkg/contrib/configuration.cc
+++ b/apt-pkg/contrib/configuration.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: configuration.cc,v 1.18 2001/03/05 21:09:12 jgg Exp $
+// $Id: configuration.cc,v 1.19 2001/03/11 07:22:19 jgg Exp $
/* ######################################################################
Configuration Class
@@ -276,7 +276,7 @@ string Configuration::FindAny(const char *Name,const char *Default) const
case 'i':
{
char buf[16];
- snprintf(buf, sizeof(buf)-1, "%d", FindI(key, Default));
+ snprintf(buf, sizeof(buf)-1, "%d", FindI(key, atoi(Default)));
return buf;
}
}
diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h
index 643e0f628..84a8cf07e 100644
--- a/apt-pkg/contrib/configuration.h
+++ b/apt-pkg/contrib/configuration.h
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: configuration.h,v 1.12 2001/02/20 07:03:17 jgg Exp $
+// $Id: configuration.h,v 1.13 2001/03/11 07:22:19 jgg Exp $
/* ######################################################################
Configuration Class
@@ -70,7 +70,7 @@ class Configuration
string FindFile(const char *Name,const char *Default = 0) const;
string FindDir(const char *Name,const char *Default = 0) const;
int FindI(const char *Name,int Default = 0) const;
- int FindI(string Name,bool Default = 0) const {return FindI(Name.c_str(),Default);};
+ int FindI(string Name,int Default = 0) const {return FindI(Name.c_str(),Default);};
bool FindB(const char *Name,bool Default = false) const;
bool FindB(string Name,bool Default = false) const {return FindB(Name.c_str(),Default);};
string FindAny(const char *Name,const char *Default = 0) const;
diff --git a/apt-pkg/contrib/sptr.h b/apt-pkg/contrib/sptr.h
index a9347edf9..9df0e44a7 100644
--- a/apt-pkg/contrib/sptr.h
+++ b/apt-pkg/contrib/sptr.h
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: sptr.h,v 1.2 2001/02/20 07:03:17 jgg Exp $
+// $Id: sptr.h,v 1.3 2001/03/11 07:22:19 jgg Exp $
/* ######################################################################
Trivial non-ref counted 'smart pointer'
@@ -48,19 +48,19 @@ class SPtrArray
public:
T *Ptr;
- inline T &operator *() {return *Ptr;};
+ //inline T &operator *() {return *Ptr;};
inline operator T *() {return Ptr;};
inline operator void *() {return Ptr;};
inline T *UnGuard() {T *Tmp = Ptr; Ptr = 0; return Tmp;};
- inline T &operator [](signed long I) {return Ptr[I];};
+ //inline T &operator [](signed long I) {return Ptr[I];};
inline void operator =(T *N) {Ptr = N;};
inline bool operator ==(T *lhs) const {return Ptr == lhs;};
inline bool operator !=(T *lhs) const {return Ptr != lhs;};
- inline T*Get() {return Ptr;};
+ inline T *Get() {return Ptr;};
inline SPtrArray(T *Ptr) : Ptr(Ptr) {};
inline SPtrArray() : Ptr(0) {};
- inline ~SPtrArray() {delete []Ptr;};
+ inline ~SPtrArray() {delete [] Ptr;};
};
#endif
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index d7a5925da..9be173542 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: strutl.cc,v 1.37 2001/02/23 06:08:57 jgg Exp $
+// $Id: strutl.cc,v 1.38 2001/03/11 07:22:19 jgg Exp $
/* ######################################################################
String Util - Some useful string functions.
@@ -495,7 +495,7 @@ string LookupTag(string Message,const char *Tag,const char *Default)
// ---------------------------------------------------------------------
/* This inspects the string to see if it is true or if it is false and
then returns the result. Several varients on true/false are checked. */
-int StringToBool(string Text,int Default = -1)
+int StringToBool(string Text,int Default)
{
char *End;
int Res = strtol(Text.c_str(),&End,0);