Module Name: src Committed By: kre Date: Thu Feb 9 04:37:35 UTC 2017
Modified Files: src/sys/ufs/ffs: ffs_bswap.c ffs_extern.h Log Message: Sprinkle in a pinch of const, not too much, just enough to add a little strength without affecting the overall balance... To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/ufs/ffs/ffs_bswap.c cvs rdiff -u -r1.83 -r1.84 src/sys/ufs/ffs/ffs_extern.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/ufs/ffs/ffs_bswap.c diff -u src/sys/ufs/ffs/ffs_bswap.c:1.39 src/sys/ufs/ffs/ffs_bswap.c:1.40 --- src/sys/ufs/ffs/ffs_bswap.c:1.39 Wed May 20 18:21:17 2015 +++ src/sys/ufs/ffs/ffs_bswap.c Thu Feb 9 04:37:35 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_bswap.c,v 1.39 2015/05/20 18:21:17 riastradh Exp $ */ +/* $NetBSD: ffs_bswap.c,v 1.40 2017/02/09 04:37:35 kre Exp $ */ /* * Copyright (c) 1998 Manuel Bouyer. @@ -30,7 +30,7 @@ #endif #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ffs_bswap.c,v 1.39 2015/05/20 18:21:17 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ffs_bswap.c,v 1.40 2017/02/09 04:37:35 kre Exp $"); #include <sys/param.h> #if defined(_KERNEL) @@ -52,17 +52,18 @@ __KERNEL_RCSID(0, "$NetBSD: ffs_bswap.c, #endif void -ffs_sb_swap(struct fs *o, struct fs *n) +ffs_sb_swap(const struct fs *o, struct fs *n) { size_t i; - u_int32_t *o32, *n32; + const u_int32_t *o32; + u_int32_t *n32; /* * In order to avoid a lot of lines, as the first N fields (52) * of the superblock up to fs_fmod are u_int32_t, we just loop * here to convert them. */ - o32 = (u_int32_t *)o; + o32 = (const u_int32_t *)o; n32 = (u_int32_t *)n; for (i = 0; i < offsetof(struct fs, fs_fmod) / sizeof(u_int32_t); i++) n32[i] = bswap32(o32[i]); @@ -178,7 +179,7 @@ ffs_csum_swap(struct csum *o, struct csu } void -ffs_csumtotal_swap(struct csum_total *o, struct csum_total *n) +ffs_csumtotal_swap(const struct csum_total *o, struct csum_total *n) { n->cs_ndir = bswap64(o->cs_ndir); n->cs_nbfree = bswap64(o->cs_nbfree); Index: src/sys/ufs/ffs/ffs_extern.h diff -u src/sys/ufs/ffs/ffs_extern.h:1.83 src/sys/ufs/ffs/ffs_extern.h:1.84 --- src/sys/ufs/ffs/ffs_extern.h:1.83 Sat Oct 1 13:15:45 2016 +++ src/sys/ufs/ffs/ffs_extern.h Thu Feb 9 04:37:35 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_extern.h,v 1.83 2016/10/01 13:15:45 jdolecek Exp $ */ +/* $NetBSD: ffs_extern.h,v 1.84 2017/02/09 04:37:35 kre Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -186,13 +186,13 @@ void ffs_appleufs_set(struct appleufslab uint64_t); /* ffs_bswap.c */ -void ffs_sb_swap(struct fs*, struct fs *); +void ffs_sb_swap(const struct fs *, struct fs *); void ffs_dinode1_swap(struct ufs1_dinode *, struct ufs1_dinode *); void ffs_dinode2_swap(struct ufs2_dinode *, struct ufs2_dinode *); struct csum; void ffs_csum_swap(struct csum *, struct csum *, int); struct csum_total; -void ffs_csumtotal_swap(struct csum_total *, struct csum_total *); +void ffs_csumtotal_swap(const struct csum_total *, struct csum_total *); void ffs_cg_swap(struct cg *, struct cg *, struct fs *); /* ffs_subr.c */