From: Jim Meyering Date: Mon, 14 Jan 2008 17:48:38 +0000 (+0100) Subject: Change two "extern inline" functions to "static inline". X-Git-Tag: android-x86-4.4-r1~937 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d1d48d3af403ae623b0aee2d2068f980c86105fd;p=android-x86%2Fexternal-parted.git 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 --- 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. */