From owner-svn-src-head@freebsd.org Tue Aug 20 20:04:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 355B4DA664; Tue, 20 Aug 2019 20:04:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ChZn0T7pz3LHs; Tue, 20 Aug 2019 20:04:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E60C88763; Tue, 20 Aug 2019 20:04:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7KK4GM7049513; Tue, 20 Aug 2019 20:04:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7KK4Ghw049512; Tue, 20 Aug 2019 20:04:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908202004.x7KK4Ghw049512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Aug 2019 20:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351275 - head/usr.sbin/makefs/msdos X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/makefs/msdos X-SVN-Commit-Revision: 351275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2019 20:04:17 -0000 Author: emaste Date: Tue Aug 20 20:04:16 2019 New Revision: 351275 URL: https://svnweb.freebsd.org/changeset/base/351275 Log: makefs: avoid "dereferencing 'void *' pointer" warnings On GCC 4.2.1 archs MFC with: r351273 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_fat.c Tue Aug 20 19:31:11 2019 (r351274) +++ head/usr.sbin/makefs/msdos/msdosfs_fat.c Tue Aug 20 20:04:16 2019 (r351275) @@ -220,9 +220,9 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp return (EIO); } if (FAT32(pmp)) - cn = getulong(&bp->b_data[bo]); + cn = getulong((char *)bp->b_data + bo); else - cn = getushort(&bp->b_data[bo]); + cn = getushort((char *)bp->b_data + bo); if (FAT12(pmp) && (prevcn & 1)) cn >>= 4; cn &= pmp->pm_fatmask; @@ -502,9 +502,9 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon if (function & FAT_GET) { if (FAT32(pmp)) - readcn = getulong(&bp->b_data[bo]); + readcn = getulong((char *)bp->b_data + bo); else - readcn = getushort(&bp->b_data[bo]); + readcn = getushort((char *)bp->b_data + bo); if (FAT12(pmp) & (cn & 1)) readcn >>= 4; readcn &= pmp->pm_fatmask; @@ -516,7 +516,7 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon if (function & FAT_SET) { switch (pmp->pm_fatmask) { case FAT12_MASK: - readcn = getushort(&bp->b_data[bo]); + readcn = getushort((char *)bp->b_data + bo); if (cn & 1) { readcn &= 0x000f; readcn |= newcontents << 4; @@ -524,20 +524,20 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon readcn &= 0xf000; readcn |= newcontents & 0xfff; } - putushort(&bp->b_data[bo], readcn); + putushort((char *)bp->b_data + bo, readcn); break; case FAT16_MASK: - putushort(&bp->b_data[bo], newcontents); + putushort((char *)bp->b_data + bo, newcontents); break; case FAT32_MASK: /* * According to spec we have to retain the * high order bits of the FAT entry. */ - readcn = getulong(&bp->b_data[bo]); + readcn = getulong((char *)bp->b_data + bo); readcn &= ~FAT32_MASK; readcn |= newcontents & FAT32_MASK; - putulong(&bp->b_data[bo], readcn); + putulong((char *)bp->b_data + bo, readcn); break; } updatefats(pmp, bp, bn); @@ -587,7 +587,7 @@ fatchain(struct msdosfsmount *pmp, u_long start, u_lon newc = --count > 0 ? start : fillwith; switch (pmp->pm_fatmask) { case FAT12_MASK: - readcn = getushort(&bp->b_data[bo]); + readcn = getushort((char *)bp->b_data + bo); if (start & 1) { readcn &= 0xf000; readcn |= newc & 0xfff; @@ -595,20 +595,20 @@ fatchain(struct msdosfsmount *pmp, u_long start, u_lon readcn &= 0x000f; readcn |= newc << 4; } - putushort(&bp->b_data[bo], readcn); + putushort((char *)bp->b_data + bo, readcn); bo++; if (!(start & 1)) bo++; break; case FAT16_MASK: - putushort(&bp->b_data[bo], newc); + putushort((char *)bp->b_data + bo, newc); bo += 2; break; case FAT32_MASK: - readcn = getulong(&bp->b_data[bo]); + readcn = getulong((char *)bp->b_data + bo); readcn &= ~pmp->pm_fatmask; readcn |= newc & pmp->pm_fatmask; - putulong(&bp->b_data[bo], readcn); + putulong((char *)bp->b_data + bo, readcn); bo += 4; break; } @@ -833,7 +833,7 @@ freeclusterchain(struct msdosfsmount *pmp, u_long clus usemap_free(pmp, cluster); switch (pmp->pm_fatmask) { case FAT12_MASK: - readcn = getushort(&bp->b_data[bo]); + readcn = getushort((char *)bp->b_data + bo); if (cluster & 1) { cluster = readcn >> 4; readcn &= 0x000f; @@ -843,15 +843,15 @@ freeclusterchain(struct msdosfsmount *pmp, u_long clus readcn &= 0xf000; readcn |= MSDOSFSFREE & 0xfff; } - putushort(&bp->b_data[bo], readcn); + putushort((char *)bp->b_data + bo, readcn); break; case FAT16_MASK: - cluster = getushort(&bp->b_data[bo]); - putushort(&bp->b_data[bo], MSDOSFSFREE); + cluster = getushort((char *)bp->b_data + bo); + putushort((char *)bp->b_data + bo, MSDOSFSFREE); break; case FAT32_MASK: - cluster = getulong(&bp->b_data[bo]); - putulong(&bp->b_data[bo], + cluster = getulong((char *)bp->b_data + bo); + putulong((char *)bp->b_data + bo, (MSDOSFSFREE & FAT32_MASK) | (cluster & ~FAT32_MASK)); break; } @@ -903,9 +903,9 @@ fillinusemap(struct msdosfsmount *pmp) } } if (FAT32(pmp)) - readcn = getulong(&bp->b_data[bo]); + readcn = getulong((char *)bp->b_data + bo); else - readcn = getushort(&bp->b_data[bo]); + readcn = getushort((char *)bp->b_data + bo); if (FAT12(pmp) && (cn & 1)) readcn >>= 4; readcn &= pmp->pm_fatmask;