[gparted] Pass unmodified parameter to useable_device() as const (!46)



commit 7289d4c52a156749e1df41abf82bed8bf27f0bfe
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Wed Jul 10 11:00:32 2019 +0100

    Pass unmodified parameter to useable_device() as const (!46)
    
    GParted_Core::useable_device() doesn't change the pointed to PedDevice
    structure.  Pass it as const so the compiler enforces this.
    
    Closes !46 - Whole device FAT32 file system reports device busy warning
                 from mlabel

 include/GParted_Core.h | 2 +-
 src/GParted_Core.cc    | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/include/GParted_Core.h b/include/GParted_Core.h
index a46cd40c..736e315a 100644
--- a/include/GParted_Core.h
+++ b/include/GParted_Core.h
@@ -229,7 +229,7 @@ private:
        static bool commit( PedDisk* lp_disk );
        static bool commit_to_os( PedDisk* lp_disk, std::time_t timeout );
        static void settle_device( std::time_t timeout );
-       static bool useable_device( PedDevice * lp_device );
+       static bool useable_device(const PedDevice* lp_device);
        static PedPartition* get_lp_partition( const PedDisk* lp_disk, const Partition & partition );
 
        static PedExceptionOption ped_exception_handler( PedException * e ) ;
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 44739c57..5c0d223a 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -4041,7 +4041,8 @@ void GParted_Core::capture_libparted_messages( OperationDetail & operationdetail
        }
 }
 
-bool GParted_Core::useable_device( PedDevice * lp_device )
+
+bool GParted_Core::useable_device(const PedDevice* lp_device)
 {
        g_assert( lp_device != NULL );  // Bug: Not initialised by call to ped_device_get() or 
ped_device_get_next()
 


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