From: krw Date: Fri, 20 Jan 2023 17:47:07 +0000 (+0000) Subject: editor_name() and get_mp() don't change the disklabel so X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=41d86e10ae027b1a1519e244c610e29c2e949173;p=openbsd editor_name() and get_mp() don't change the disklabel so const'ify some parameters and local variables. --- diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index a6cf8a934dd..b584c558d14 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.393 2023/01/20 14:35:43 krw Exp $ */ +/* $OpenBSD: editor.c,v 1.394 2023/01/20 17:47:07 krw Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller @@ -144,7 +144,7 @@ u_int64_t editor_countfree(const struct disklabel *); void editor_delete(struct disklabel *, const char *); void editor_help(void); void editor_modify(struct disklabel *, const char *); -void editor_name(struct disklabel *, const char *); +void editor_name(const struct disklabel *, const char *); char *getstring(const char *, const char *, const char *); u_int64_t getuint64(const struct disklabel *, char *, char *, u_int64_t, u_int64_t, int *); @@ -163,7 +163,7 @@ int get_bsize(struct disklabel *, int); int get_fsize(struct disklabel *, int); int get_cpg(struct disklabel *, int); int get_fstype(struct disklabel *, int); -int get_mp(struct disklabel *, int); +int get_mp(const struct disklabel *, int); int get_offset(struct disklabel *, int); int get_size(struct disklabel *, int); void zero_partitions(struct disklabel *); @@ -900,9 +900,9 @@ editor_add(struct disklabel *lp, const char *p) * Set the mountpoint of an existing partition ('name'). */ void -editor_name(struct disklabel *lp, const char *p) +editor_name(const struct disklabel *lp, const char *p) { - struct partition *pp; + const struct partition *pp; int partno; /* Change which partition? */ @@ -1985,9 +1985,9 @@ get_fstype(struct disklabel *lp, int partno) } int -get_mp(struct disklabel *lp, int partno) +get_mp(const struct disklabel *lp, int partno) { - struct partition *pp = &lp->d_partitions[partno]; + const struct partition *pp = &lp->d_partitions[partno]; char *p; int i;