[PATCH 1/8] ped_disk_type_get_next: fix a const-correctness bug

Jim Meyering meyering at redhat.com
Fri Nov 13 08:44:30 UTC 2009


* libparted/disk.c (ped_disk_type_get_next): Make param const.
* include/parted/disk.h (ped_disk_type_get_next): Update prototype.
---
 include/parted/disk.h |    3 +--
 libparted/disk.c      |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/parted/disk.h b/include/parted/disk.h
index 76397a8..434f0d3 100644
--- a/include/parted/disk.h
+++ b/include/parted/disk.h
@@ -239,7 +239,7 @@ struct _PedDiskArchOps {
 extern void ped_disk_type_register (PedDiskType* type);
 extern void ped_disk_type_unregister (PedDiskType* type);

-extern PedDiskType* ped_disk_type_get_next (PedDiskType* type);
+extern PedDiskType* ped_disk_type_get_next (PedDiskType const *type);
 extern PedDiskType* ped_disk_type_get (const char* name);
 extern int ped_disk_type_check_feature (const PedDiskType* disk_type,
                                         PedDiskTypeFeature feature);
@@ -354,4 +354,3 @@ extern int _ped_partition_attempt_align (
 #endif /* PED_DISK_H_INCLUDED */

 /** @} */
-
diff --git a/libparted/disk.c b/libparted/disk.c
index f29140e..8c4b229 100644
--- a/libparted/disk.c
+++ b/libparted/disk.c
@@ -101,7 +101,7 @@ ped_disk_type_unregister (PedDiskType* disk_type)
  * \return Next disk; NULL if "type" is the last registered disk type.
  */
 PedDiskType*
-ped_disk_type_get_next (PedDiskType* type)
+ped_disk_type_get_next (PedDiskType const *type)
 {
 	if (type)
 		return type->next;
--
1.6.5.2.372.gc0502




More information about the parted-devel mailing list