[gparted] Make btrfs_size_*() static member functions
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Make btrfs_size_*() static member functions
- Date: Sun, 8 Jul 2012 18:13:47 +0000 (UTC)
commit a6ff181fafafcb34612f44191880829ab57a7bf5
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date: Sat Jul 7 12:23:01 2012 +0100
Make btrfs_size_*() static member functions
The member functions btrfs_size_to_num(), btrfs_size_max_delta() and
btrfs_size_to_gdouble() don't access any member variables. Therefore
they don't need the const qualifier allowing them to be called when the
btrfs object is const for read-only access to member variables, but
instead need to be static member functions with no access to member
variables.
include/btrfs.h | 6 +++---
src/btrfs.cc | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/include/btrfs.h b/include/btrfs.h
index 16d9dde..807d522 100644
--- a/include/btrfs.h
+++ b/include/btrfs.h
@@ -45,9 +45,9 @@ public:
bool check_repair( const Partition & partition, OperationDetail & operationdetail ) ;
private:
- Byte_Value btrfs_size_to_num( Glib::ustring str, Byte_Value ptn_bytes, bool scale_up ) const ;
- gdouble btrfs_size_max_delta( Glib::ustring str ) const ;
- gdouble btrfs_size_to_gdouble( Glib::ustring str ) const ;
+ static Byte_Value btrfs_size_to_num( Glib::ustring str, Byte_Value ptn_bytes, bool scale_up ) ;
+ static gdouble btrfs_size_max_delta( Glib::ustring str ) ;
+ static gdouble btrfs_size_to_gdouble( Glib::ustring str ) ;
};
} //GParted
diff --git a/src/btrfs.cc b/src/btrfs.cc
index a131586..2062be8 100644
--- a/src/btrfs.cc
+++ b/src/btrfs.cc
@@ -311,7 +311,7 @@ void btrfs::read_uuid( Partition & partition )
//Return the value of a btrfs tool formatted size, including reversing
// changes in certain cases caused by using binary prefix multipliers
// and rounding to two decimal places of precision. E.g. "2.00GB".
-Byte_Value btrfs::btrfs_size_to_num( Glib::ustring str, Byte_Value ptn_bytes, bool scale_up ) const
+Byte_Value btrfs::btrfs_size_to_num( Glib::ustring str, Byte_Value ptn_bytes, bool scale_up )
{
Byte_Value size_bytes = Utils::round( btrfs_size_to_gdouble( str ) ) ;
gdouble delta = btrfs_size_max_delta( str ) ;
@@ -355,7 +355,7 @@ Byte_Value btrfs::btrfs_size_to_num( Glib::ustring str, Byte_Value ptn_bytes, bo
//Return maximum delta for which num +/- delta would be rounded by btrfs
// tools to str. E.g. btrfs_size_max_delta("2.00GB") -> 5368709.12
-gdouble btrfs::btrfs_size_max_delta( Glib::ustring str ) const
+gdouble btrfs::btrfs_size_max_delta( Glib::ustring str )
{
Glib::ustring limit_str ;
//Create limit_str. E.g. str = "2.00GB" -> limit_str = "0.005GB"
@@ -378,7 +378,7 @@ gdouble btrfs::btrfs_size_max_delta( Glib::ustring str ) const
//Return the value of a btrfs tool formatted size.
// E.g. btrfs_size_to_gdouble("2.00GB") -> 2147483648.0
-gdouble btrfs::btrfs_size_to_gdouble( Glib::ustring str ) const
+gdouble btrfs::btrfs_size_to_gdouble( Glib::ustring str )
{
gchar * suffix ;
gdouble rawN = g_ascii_strtod( str .c_str(), & suffix ) ;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]