diff --git a/ChangeLog b/ChangeLog index 27bb5444..ac555118 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-12-08 Bart Hakvoort + + * 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 * configure.in: gparted-0.3.3 diff --git a/include/Device.h b/include/Device.h index e8f69c3f..434f096a 100644 --- a/include/Device.h +++ b/include/Device.h @@ -41,9 +41,9 @@ public: void Reset() ; std::vector partitions ; Sector length; - long heads ; - long sectors ; - long cylinders ; + Sector heads ; + Sector sectors ; + Sector cylinders ; Sector cylsize ; Glib::ustring model; Glib::ustring disktype; diff --git a/include/Dialog_Base_Partition.h b/include/Dialog_Base_Partition.h index d26f7a10..2b0eec8a 100644 --- a/include/Dialog_Base_Partition.h +++ b/include/Dialog_Base_Partition.h @@ -56,10 +56,10 @@ protected: }; 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 ; - long TOTAL_MB ; + Sector TOTAL_MB ; Frame_Resizer_Base *frame_resizer_base; Partition selected_partition ; diff --git a/src/Dialog_Base_Partition.cc b/src/Dialog_Base_Partition.cc index 0e2a24f5..67341ab5 100644 --- a/src/Dialog_Base_Partition.cc +++ b/src/Dialog_Base_Partition.cc @@ -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( _("Maximum Size: %1 MiB"), max ) ; diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 5d7de0b2..9bd24eb6 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -180,7 +180,7 @@ void GParted_Core::set_devices( std::vector & devices ) temp_device .cylinders = lp_device ->bios_geom .cylinders ; temp_device .length = temp_device .heads * temp_device .sectors * temp_device .cylinders ; temp_device .cylsize = temp_device .heads * temp_device .sectors ; - + //make sure cylsize is at least 1 MiB if ( temp_device .cylsize < MEBIBYTE ) temp_device .cylsize = MEBIBYTE ;