[gparted] Remove unused error reporting from snap_to_*() (#48)



commit 14aa9276d49a01b23c7b7667da86970af44382bd
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Thu May 9 08:03:16 2019 +0100

    Remove unused error reporting from snap_to_*() (#48)
    
    None of the snap_to_*() methods report any errors so remove the unused
    error parameter and return value.
    
    Closes #48 - Error when moving locked LUKS-encrypted partition

 include/GParted_Core.h |  8 ++++----
 src/GParted_Core.cc    | 25 ++++++++++---------------
 2 files changed, 14 insertions(+), 19 deletions(-)
---
diff --git a/include/GParted_Core.h b/include/GParted_Core.h
index ba445d17..8714e7db 100644
--- a/include/GParted_Core.h
+++ b/include/GParted_Core.h
@@ -50,10 +50,10 @@ public:
        void set_devices( std::vector<Device> & devices ) ;
        void set_devices_thread( std::vector<Device> * pdevices );
        void guess_partition_table(const Device & device, Glib::ustring &buff);
-       
-       bool snap_to_cylinder( const Device & device, Partition & partition, Glib::ustring & error ) ;
-       bool snap_to_mebibyte( const Device & device, Partition & partition, Glib::ustring & error ) ;
-       bool snap_to_alignment( const Device & device, Partition & partition, Glib::ustring & error ) ;
+
+       void snap_to_cylinder(const Device& device, Partition& partition);
+       void snap_to_mebibyte(const Device& device, Partition& partition);
+       void snap_to_alignment(const Device& device, Partition& partition);
        bool valid_partition(const Device& device, Partition& partition, Glib::ustring& error);
        bool apply_operation_to_disk( Operation * operation );
 
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 110c7fbd..970c13a9 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -328,7 +328,8 @@ Glib::ustring GParted_Core::get_thread_status_message( )
        return thread_status_message ;
 }
 
-bool GParted_Core::snap_to_cylinder( const Device & device, Partition & partition, Glib::ustring & error ) 
+
+void GParted_Core::snap_to_cylinder(const Device& device, Partition& partition) 
 {
        Sector diff = 0;
 
@@ -374,11 +375,10 @@ bool GParted_Core::snap_to_cylinder( const Device & device, Partition & partitio
                else
                        partition .sector_end += (device .cylsize - diff ) ;
        }
-
-       return true ;
 }
 
-bool GParted_Core::snap_to_mebibyte( const Device & device, Partition & partition, Glib::ustring & error ) 
+
+void GParted_Core::snap_to_mebibyte(const Device& device, Partition& partition) 
 {
        Sector diff = 0;
        if ( partition .sector_start < 2 || partition .type == TYPE_LOGICAL )
@@ -532,26 +532,21 @@ bool GParted_Core::snap_to_mebibyte( const Device & device, Partition & partitio
        {
                partition .sector_end -= ( MEBIBYTE / partition .sector_size ) ;
        }
-
-       return true ;
 }
 
-bool GParted_Core::snap_to_alignment( const Device & device, Partition & partition, Glib::ustring & error )
-{
-       bool rc = true ;
 
+void GParted_Core::snap_to_alignment(const Device& device, Partition& partition)
+{
        if ( partition .alignment == ALIGN_CYLINDER )
-               rc = snap_to_cylinder( device, partition, error ) ;
+               snap_to_cylinder(device, partition);
        else if ( partition .alignment == ALIGN_MEBIBYTE )
-               rc = snap_to_mebibyte( device, partition, error ) ;
-
-       return rc;
+               snap_to_mebibyte(device, partition);
 }
 
 
 bool GParted_Core::valid_partition(const Device& device, Partition& partition, Glib::ustring& error)
 {
-       bool rc = snap_to_alignment(device, partition, error);
+       snap_to_alignment(device, partition);
 
        //Ensure that partition start and end are not beyond the ends of the disk device
        if ( partition .sector_start < 0 )
@@ -588,7 +583,7 @@ bool GParted_Core::valid_partition(const Device& device, Partition& partition, G
        //however, finding the adjacent partitions is not as easy as it seems and at this moment all the 
dialogs
        //already perform these checks. A perfect 'fixme-later' ;)
 
-       return rc ;
+       return true;
 }
 
 bool GParted_Core::apply_operation_to_disk( Operation * operation )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]