replaced 'long' with 'Sector' to prefent overflows with really large

* include/Device.h,
  include/Dialog_Base_Partition.h,
  src/Dialog_Base_Partition.cc: replaced 'long' with 'Sector' to
  prefent overflows with really large devices.
This commit is contained in:
Bart Hakvoort 2006-12-08 13:14:05 +00:00
parent 815b5f61a3
commit 8d2e7dd26d
5 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2006-12-08 Bart Hakvoort <hakvoort@cvs.gnome.org>
* include/Device.h,
include/Dialog_Base_Partition.h,
src/Dialog_Base_Partition.cc: replaced 'long' with 'Sector' to
prefent overflows with really large devices.
2006-12-06 Bart Hakvoort <hakvoort@cvs.gnome.org> 2006-12-06 Bart Hakvoort <hakvoort@cvs.gnome.org>
* configure.in: gparted-0.3.3 * configure.in: gparted-0.3.3

View File

@ -41,9 +41,9 @@ public:
void Reset() ; void Reset() ;
std::vector<Partition> partitions ; std::vector<Partition> partitions ;
Sector length; Sector length;
long heads ; Sector heads ;
long sectors ; Sector sectors ;
long cylinders ; Sector cylinders ;
Sector cylsize ; Sector cylsize ;
Glib::ustring model; Glib::ustring model;
Glib::ustring disktype; Glib::ustring disktype;

View File

@ -56,10 +56,10 @@ protected:
}; };
void Set_Confirm_Button( CONFIRMBUTTON button_type ) ; void Set_Confirm_Button( CONFIRMBUTTON button_type ) ;
void Set_MinMax_Text( long min, long max ) ; void Set_MinMax_Text( Sector min, Sector max ) ;
double MB_PER_PIXEL ; double MB_PER_PIXEL ;
long TOTAL_MB ; Sector TOTAL_MB ;
Frame_Resizer_Base *frame_resizer_base; Frame_Resizer_Base *frame_resizer_base;
Partition selected_partition ; Partition selected_partition ;

View File

@ -171,7 +171,7 @@ void Dialog_Base_Partition::Set_Confirm_Button( CONFIRMBUTTON button_type )
} }
} }
void Dialog_Base_Partition::Set_MinMax_Text( long min, long max ) void Dialog_Base_Partition::Set_MinMax_Text( Sector min, Sector max )
{ {
str_temp = String::ucompose( _("Minimum Size: %1 MiB"), min ) + "\t\t" ; str_temp = String::ucompose( _("Minimum Size: %1 MiB"), min ) + "\t\t" ;
str_temp += String::ucompose( _("Maximum Size: %1 MiB"), max ) ; str_temp += String::ucompose( _("Maximum Size: %1 MiB"), max ) ;

View File

@ -180,7 +180,7 @@ void GParted_Core::set_devices( std::vector<Device> & devices )
temp_device .cylinders = lp_device ->bios_geom .cylinders ; temp_device .cylinders = lp_device ->bios_geom .cylinders ;
temp_device .length = temp_device .heads * temp_device .sectors * temp_device .cylinders ; temp_device .length = temp_device .heads * temp_device .sectors * temp_device .cylinders ;
temp_device .cylsize = temp_device .heads * temp_device .sectors ; temp_device .cylsize = temp_device .heads * temp_device .sectors ;
//make sure cylsize is at least 1 MiB //make sure cylsize is at least 1 MiB
if ( temp_device .cylsize < MEBIBYTE ) if ( temp_device .cylsize < MEBIBYTE )
temp_device .cylsize = MEBIBYTE ; temp_device .cylsize = MEBIBYTE ;