Author: aschnell
Date: Thu Apr 23 15:45:02 2009
New Revision: 56936
URL: http://svn.opensuse.org/viewcvs/yast?rev=56936&view=rev
Log:
- added some const
Modified:
trunk/storage/libstorage/src/Disk.cc
trunk/storage/libstorage/src/Disk.h
Modified: trunk/storage/libstorage/src/Disk.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.cc?rev=56936&r1=56935&r2=56936&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Disk.cc (original)
+++ trunk/storage/libstorage/src/Disk.cc Thu Apr 23 15:45:02 2009
@@ -583,7 +583,7 @@
bool
Disk::scanPartedLine( const string& Line, unsigned& nr, unsigned long& start,
unsigned long& csize, PartitionType& type, unsigned& id,
- bool& boot )
+ bool& boot ) const
{
unsigned long StartM, EndM;
string PartitionType, TInfo;
@@ -846,7 +846,7 @@
bool
Disk::checkPartedValid(const ProcPart& pp, const string& diskname,
- list& pl, unsigned long& range_exceed)
+ list& pl, unsigned long& range_exceed) const
{
unsigned ext_nr = 0;
bool ret=true;
@@ -1395,13 +1395,13 @@
}
int Disk::createChecks( PartitionType& type, unsigned long start,
- unsigned long len, bool checkRelaxed )
+ unsigned long len, bool checkRelaxed ) const
{
y2mil("begin type " << type << " at " << start << " len " << len << " relaxed:" << checkRelaxed);
unsigned fuzz = checkRelaxed ? 2 : 0;
int ret = 0;
Region r( start, len );
- PartPair ext = partPair(notDeletedExt);
+ ConstPartPair ext = partPair(notDeletedExt);
if( type==PTYPE_ANY )
{
if( ext.empty() || !ext.begin()->contains( Region(start,1) ))
@@ -1429,9 +1429,8 @@
}
if( ret==0 )
{
- PartPair p = (type!=LOGICAL) ? partPair( notDeleted )
- : partPair( notDeletedLog );
- PartIter i = p.begin();
+ ConstPartPair p = (type != LOGICAL) ? partPair(notDeleted) : partPair(notDeletedLog);
+ ConstPartIter i = p.begin();
while( i!=p.end() && !i->intersectArea( r, fuzz ))
{
++i;
@@ -1458,7 +1457,7 @@
}
}
y2mil("ret:" << ret);
- return( ret );
+ return ret;
}
int Disk::changePartitionArea( unsigned nr, unsigned long start,
@@ -2014,7 +2013,7 @@
}
bool
-Disk::getPartedValues( Partition *p )
+Disk::getPartedValues( Partition *p ) const
{
bool ret = false;
if( getStorage()->test() )
@@ -2060,7 +2059,7 @@
bool
Disk::getPartedSectors( const Partition *p, unsigned long long& start,
- unsigned long long& end )
+ unsigned long long& end ) const
{
bool ret = false;
if( getStorage()->test() )
@@ -2549,12 +2548,12 @@
return( ret );
}
-const Partition * Disk::getPartitionAfter( const Partition * p )
+const Partition* Disk::getPartitionAfter(const Partition* p) const
{
- const Partition * ret = NULL;
+ const Partition* ret = NULL;
y2mil( "p:" << *p );
- PartPair pp = partPair( (p->type()==LOGICAL)?notDeleted:notDeletedLog );
- for( PartIter pi=pp.begin(); pi!=pp.end(); ++pi )
+ ConstPartPair pp = partPair((p->type() == LOGICAL) ? notDeleted : notDeletedLog);
+ for (ConstPartIter pi = pp.begin(); pi != pp.end(); ++pi)
{
if( !pi->created() &&
pi->cylStart()>p->cylStart() &&
@@ -2565,7 +2564,7 @@
y2mil( "ret:NULL" );
else
y2mil( "ret:" << *ret );
- return( ret );
+ return ret;
}
unsigned Disk::numPartitions() const
Modified: trunk/storage/libstorage/src/Disk.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.h?rev=56936&r1=56935&r2=56936&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Disk.h (original)
+++ trunk/storage/libstorage/src/Disk.h Thu Apr 23 15:45:02 2009
@@ -173,13 +173,13 @@
bool scanPartedLine( const string& Line, unsigned& nr,
unsigned long& start, unsigned long& csize,
storage::PartitionType& type,
- unsigned& id, bool& boot );
+ unsigned& id, bool& boot ) const;
bool checkPartedValid( const ProcPart& pp, const string& diskname,
- std::list& pl, unsigned long& rng );
- bool getPartedValues( Partition *p );
+ std::list& pl, unsigned long& rng ) const;
+ bool getPartedValues( Partition *p ) const;
bool getPartedSectors( const Partition *p, unsigned long long& start,
- unsigned long long& end );
- const Partition * getPartitionAfter( const Partition * p );
+ unsigned long long& end ) const;
+ const Partition * getPartitionAfter( const Partition * p ) const;
virtual void print( std::ostream& s ) const { s << *this; }
virtual Container* getCopy() const { return( new Disk( *this ) ); }
void getGeometry( const string& line, unsigned long& c,
@@ -188,7 +188,7 @@
void changeNumbers( const PartIter& b, const PartIter& e,
unsigned start, int incr );
int createChecks( storage::PartitionType& type, unsigned long start,
- unsigned long len, bool checkRelaxed );
+ unsigned long len, bool checkRelaxed ) const;
void removePresentPartitions();
void removeFromMemory();
void enlargeGpt();
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org