diff options
author | phk <phk@FreeBSD.org> | 2002-10-22 09:13:02 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-10-22 09:13:02 +0000 |
commit | 43441f1d037b19165e361f523d20669b6b11bc25 (patch) | |
tree | 8378d0fbd151285dc2443b78fe8c309a83a37602 /lib/libdisk/chunk.c | |
parent | 0cb4cfe3c6f594f0eb38c72c07c77d99b45b3f63 (diff) | |
download | FreeBSD-src-43441f1d037b19165e361f523d20669b6b11bc25.zip FreeBSD-src-43441f1d037b19165e361f523d20669b6b11bc25.tar.gz |
Swing the weed-whacker around libdisk:
Constify some things.
Staticize some things.
Remove some unused things.
Prototype some things.
Don't install a gazillion man-pages links.
Drop support for ON-TRACK disk-manager.
Diffstat (limited to 'lib/libdisk/chunk.c')
-rw-r--r-- | lib/libdisk/chunk.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/libdisk/chunk.c b/lib/libdisk/chunk.c index fd4b0f3..8434f6b 100644 --- a/lib/libdisk/chunk.c +++ b/lib/libdisk/chunk.c @@ -18,12 +18,22 @@ __FBSDID("$FreeBSD$"); #include <err.h> #include "libdisk.h" -#define new_chunk() memset(malloc(sizeof(struct chunk)), 0, sizeof(struct chunk)) +static struct chunk * +new_chunk(void) +{ + struct chunk *c; + + c = malloc(sizeof *c); + if (c == NULL) + err(1, "malloc"); + memset(c, 0, sizeof *c); + return (c); +} /* Is c2 completely inside c1 ? */ static int -Chunk_Inside(struct chunk *c1, struct chunk *c2) +Chunk_Inside(const struct chunk *c1, const struct chunk *c2) { /* if c1 ends before c2 do */ if (c1->end < c2->end) @@ -34,7 +44,7 @@ Chunk_Inside(struct chunk *c1, struct chunk *c2) return 1; } -struct chunk * +static struct chunk * Find_Mother_Chunk(struct chunk *chunks, u_long offset, u_long end, chunk_e type) { struct chunk *c1,*c2,ct; @@ -92,7 +102,7 @@ Free_Chunk(struct chunk *c1) } struct chunk * -Clone_Chunk(struct chunk *c1) +Clone_Chunk(const struct chunk *c1) { struct chunk *c2; @@ -112,7 +122,7 @@ Clone_Chunk(struct chunk *c1) return c2; } -int +static int #ifdef PC98 Insert_Chunk(struct chunk *c2, u_long offset, u_long size, const char *name, chunk_e type, int subtype, u_long flags, const char *sname) |