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:
parent
815b5f61a3
commit
8d2e7dd26d
|
@ -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>
|
||||
|
||||
* configure.in: gparted-0.3.3
|
||||
|
|
|
@ -41,9 +41,9 @@ public:
|
|||
void Reset() ;
|
||||
std::vector<Partition> partitions ;
|
||||
Sector length;
|
||||
long heads ;
|
||||
long sectors ;
|
||||
long cylinders ;
|
||||
Sector heads ;
|
||||
Sector sectors ;
|
||||
Sector cylinders ;
|
||||
Sector cylsize ;
|
||||
Glib::ustring model;
|
||||
Glib::ustring disktype;
|
||||
|
|
|
@ -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 ;
|
||||
|
||||
|
|
|
@ -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 ) ;
|
||||
|
|
|
@ -180,7 +180,7 @@ void GParted_Core::set_devices( std::vector<Device> & 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 ;
|
||||
|
|
Loading…
Reference in New Issue