[parted-devel] [PATCH] Change two "extern inline" functions to "static inline".

Jim Meyering jim at meyering.net
Mon Jan 14 19:10:17 UTC 2008


Yet another change required to adapt to the newer gcc:

	Change two "extern inline" functions to "static inline".

	* include/parted/natmath.h (ped_div_round_up): This makes
	it compilable with bleeding-edge gcc.
	(ped_div_round_to_nearest): Likewise.
	* libparted/cs/natmath.c (ped_div_round_up, ped_div_round_to_nearest):
	Remove definitions.

Signed-off-by: Jim Meyering <meyering at redhat.com>
---
 include/parted/natmath.h |   18 ++++++++++++------
 libparted/cs/natmath.c   |   14 +-------------
 2 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/include/parted/natmath.h b/include/parted/natmath.h
index e387833..596d98a 100644
--- a/include/parted/natmath.h
+++ b/include/parted/natmath.h
@@ -1,6 +1,6 @@
 /*
     libparted - a library for manipulating disk partitions
-    Copyright (C) 2000, 2007 Free Software Foundation, Inc.
+    Copyright (C) 2000, 2007, 2008 Free Software Foundation, Inc.

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -87,15 +87,21 @@ ped_alignment_is_aligned (const PedAlignment* align, const PedGeometry* geom,
 extern const PedAlignment* ped_alignment_any;
 extern const PedAlignment* ped_alignment_none;

-extern inline PedSector
-ped_div_round_up (PedSector numerator, PedSector divisor);
+static inline PedSector
+ped_div_round_up (PedSector numerator, PedSector divisor)
+{
+	return (numerator + divisor - 1) / divisor;
+}

-extern inline PedSector
-ped_div_round_to_nearest (PedSector numerator, PedSector divisor);
+
+static inline PedSector
+ped_div_round_to_nearest (PedSector numerator, PedSector divisor)
+{
+	return (numerator + divisor/2) / divisor;
+}

 #endif /* PED_NATMATH_H_INCLUDED */

 /**
  * @}
  */
-
diff --git a/libparted/cs/natmath.c b/libparted/cs/natmath.c
index fd376cd..3821593 100644
--- a/libparted/cs/natmath.c
+++ b/libparted/cs/natmath.c
@@ -1,6 +1,6 @@
 /*
     libparted - a library for manipulating disk partitions
-    Copyright (C) 2000, 2007 Free Software Foundation, Inc.
+    Copyright (C) 2000, 2007, 2008 Free Software Foundation, Inc.

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -74,18 +74,6 @@ ped_round_down_to (PedSector sector, PedSector grain_size)
 	return sector - abs_mod (sector, grain_size);
 }

-PedSector
-ped_div_round_up (PedSector numerator, PedSector divisor)
-{
-	return (numerator + divisor - 1) / divisor;
-}
-
-PedSector
-ped_div_round_to_nearest (PedSector numerator, PedSector divisor)
-{
-	return (numerator + divisor/2) / divisor;
-}
-
 /* Rounds a number up to the closest number that is a multiple of
  * grain_size.
  */
--
1.5.4.rc3.5.gac41



More information about the parted-devel mailing list