~ubuntu-branches/ubuntu/intrepid/parted/intrepid

« back to all changes in this revision

Viewing changes to libparted/cs/natmath.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-06-24 14:31:05 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080624143105-rd7yw67a9qnvh51i
Tags: 1.8.8.git.2008.03.24-7ubuntu1
* Resynchronise with Debian (LP: #237568). Remaining changes:
  - swap-uuid.dpatch: Create UUIDs on new swap partitions.
  - gptsync.dpatch: On Intel Mac systems, write a synced MBR rather than a
    protective MBR.
  - Add -fno-stack-protector on sparc.
  - sparc-new-label.dpatch: Fix sparc disk label generation. This is
    required for LDOM and parallel installations with Solaris 10.
  - loop-partitions.dpatch: Loop devices can only have one partition, so
    don't generate device names such as "/dev/loop0p1".
  - unpartitioned-disks.dpatch: Don't try to call BLKPG ioctls on
    unpartitionable disks (only implemented for loop devices at the
    moment), as they will always fail.
  - When building with gcc-4.3, add -Wno-array-bounds to CFLAGS.
  - Cell partition tables are misdetected as pc98, so disable pc98 support
    on powerpc.
  - array-bounds.dpatch: Backport patch from git to allow building with
    gcc-4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    libparted - a library for manipulating disk partitions
3
 
    Copyright (C) 2000 Free Software Foundation, Inc.
 
3
    Copyright (C) 2000, 2007 Free Software Foundation, Inc.
4
4
 
5
5
    This program is free software; you can redistribute it and/or modify
6
6
    it under the terms of the GNU General Public License as published by
7
 
    the Free Software Foundation; either version 2 of the License, or
 
7
    the Free Software Foundation; either version 3 of the License, or
8
8
    (at your option) any later version.
9
9
 
10
10
    This program is distributed in the hope that it will be useful,
13
13
    GNU General Public License for more details.
14
14
 
15
15
    You should have received a copy of the GNU General Public License
16
 
    along with this program; if not, write to the Free Software
17
 
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 
16
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
17
*/
19
18
 
20
19
/**
31
30
 * @{
32
31
 */
33
32
 
 
33
#include <config.h>
34
34
#include <stdlib.h>
35
35
#include <parted/parted.h>
36
36
#include <parted/debug.h>
74
74
        return sector - abs_mod (sector, grain_size);
75
75
}
76
76
 
77
 
inline PedSector
 
77
PedSector
78
78
ped_div_round_up (PedSector numerator, PedSector divisor)
79
79
{
80
 
                return (numerator + divisor - 1) / divisor;
 
80
        return (numerator + divisor - 1) / divisor;
81
81
}
82
82
 
83
 
inline PedSector
 
83
PedSector
84
84
ped_div_round_to_nearest (PedSector numerator, PedSector divisor)
85
85
{
86
 
                return (numerator + divisor/2) / divisor;
 
86
        return (numerator + divisor/2) / divisor;
87
87
}
88
88
 
89
89
/* Rounds a number up to the closest number that is a multiple of