[parted-devel] Minor change: remove type-cast from ped_disk_type_register
Otavio Salvador
otavio at debian.org
Fri Nov 2 12:25:03 UTC 2007
"Debarshi 'Rishi' Ray" <debarshi.ray at gmail.com> writes:
>> Were the type-casts necessary?
>
> diff --git a/libparted/disk.c b/libparted/disk.c
> index e2e55c3..d8a85f4 100644
> --- a/libparted/disk.c
> +++ b/libparted/disk.c
> @@ -68,9 +68,8 @@ ped_disk_type_register (PedDiskType* dis
> PED_ASSERT (disk_type->ops != NULL, return);
> PED_ASSERT (disk_type->name != NULL, return);
>
> - /* pretend that "next" isn't part of the struct :-) */
> - ((struct _PedDiskType*) disk_type)->next = disk_types;
> - disk_types = (struct _PedDiskType*) disk_type;
> + disk_type->next = disk_types;
> + disk_types = disk_type;
> }
>
> void
> diff --git a/libparted/filesys.c b/libparted/filesys.c
> index 986f0ca..38d1f75 100644
> --- a/libparted/filesys.c
> +++ b/libparted/filesys.c
> @@ -49,9 +49,8 @@ ped_file_system_type_register (PedFileSy
> PED_ASSERT (fs_type->ops != NULL, return);
> PED_ASSERT (fs_type->name != NULL, return);
>
> - /* pretend that "next" isn't part of the struct :-) */
> - ((struct _PedFileSystemType*) fs_type)->next = fs_types;
> - fs_types = (struct _PedFileSystemType*) fs_type;
> + fs_type->next = fs_types;
> + fs_types = fs_type;
> }
>
> void
>
> Comments?
Commit it, just check the indenting since it looks wrong.
--
O T A V I O S A L V A D O R
---------------------------------------------
E-mail: otavio at debian.org UIN: 5906116
GNU/Linux User: 239058 GPG ID: 49A5F855
Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
you the whole house."
More information about the parted-devel
mailing list