Browse Source

Pedantic fixes

Author: jgg
Date: 2001-03-11 07:22:19 GMT
Pedantic fixes
debian/1.8.y
Arch Librarian 18 years ago
parent
commit
500827ed36
  1. 4
      apt-pkg/contrib/configuration.cc
  2. 4
      apt-pkg/contrib/configuration.h
  3. 10
      apt-pkg/contrib/sptr.h
  4. 4
      apt-pkg/contrib/strutl.cc
  5. 6
      apt-pkg/tagfile.h

4
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;
}
}

4
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;

10
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

4
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);

6
apt-pkg/tagfile.h

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: tagfile.h,v 1.15 2001/02/20 07:03:17 jgg Exp $
// $Id: tagfile.h,v 1.16 2001/03/11 07:22:19 jgg Exp $
/* ######################################################################
Fast scanner for RFC-822 type header information
@ -47,8 +47,8 @@ class pkgTagSection
bool Find(const char *Tag,unsigned &Pos) const;
string FindS(const char *Tag) const;
signed int FindI(const char *Tag,signed long Default = 0) const ;
bool pkgTagSection::FindFlag(const char *Tag,unsigned long &Flags,
unsigned long Flag) const;
bool FindFlag(const char *Tag,unsigned long &Flags,
unsigned long Flag) const;
bool Scan(const char *Start,unsigned long MaxLength);
inline unsigned long size() const {return Stop - Section;};
void Trim();

Loading…
Cancel
Save