Module Name:    src
Committed By:   mrg
Date:           Wed Jul  6 01:19:45 UTC 2011

Modified Files:
        src/sys/arch/landisk/stand/boot: biosdisk.c

Log Message:
avoid a "multi-level non-const cast" warning from GCC 4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/landisk/stand/boot/biosdisk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/landisk/stand/boot/biosdisk.c
diff -u src/sys/arch/landisk/stand/boot/biosdisk.c:1.1 src/sys/arch/landisk/stand/boot/biosdisk.c:1.2
--- src/sys/arch/landisk/stand/boot/biosdisk.c:1.1	Fri Sep  1 21:26:18 2006
+++ src/sys/arch/landisk/stand/boot/biosdisk.c	Wed Jul  6 01:19:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.1 2006/09/01 21:26:18 uwe Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.2 2011/07/06 01:19:45 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -133,6 +133,7 @@
 static int
 read_label(struct biosdisk *d)
 {
+	struct mbr_sector *mbr_sect;
 	struct disklabel dflt_lbl;
 	struct mbr_partition mbr[MBR_PART_COUNT];
 	struct partition *p;
@@ -158,13 +159,15 @@
 	for (;;) {
 		this_ext = ext_base + next_ext;
 		next_ext = 0;
+		mbr_sect = (struct mbr_sector *)d->buf;
+		memcpy(&mbr, mbr_sect->mbr_parts, sizeof(mbr));
 		if (readsects(d->dev, this_ext, d->buf, 1)) {
 #ifdef DISK_DEBUG
 			printf("error reading MBR sector %d\n", this_ext);
 #endif
 			return (EIO);
 		}
-		memcpy(&mbr, ((struct mbr_sector *)d->buf)->mbr_parts, sizeof(mbr));
+		memcpy(&mbr, mbr_sect->mbr_parts, sizeof(mbr));
 		/* Look for NetBSD partition ID */
 		for (i = 0; i < MBR_PART_COUNT; i++) {
 			typ = mbr[i].mbrp_type;

Reply via email to