Author: aschnell
Date: Sat Apr 18 14:19:45 2009
New Revision: 56839
URL: http://svn.opensuse.org/viewcvs/yast?rev=56839&view=rev
Log:
- minor improvements/cleanups (due to rainy weather)
Modified:
trunk/storage/libstorage/src/Dasd.cc
trunk/storage/libstorage/src/Disk.cc
trunk/storage/libstorage/src/DmCo.cc
trunk/storage/libstorage/src/DmPartCo.cc
trunk/storage/libstorage/src/EtcFstab.cc
trunk/storage/libstorage/src/EtcFstab.h
trunk/storage/libstorage/src/EtcRaidtab.cc
trunk/storage/libstorage/src/EtcRaidtab.h
trunk/storage/libstorage/src/LoopCo.cc
trunk/storage/libstorage/src/NfsCo.cc
trunk/storage/libstorage/src/Region.h
trunk/storage/libstorage/src/Storage.h
trunk/storage/libstorage/src/StorageTypes.cc
trunk/storage/libstorage/src/StorageTypes.h
Modified: trunk/storage/libstorage/src/Dasd.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Dasd.cc?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Dasd.cc (original)
+++ trunk/storage/libstorage/src/Dasd.cc Sat Apr 18 14:19:45 2009
@@ -435,7 +435,7 @@
Disk::getCommitActions( l );
if( init_disk )
{
- l.remove_if(stage_equal_to(DECREASE));
+ l.remove_if(stage_is(DECREASE));
l.push_front(commitAction(DECREASE, staticType(), dasdfmtText(false), this, true));
}
}
Modified: trunk/storage/libstorage/src/Disk.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.cc?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Disk.cc (original)
+++ trunk/storage/libstorage/src/Disk.cc Sat Apr 18 14:19:45 2009
@@ -1810,7 +1810,7 @@
Container::getCommitActions( l );
if( deleted() )
{
- l.remove_if(stage_equal_to(DECREASE));
+ l.remove_if(stage_is(DECREASE));
l.push_front(commitAction(DECREASE, staticType(), setDiskLabelText(false), this, true));
}
}
Modified: trunk/storage/libstorage/src/DmCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/DmCo.cc?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/DmCo.cc (original)
+++ trunk/storage/libstorage/src/DmCo.cc Sat Apr 18 14:19:45 2009
@@ -354,7 +354,7 @@
}
-inline std::ostream& operator<< (std::ostream& s, const DmCo& d )
+ std::ostream& operator<<(std::ostream& s, const DmCo& d)
{
s << *((Container*)&d);
return( s );
Modified: trunk/storage/libstorage/src/DmPartCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/DmPartCo.cc?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/DmPartCo.cc (original)
+++ trunk/storage/libstorage/src/DmPartCo.cc Sat Apr 18 14:19:45 2009
@@ -725,7 +725,7 @@
y2mil( "l:" << l );
if( deleted() || del_ptable )
{
- l.remove_if(stage_equal_to(DECREASE));
+ l.remove_if(stage_is(DECREASE));
string txt = deleted() ? removeText(false) : setDiskLabelText(false);
l.push_front(commitAction(DECREASE, staticType(), txt, this, true));
}
Modified: trunk/storage/libstorage/src/EtcFstab.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/EtcFstab.cc?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/EtcFstab.cc (original)
+++ trunk/storage/libstorage/src/EtcFstab.cc Sat Apr 18 14:19:45 2009
@@ -872,6 +872,52 @@
}
+ std::ostream& operator<<(std::ostream& s, const FstabEntry& v)
+ {
+ s << "device:" << v.device
+ << " dentry:" << v.dentry << " mount:" << v.mount
+ << " fs:" << v.fs << " opts:" << boost::join(v.opts, ",")
+ << " freq:" << v.freq << " passno:" << v.passno;
+ if( v.noauto )
+ s << " noauto";
+ if( v.crypto )
+ s << " crypto";
+ if( v.cryptt )
+ s << " cryptt";
+ if( v.tmpcrypt )
+ s << " tmpcrypt";
+ if( v.loop )
+ s << " loop";
+ if( v.dmcrypt )
+ s << " dmcrypt";
+ if( !v.loop_dev.empty() )
+ s << " loop_dev:" << v.loop_dev;
+ if( !v.cr_key.empty() )
+ s << " cr_key:" << v.cr_key;
+ if( !v.cr_opts.empty() )
+ s << " cr_opts:" << v.cr_opts;
+ if( v.encr != storage::ENC_NONE )
+ s << " encr:" << v.encr;
+ return s;
+ }
+
+
+ std::ostream& operator<<(std::ostream& s, const FstabChange& v)
+ {
+ s << "device:" << v.device
+ << " dentry:" << v.dentry << " mount:" << v.mount
+ << " fs:" << v.fs << " opts:" << boost::join(v.opts, ",")
+ << " freq:" << v.freq << " passno:" << v.passno;
+ if( !v.loop_dev.empty() )
+ s << " loop_dev:" << v.loop_dev;
+ if( v.encr != storage::ENC_NONE )
+ s << " encr:" << v.encr;
+ if( v.tmpcrypt )
+ s << " tmpcrypt";
+ return s;
+ }
+
+
unsigned EtcFstab::fstabFields[] = { 20, 20, 10, 21, 1, 1 };
unsigned EtcFstab::cryptotabFields[] = { 11, 15, 20, 10, 10, 1 };
unsigned EtcFstab::crypttabFields[] = { 15, 20, 10, 1 };
Modified: trunk/storage/libstorage/src/EtcFstab.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/EtcFstab.h?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/EtcFstab.h (original)
+++ trunk/storage/libstorage/src/EtcFstab.h Sat Apr 18 14:19:45 2009
@@ -44,34 +44,6 @@
void calcDependent();
};
-inline std::ostream& operator<< (std::ostream& s, const FstabEntry &v )
- {
- s << "device:" << v.device
- << " dentry:" << v.dentry << " mount:" << v.mount
- << " fs:" << v.fs << " opts:" << boost::join( v.opts, "," )
- << " freq:" << v.freq << " passno:" << v.passno;
- if( v.noauto )
- s << " noauto";
- if( v.crypto )
- s << " crypto";
- if( v.cryptt )
- s << " cryptt";
- if( v.tmpcrypt )
- s << " tmpcrypt";
- if( v.loop )
- s << " loop";
- if( v.dmcrypt )
- s << " dmcrypt";
- if( !v.loop_dev.empty() )
- s << " loop_dev:" << v.loop_dev;
- if( !v.cr_key.empty() )
- s << " cr_key:" << v.cr_key;
- if( !v.cr_opts.empty() )
- s << " cr_opts:" << v.cr_opts;
- if( v.encr != storage::ENC_NONE )
- s << " encr:" << v.encr;
- return( s );
- }
struct FstabChange
{
@@ -110,20 +82,6 @@
return( *this );
}
-inline std::ostream& operator<< (std::ostream& s, const FstabChange &v )
- {
- s << "device:" << v.device
- << " dentry:" << v.dentry << " mount:" << v.mount
- << " fs:" << v.fs << " opts:" << boost::join( v.opts, "," )
- << " freq:" << v.freq << " passno:" << v.passno;
- if( !v.loop_dev.empty() )
- s << " loop_dev:" << v.loop_dev;
- if( v.encr != storage::ENC_NONE )
- s << " encr:" << v.encr;
- if( v.tmpcrypt )
- s << " tmpcrypt";
- return( s );
- }
class EtcFstab
{
Modified: trunk/storage/libstorage/src/EtcRaidtab.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/EtcRaidtab.cc?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/EtcRaidtab.cc (original)
+++ trunk/storage/libstorage/src/EtcRaidtab.cc Sat Apr 18 14:19:45 2009
@@ -3,8 +3,6 @@
Textdomain "storage"
*/
-#include <sstream>
-
#include "y2storage/AppUtil.h"
#include "y2storage/Regex.h"
#include "y2storage/EtcRaidtab.h"
Modified: trunk/storage/libstorage/src/EtcRaidtab.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/EtcRaidtab.h?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/EtcRaidtab.h (original)
+++ trunk/storage/libstorage/src/EtcRaidtab.h Sat Apr 18 14:19:45 2009
@@ -21,13 +21,11 @@
protected:
struct entry
{
- entry() { first=last=0; }
- entry( unsigned f, unsigned l ) { first=f; last=l; }
+ entry() : first(0), last(0) {}
+ entry(unsigned f, unsigned l) : first(f), last(l) {}
unsigned first;
unsigned last;
- friend std::ostream& operator<< (std::ostream& s, const entry &v );
};
- friend std::ostream& operator<< (std::ostream& s, const entry &v );
void updateMdadmFile();
void buildMdadmMap();
@@ -37,13 +35,6 @@
AsciiFile mdadm;
};
-
-inline std::ostream& operator<< (std::ostream& s, const EtcRaidtab::entry& v )
- {
- s << "first=" << v.first << " last=" << v.last;
- return( s );
- }
-
}
#endif
Modified: trunk/storage/libstorage/src/LoopCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/LoopCo.cc?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/LoopCo.cc (original)
+++ trunk/storage/libstorage/src/LoopCo.cc Sat Apr 18 14:19:45 2009
@@ -346,7 +346,7 @@
}
-inline std::ostream& operator<< (std::ostream& s, const LoopCo& d )
+ std::ostream& operator<<(std::ostream& s, const LoopCo& d)
{
s << *((Container*)&d);
return( s );
Modified: trunk/storage/libstorage/src/NfsCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/NfsCo.cc?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/NfsCo.cc (original)
+++ trunk/storage/libstorage/src/NfsCo.cc Sat Apr 18 14:19:45 2009
@@ -207,7 +207,7 @@
}
-inline std::ostream& operator<< (std::ostream& s, const NfsCo& d )
+ std::ostream& operator<<(std::ostream& s, const NfsCo& d)
{
s << *((Container*)&d);
return( s );
Modified: trunk/storage/libstorage/src/Region.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Region.h?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Region.h (original)
+++ trunk/storage/libstorage/src/Region.h Sat Apr 18 14:19:45 2009
@@ -41,23 +41,25 @@
unsigned long start() const { return( s ); }
unsigned long end() const { return( s+l-1 ); }
unsigned long len() const { return( l ); }
+
+ friend std::ostream& operator<<(std::ostream& s, const Region& p);
+ friend std::istream& operator>>(std::istream& s, Region& p);
+
protected:
unsigned long s;
unsigned long l;
};
-inline std::ostream& operator<< (std::ostream& s, const Region &p )
+
+ inline std::ostream& operator<<(std::ostream& s, const Region& p)
{
- s << "[" << p.start() << "," << p.len() << "]";
- return( s );
+ return s << "[" << p.s << "," << p.l << "]";
}
-inline std::istream& operator>> (std::istream& s, Region &p )
+
+ inline std::istream& operator>>(std::istream& s, Region& p)
{
- unsigned long start, len;
- s >> start >> len;
- p = Region( start, len );
- return( s );
+ return s >> p.s >> p.l;
}
}
Modified: trunk/storage/libstorage/src/Storage.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.h?rev=56839&r1=56838&r2=56839&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Storage.h (original)
+++ trunk/storage/libstorage/src/Storage.h Sat Apr 18 14:19:45 2009
@@ -33,7 +33,7 @@
namespace storage
{
-template <int Value>
+template <CType Value>
class CheckType
{
public:
@@ -43,7 +43,7 @@
}
};
-template< class Iter, int Value, class CastResult >
+template< class Iter, CType Value, class CastResult >
class CastCheckIterator : public CheckType<Value>,
public FilterIterator< CheckType<Value>, Iter >
{
@@ -1749,21 +1749,6 @@
std::list