OSDN Git Service

Change two "extern inline" functions to "static inline".
authorJim Meyering <meyering@redhat.com>
Mon, 14 Jan 2008 17:48:38 +0000 (18:48 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 14 Jan 2008 18:05:46 +0000 (19:05 +0100)
* 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@redhat.com>
include/parted/natmath.h
libparted/cs/natmath.c

index e387833..596d98a 100644 (file)
@@ -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 */
 
 /**
  * @}
  */
-
index fd376cd..3821593 100644 (file)
@@ -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.
  */