-/* $OpenBSD: editor.c,v 1.385 2023/01/04 21:08:08 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.386 2023/01/05 00:19:53 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <millert@openbsd.org>
void find_bounds(const struct disklabel *);
void set_bounds(struct disklabel *);
void set_duid(struct disklabel *);
-struct diskchunk *free_chunks(const struct disklabel *, int);
+const struct diskchunk *free_chunks(const struct disklabel *, int);
int micmp(const void *, const void *);
int mpequal(char **, char **);
int get_bsize(struct disklabel *, int);
struct space_allocation *alloc;
struct space_allocation *ap;
struct partition *pp;
- struct diskchunk *chunk;
+ const struct diskchunk *chunk;
u_int64_t chunkstart, chunkstop, chunksize;
u_int64_t cylsecs, secs, xtrasecs;
char **partmp;
editor_add(struct disklabel *lp, char *p)
{
struct partition *pp;
- struct diskchunk *chunk;
+ const struct diskchunk *chunk;
char buf[2];
int partno;
u_int64_t freesectors, new_offset, new_size;
/*
* Return a list of the "chunks" of free space available
*/
-struct diskchunk *
+const struct diskchunk *
free_chunks(const struct disklabel *lp, int partno)
{
const struct partition **spp;
u_int64_t
max_partition_size(const struct disklabel *lp, int partno)
{
- struct diskchunk *chunk;
+ const struct diskchunk *chunk;
u_int64_t maxsize = 0, offset;
chunk = free_chunks(lp, partno);
u_int64_t stopalign, int flags)
{
struct partition *pp = &lp->d_partitions[partno];
- struct diskchunk *chunk;
+ const struct diskchunk *chunk;
u_int64_t start, stop, maxstop;
start = DL_GETPOFFSET(pp);