Module Name: src Committed By: tsutsui Date: Mon Nov 24 07:34:45 UTC 2014
Modified Files: src/sys/arch/atari/stand/installboot: installboot.c Log Message: Revert previous again. There are claims that it still violates strict-aliasing rule and it is no sense to just appease compiler by incorrect implementation. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/atari/stand/installboot/installboot.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/atari/stand/installboot/installboot.c diff -u src/sys/arch/atari/stand/installboot/installboot.c:1.32 src/sys/arch/atari/stand/installboot/installboot.c:1.33 --- src/sys/arch/atari/stand/installboot/installboot.c:1.32 Sun Nov 16 13:47:52 2014 +++ src/sys/arch/atari/stand/installboot/installboot.c Mon Nov 24 07:34:45 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.c,v 1.32 2014/11/16 13:47:52 tsutsui Exp $ */ +/* $NetBSD: installboot.c,v 1.33 2014/11/24 07:34:45 tsutsui Exp $ */ /* * Copyright (c) 1995 Waldi Ravens @@ -467,10 +467,6 @@ mkbootblock(struct bootblock *bb, char * struct disklabel *label, u_int magic) { int fd; - union { - struct bootblock *bbp; - uint16_t *word; /* to fill cksum word */ - } bbsec; memset(bb, 0, sizeof(*bb)); @@ -502,9 +498,8 @@ mkbootblock(struct bootblock *bb, char * setIDEpar(bb->bb_xxboot, sizeof(bb->bb_xxboot)); /* set AHDI checksum */ - bbsec.bbp = bb; - bbsec.word[255] = 0; - bbsec.word[255] = 0x1234 - abcksum(bb->bb_xxboot); + *((u_int16_t *)bb->bb_xxboot + 255) = 0; + *((u_int16_t *)bb->bb_xxboot + 255) = 0x1234 - abcksum(bb->bb_xxboot); if (verbose) { printf("Primary boot loader: %s\n", xxb);