Initialise all struct FS members

The struct FS constructor initialised every member *except* filesystem
and busy.  Then in *most* cases after declaring struct FS, assignments
followed like this:
    FS fs;
    fs.filesystem = FS_BTRFS;
    fs.busy       = FS::GPARTED;
But member busy wasn't always initialised.

Add initialisation of members filesystem and busy to the struct FS
constructor.  Specify optional parameter to the constructor to set the
filesystem member, or when left off filesystem is initialised to
FS_UNKNOWN.
This commit is contained in:
Mike Fleetwood 2015-11-13 21:46:57 +00:00 committed by Curtis Gedak
parent 49664f3ca3
commit 1a4cefb960
18 changed files with 21 additions and 40 deletions

View File

@ -151,10 +151,10 @@ struct FS
Byte_Value MIN ;
Byte_Value MAX ;
FS()
FS( FILESYSTEM fstype = FS_UNKNOWN ) : filesystem( fstype )
{
read = read_label = write_label = read_uuid = write_uuid = create = create_with_label =
grow = shrink = move = check = copy = remove = online_read =
busy = read = read_label = write_label = read_uuid = write_uuid = create =
create_with_label = grow = shrink = move = check = copy = remove = online_read =
online_grow = online_shrink = NONE ;
MIN = MAX = 0 ;
}

View File

@ -120,12 +120,11 @@ void GParted_Core::find_supported_filesystems()
// systems in menus and dialogs.
FILESYSTEMS .clear() ;
FS fs_notsupp;
for ( f = FILESYSTEM_MAP .begin() ; f != FILESYSTEM_MAP .end() ; f++ ) {
if ( f ->second )
FILESYSTEMS .push_back( f ->second ->get_filesystem_support() ) ;
else {
fs_notsupp .filesystem = f ->first ;
FS fs_notsupp( f->first );
FILESYSTEMS .push_back( fs_notsupp ) ;
}
}
@ -942,8 +941,7 @@ const FS & GParted_Core::get_fs( GParted::FILESYSTEM filesystem ) const
return FILESYSTEMS[ t ] ;
}
static FS fs_notsupp;
fs_notsupp.filesystem = FS_UNKNOWN;
static FS fs_notsupp( FS_UNKNOWN );
return fs_notsupp;
}

View File

@ -39,8 +39,7 @@ std::map<Glib::ustring, BTRFS_Device> btrfs_device_cache ;
FS btrfs::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_BTRFS ;
FS fs( FS_BTRFS );
fs .busy = FS::EXTERNAL ;

View File

@ -22,8 +22,7 @@ namespace GParted
FS exfat::get_filesystem_support()
{
FS fs ;
fs .filesystem = FS_EXFAT ;
FS fs( FS_EXFAT );
fs .busy = FS::GPARTED ;
fs .copy = FS::GPARTED ;

View File

@ -23,8 +23,7 @@ namespace GParted
FS ext2::get_filesystem_support()
{
FS fs ;
fs .filesystem = specific_type;
FS fs( specific_type );
fs .busy = FS::GPARTED ;

View File

@ -23,9 +23,7 @@ namespace GParted
FS f2fs::get_filesystem_support()
{
FS fs ;
fs .filesystem = FS_F2FS ;
FS fs( FS_F2FS );
fs .busy = FS::GPARTED ;

View File

@ -60,8 +60,7 @@ const Glib::ustring fat16::get_custom_text( CUSTOM_TEXT ttype, int index ) const
FS fat16::get_filesystem_support()
{
FS fs ;
fs .filesystem = specific_type ;
FS fs( specific_type );
// hack to disable silly mtools warnings
setenv( "MTOOLS_SKIP_CHECK", "1", 0 );

View File

@ -24,8 +24,7 @@ namespace GParted
FS hfs::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_HFS ;
FS fs( FS_HFS );
fs .busy = FS::GPARTED ;

View File

@ -24,8 +24,7 @@ namespace GParted
FS hfsplus::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_HFSPLUS ;
FS fs( FS_HFSPLUS );
fs .busy = FS::GPARTED ;

View File

@ -24,8 +24,7 @@ namespace GParted
FS jfs::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_JFS ;
FS fs( FS_JFS );
fs .busy = FS::GPARTED ;

View File

@ -42,8 +42,7 @@ const Glib::ustring linux_swap::get_custom_text( CUSTOM_TEXT ttype, int index )
FS linux_swap::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_LINUX_SWAP ;
FS fs( FS_LINUX_SWAP );
fs .busy = FS::GPARTED ;
fs .read = FS::EXTERNAL ;

View File

@ -47,8 +47,7 @@ const Glib::ustring lvm2_pv::get_custom_text( CUSTOM_TEXT ttype, int index ) con
FS lvm2_pv::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_LVM2_PV ;
FS fs( FS_LVM2_PV );
if ( LVM2_PV_Info::is_lvm2_pv_supported() )
{

View File

@ -23,8 +23,7 @@ namespace GParted
FS nilfs2::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_NILFS2 ;
FS fs( FS_NILFS2 );
fs .busy = FS::GPARTED ;

View File

@ -57,8 +57,7 @@ const Glib::ustring ntfs::get_custom_text( CUSTOM_TEXT ttype, int index ) const
FS ntfs::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_NTFS ;
FS fs( FS_NTFS );
fs .busy = FS::GPARTED ;

View File

@ -24,8 +24,7 @@ namespace GParted
FS reiser4::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_REISER4 ;
FS fs( FS_REISER4 );
fs .busy = FS::GPARTED ;

View File

@ -24,8 +24,7 @@ namespace GParted
FS reiserfs::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_REISERFS ;
FS fs( FS_REISERFS );
fs .busy = FS::GPARTED ;

View File

@ -23,8 +23,7 @@ namespace GParted
FS ufs::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_UFS ;
FS fs( FS_UFS );
fs .busy = FS::GPARTED ;
fs .copy = GParted::FS::GPARTED ;

View File

@ -24,8 +24,7 @@ namespace GParted
FS xfs::get_filesystem_support()
{
FS fs ;
fs .filesystem = GParted::FS_XFS ;
FS fs( FS_XFS );
fs .busy = FS::GPARTED ;