Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/common/lib/libutil - fix boot block building (-D_STANDALONE)
details: https://anonhg.NetBSD.org/src/rev/4cfbda54fe3a
branches: trunk
changeset: 771212:4cfbda54fe3a
user: christos <christos%NetBSD.org@localhost>
date: Mon Nov 14 14:36:40 2011 +0000
description:
- fix boot block building (-D_STANDALONE)
- explain why we cast.
diffstat:
common/lib/libutil/getfstypename.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diffs (45 lines):
diff -r 1dad897120a5 -r 4cfbda54fe3a common/lib/libutil/getfstypename.c
--- a/common/lib/libutil/getfstypename.c Mon Nov 14 13:29:07 2011 +0000
+++ b/common/lib/libutil/getfstypename.c Mon Nov 14 14:36:40 2011 +0000
@@ -34,25 +34,29 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-#ifndef _KERNEL
+#if !defined(_KERNEL) && !defined(_STANDALONE)
# if !defined(lint)
-__RCSID("$NetBSD: getfstypename.c,v 1.2 2011/11/13 22:21:29 christos Exp $");
+__RCSID("$NetBSD: getfstypename.c,v 1.3 2011/11/14 14:36:40 christos Exp $");
# endif
#else
-__KERNEL_RCSID(0, "$NetBSD: getfstypename.c,v 1.2 2011/11/13 22:21:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: getfstypename.c,v 1.3 2011/11/14 14:36:40 christos Exp $");
#endif
#define FSTYPE_ENUMNAME fstype_enum
#include <sys/types.h>
#include <sys/disk.h>
#include <sys/disklabel.h>
-#ifndef _KERNEL
+#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <util.h>
#endif
const char *
getfstypename(int fstype)
{
+ /*
+ * The cast is so that the compiler can check that we
+ * cover all the enum values
+ */
switch ((enum fstype_enum)fstype) {
case FS_UNUSED:
return DKW_PTYPE_UNUSED;
@@ -115,6 +119,6 @@
case FSMAXTYPES:
return DKW_PTYPE_UNKNOWN;
}
- /* Stupid gcc */
+ /* Stupid gcc, should know it is impossible to get here */
return DKW_PTYPE_UNKNOWN;
}
Home |
Main Index |
Thread Index |
Old Index