Enabled type checking (const instead of #define)

svn path=/trunk/; revision=1080
This commit is contained in:
Curtis Gedak 2009-02-27 17:33:20 +00:00
parent 14363d96f4
commit f259327c82
2 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2009-02-27 Curtis Gedak <gedakc@gmail.com>
* src/GParted_Core.cc: Enabled type checking (const instead of #define)
2009-02-25 Curtis Gedak <gedakc@gmail.com>
* src/GParted_Core.cc: Added recognition of /dev/mmcblk* SD/MMC devices.

View File

@ -848,9 +848,9 @@ GParted::FILESYSTEM GParted_Core::get_filesystem()
}
//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 @@ GParted::FILESYSTEM GParted_Core::get_filesystem()
(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" ;