Fix cppcheck issues: uninitMemberVar & uninitVar
This commit is contained in:
parent
8b9cbc5888
commit
989acd18c7
@ -150,11 +150,31 @@ strings_t gFiles;
|
||||
class Position
|
||||
{
|
||||
public:
|
||||
Position(time_t time,double lat,double lon,double ele) : time_(time),lon_(lon),lat_(lat),ele_(ele) {};
|
||||
Position() { time_=0 ; lon_=0.0 ; lat_=0.0 ; ele_=0.0 ; };
|
||||
virtual ~Position() {} ;
|
||||
Position(time_t time, double lat, double lon, double ele) :
|
||||
time_(time)
|
||||
, lon_(lon)
|
||||
, lat_(lat)
|
||||
, ele_(ele)
|
||||
, delta_(0)
|
||||
{}
|
||||
|
||||
Position():
|
||||
time_(0)
|
||||
, lon_(0.0)
|
||||
, lat_(0.0)
|
||||
, ele_(0.0)
|
||||
, delta_(0)
|
||||
{ }
|
||||
|
||||
virtual ~Position() {}
|
||||
// copy constructor
|
||||
Position(const Position& o) : time_(o.time_),lon_(o.lon_),lat_(o.lat_),ele_(o.ele_) {};
|
||||
Position(const Position& o) :
|
||||
time_(o.time_)
|
||||
, lon_(o.lon_)
|
||||
, lat_(o.lat_)
|
||||
, ele_(o.ele_)
|
||||
, delta_(o.delta_)
|
||||
{}
|
||||
|
||||
// instance methods
|
||||
bool good() { return time_ || lon_ || lat_ || ele_ ; }
|
||||
@ -262,8 +282,18 @@ time_t Position::deltaMax_ = 60 ;
|
||||
class UserData
|
||||
{
|
||||
public:
|
||||
UserData(Options& options) : indent(0),count(0),nTrkpt(0),bTime(false),bEle(false),options_(options) {};
|
||||
virtual ~UserData() {} ;
|
||||
UserData(Options& options):
|
||||
indent(0)
|
||||
, count(0)
|
||||
, nTrkpt(0)
|
||||
, bTime(false)
|
||||
, bEle(false)
|
||||
, ele(0.0)
|
||||
, lat(0.0)
|
||||
, lon(0.0)
|
||||
, options_(options)
|
||||
{}
|
||||
virtual ~UserData() {}
|
||||
|
||||
// public data members
|
||||
int indent;
|
||||
|
||||
@ -933,9 +933,11 @@ namespace {
|
||||
|
||||
// create decoding table
|
||||
unsigned long invalid = 64;
|
||||
unsigned long decodeBase64Table[256];
|
||||
for (unsigned long i = 0; i < 256; i++) decodeBase64Table[i] = invalid;
|
||||
for (unsigned long i = 0; i < 64; i++) decodeBase64Table[(unsigned char)encodeBase64Table[i]] = i;
|
||||
unsigned long decodeBase64Table[256] = {};
|
||||
for (unsigned long i = 0; i < 256; i++)
|
||||
decodeBase64Table[i] = invalid;
|
||||
for (unsigned long i = 0; i < 64; i++)
|
||||
decodeBase64Table[(unsigned char)encodeBase64Table[i]] = i;
|
||||
|
||||
// calculate dest size
|
||||
unsigned long validSrcSize = 0;
|
||||
|
||||
@ -209,18 +209,20 @@ namespace Exiv2 {
|
||||
{
|
||||
// http://dev.exiv2.org/boards/3/topics/1912?r=1915
|
||||
if ( std::tolower(is.peek()) == 'f' ) {
|
||||
char F;
|
||||
float f;
|
||||
char F = 0;
|
||||
float f = 0.f;
|
||||
is >> F >> f ;
|
||||
f = 2.0f * std::log(f) / std::log(2.0f) ;
|
||||
r = Exiv2::floatToRationalCast(f);
|
||||
} else {
|
||||
int32_t nominator;
|
||||
int32_t denominator;
|
||||
int32_t nominator = 0;
|
||||
int32_t denominator = 0;
|
||||
char c('\0');
|
||||
is >> nominator >> c >> denominator;
|
||||
if (c != '/') is.setstate(std::ios::failbit);
|
||||
if (is) r = std::make_pair(nominator, denominator);
|
||||
if (c != '/')
|
||||
is.setstate(std::ios::failbit);
|
||||
if (is)
|
||||
r = std::make_pair(nominator, denominator);
|
||||
}
|
||||
return is;
|
||||
}
|
||||
@ -233,19 +235,22 @@ namespace Exiv2 {
|
||||
std::istream& operator>>(std::istream& is, URational& r)
|
||||
{
|
||||
// http://dev.exiv2.org/boards/3/topics/1912?r=1915
|
||||
/// \todo This implementation seems to be duplicated for the Rational type. Try to remove duplication
|
||||
if ( std::tolower(is.peek()) == 'f' ) {
|
||||
char F;
|
||||
float f;
|
||||
char F = 0;
|
||||
float f = 0.f;
|
||||
is >> F >> f ;
|
||||
f = 2.0f * std::log(f) / std::log(2.0f) ;
|
||||
r = Exiv2::floatToRationalCast(f);
|
||||
} else {
|
||||
uint32_t nominator;
|
||||
uint32_t denominator;
|
||||
uint32_t nominator = 0;
|
||||
uint32_t denominator = 0;
|
||||
char c('\0');
|
||||
is >> nominator >> c >> denominator;
|
||||
if (c != '/') is.setstate(std::ios::failbit);
|
||||
if (is) r = std::make_pair(nominator, denominator);
|
||||
if (c != '/')
|
||||
is.setstate(std::ios::failbit);
|
||||
if (is)
|
||||
r = std::make_pair(nominator, denominator);
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user