Corrected math in partition creation/resize dialogs that prevented operations on partition sizes >= 1 TB
svn path=/trunk/; revision=828
This commit is contained in:
parent
6757e4c277
commit
16afc3bb75
|
@ -1,5 +1,12 @@
|
|||
2008-04-21 Curtis Gedak <gedakc@gmail.com>
|
||||
|
||||
* src/Dialog_Base_Partition.cc,
|
||||
src/Dialog_Partition_New.cc: Fixed 1 TB partition limit bug
|
||||
- Fixed problem with spinbutton math that limited partition size
|
||||
to a maximum just less than 1 TB.
|
||||
New limit is just less than 1024 TB.
|
||||
- Closes GParted bug #524948
|
||||
|
||||
* Makefile.am: Enhanced for new calling script gparted
|
||||
- Added gparted script installation in sbin
|
||||
- Added installdir parsing for gparted and gparted.desktop
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004 Bart
|
||||
/* Copyright (C) 2004, 2005, 2006, 2007, 2008 Bart Hakvoort
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -118,12 +118,14 @@ void Dialog_Base_Partition::Set_Resizer( bool extended )
|
|||
|
||||
Partition Dialog_Base_Partition::Get_New_Partition()
|
||||
{
|
||||
//FIXME: Partition size is limited is just less than 1024 TeraBytes due
|
||||
// to the maximum value of signed 4 byte integer.
|
||||
if ( ORIG_BEFORE != spinbutton_before .get_value_as_int() )
|
||||
selected_partition .sector_start = START + spinbutton_before .get_value_as_int() * MEBIBYTE ;
|
||||
selected_partition .sector_start = START + Sector(spinbutton_before .get_value_as_int()) * MEBIBYTE ;
|
||||
|
||||
if ( ORIG_AFTER != spinbutton_after .get_value_as_int() )
|
||||
selected_partition .sector_end =
|
||||
selected_partition .sector_start + spinbutton_size .get_value_as_int() * MEBIBYTE ;
|
||||
selected_partition .sector_start + Sector(spinbutton_size .get_value_as_int()) * MEBIBYTE ;
|
||||
|
||||
//due to loss of precision during calcs from Sector -> MiB and back, it is possible
|
||||
//the new partition thinks it's bigger then it can be. Here we solve this.
|
||||
|
|
|
@ -157,8 +157,10 @@ Partition Dialog_Partition_New::Get_New_Partition()
|
|||
default : part_type = GParted::TYPE_UNALLOCATED ;
|
||||
}
|
||||
|
||||
new_start = START + (spinbutton_before .get_value_as_int() * MEBIBYTE) ;
|
||||
new_end = new_start + (spinbutton_size .get_value_as_int() * MEBIBYTE) ;
|
||||
//FIXME: Partition size is limited is just less than 1024 TeraBytes due
|
||||
// to the maximum value of signed 4 byte integer.
|
||||
new_start = START + (Sector(spinbutton_before .get_value_as_int()) * MEBIBYTE) ;
|
||||
new_end = new_start + (Sector(spinbutton_size .get_value_as_int()) * MEBIBYTE) ;
|
||||
|
||||
/* due to loss of precision during calcs from Sector -> MiB and back, it is possible the new
|
||||
* partition thinks it's bigger then it can be. Here we try to solve this.*/
|
||||
|
|
Loading…
Reference in New Issue