-/* $OpenBSD: cmd.c,v 1.165 2022/09/11 11:47:55 krw Exp $ */
+/* $OpenBSD: cmd.c,v 1.166 2023/03/04 14:47:18 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
int ask_num(const char *, int, int, int);
int ask_pid(const int);
-struct uuid *ask_uuid(const struct uuid *);
+const struct uuid *ask_uuid(const struct uuid *);
extern const unsigned char manpage[];
extern const int manpage_sz;
}
}
-struct uuid *
+const struct uuid *
ask_uuid(const struct uuid *olduuid)
{
static struct uuid uuid;
-/* $OpenBSD: gpt.c,v 1.83 2022/09/15 15:05:58 krw Exp $ */
+/* $OpenBSD: gpt.c,v 1.84 2023/03/04 14:47:18 krw Exp $ */
/*
* Copyright (c) 2015 Markus Muller <mmu@grummel.net>
* Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org>
struct gpt_header gh;
struct gpt_partition gp[NGPTPARTITIONS];
-struct gpt_partition **sort_gpt(void);
+const struct gpt_partition * const *sort_gpt(void);
int lba_start_cmp(const void *e1, const void *e2);
int lba_free(uint64_t *, uint64_t *);
int add_partition(const uint8_t *, const char *, uint64_t);
return 0;
}
-struct gpt_partition **
+const struct gpt_partition * const *
sort_gpt(void)
{
- static struct gpt_partition *sgp[NGPTPARTITIONS+2];
- unsigned int i, pn;
+ static const struct gpt_partition *sgp[NGPTPARTITIONS+2];
+ unsigned int i, pn;
memset(sgp, 0, sizeof(sgp));
int
lba_free(uint64_t *start, uint64_t *end)
{
- struct gpt_partition **sgp;
- uint64_t bs, bigbs, nextbs, ns;
- unsigned int i;
+ const struct gpt_partition * const *sgp;
+ uint64_t bs, bigbs, nextbs, ns;
+ unsigned int i;
sgp = sort_gpt();
if (sgp == NULL)
int
GPT_get_lba_end(const unsigned int pn)
{
- struct gpt_partition **sgp;
- uint64_t bs, nextbs, ns;
- unsigned int i;
+ const struct gpt_partition * const *sgp;
+ uint64_t bs, nextbs, ns;
+ unsigned int i;
sgp = sort_gpt();
if (sgp == NULL)