gparted r1080 - in trunk: . src



Author: gedakc
Date: Fri Feb 27 17:33:20 2009
New Revision: 1080
URL: http://svn.gnome.org/viewvc/gparted?rev=1080&view=rev

Log:
Enabled type checking (const instead of #define)

Modified:
   trunk/ChangeLog
   trunk/src/GParted_Core.cc

Modified: trunk/src/GParted_Core.cc
==============================================================================
--- trunk/src/GParted_Core.cc	(original)
+++ trunk/src/GParted_Core.cc	Fri Feb 27 17:33:20 2009
@@ -848,9 +848,9 @@
 	}
 
 	//btrfs
-	#define BTRFS_SUPER_INFO_SIZE 4096
-	#define BTRFS_SUPER_INFO_OFFSET (64 * 1024)	
-	#define BTRFS_SIGNATURE "_BHRfS_M"
+	const Sector BTRFS_SUPER_INFO_SIZE   = 4096 ;
+	const Sector BTRFS_SUPER_INFO_OFFSET = (64 * 1024) ;
+	const Glib::ustring BTRFS_SIGNATURE  = "_BHRfS_M" ;
 
 	char    buf_btrfs[BTRFS_SUPER_INFO_SIZE] ;
 
@@ -859,10 +859,10 @@
 	                   (BTRFS_SUPER_INFO_OFFSET / 512), \
 	                   (BTRFS_SUPER_INFO_SIZE / 512)
 	                 ) ;
-	strncpy(magic, buf_btrfs+64, strlen(BTRFS_SIGNATURE)) ;  magic[strlen(BTRFS_SIGNATURE)] = '\0' ; //set and terminate string
+	strncpy(magic, buf_btrfs+64, BTRFS_SIGNATURE .size()) ;  magic[BTRFS_SIGNATURE .size()] = '\0' ; //set and terminate string
 	ped_device_close( lp_device ) ;
 
-	if ( magic == Glib::ustring(BTRFS_SIGNATURE) )
+	if ( magic == BTRFS_SIGNATURE )
 	{
 		temp = _( "BTRFS is not yet supported." ) ;
 		temp += "\n" ;



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