Module Name: src Committed By: kamil Date: Sat Feb 22 09:59:22 UTC 2020
Modified Files: src/sbin/fsck_msdos: boot.c Log Message: Avoid unportable shift construct boot.c:150:29, left shift of 255 by 24 places cannot be represented in type 'int' boot.c:153:29, left shift of 255 by 24 places cannot be represented in type 'int' To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sbin/fsck_msdos/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/fsck_msdos/boot.c diff -u src/sbin/fsck_msdos/boot.c:1.22 src/sbin/fsck_msdos/boot.c:1.23 --- src/sbin/fsck_msdos/boot.c:1.22 Sat Jan 11 16:29:07 2020 +++ src/sbin/fsck_msdos/boot.c Sat Feb 22 09:59:22 2020 @@ -27,7 +27,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: boot.c,v 1.22 2020/01/11 16:29:07 christos Exp $"); +__RCSID("$NetBSD: boot.c,v 1.23 2020/02/22 09:59:22 kamil Exp $"); #endif /* not lint */ #include <stdlib.h> @@ -81,8 +81,8 @@ readboot(int dosfs, struct bootblock *bo boot->FATsmall = block[22] + (block[23] << 8); boot->SecPerTrack = block[24] + (block[25] << 8); boot->Heads = block[26] + (block[27] << 8); - boot->HiddenSecs = block[28] + (block[29] << 8) + (block[30] << 16) + (block[31] << 24); - boot->HugeSectors = block[32] + (block[33] << 8) + (block[34] << 16) + (block[35] << 24); + boot->HiddenSecs = block[28] + (block[29] << 8) + (block[30] << 16) + ((uint32_t)block[31] << 24); + boot->HugeSectors = block[32] + (block[33] << 8) + (block[34] << 16) + ((uint32_t)block[35] << 24); boot->FATsecs = boot->FATsmall; @@ -90,7 +90,7 @@ readboot(int dosfs, struct bootblock *bo boot->flags |= FAT32; if (boot->flags & FAT32) { boot->FATsecs = block[36] + (block[37] << 8) - + (block[38] << 16) + (block[39] << 24); + + (block[38] << 16) + ((uint32_t)block[39] << 24); if (block[40] & 0x80) boot->ValidFat = block[40] & 0x0f; @@ -102,7 +102,7 @@ readboot(int dosfs, struct bootblock *bo return FSFATAL; } boot->RootCl = block[44] + (block[45] << 8) - + (block[46] << 16) + (block[47] << 24); + + (block[46] << 16) + ((uint32_t)block[47] << 24); boot->FSInfo = block[48] + (block[49] << 8); boot->Backup = block[50] + (block[51] << 8); @@ -147,10 +147,10 @@ readboot(int dosfs, struct bootblock *bo if (boot->FSInfo) { boot->FSFree = fsinfo[0x1e8] + (fsinfo[0x1e9] << 8) + (fsinfo[0x1ea] << 16) - + (fsinfo[0x1eb] << 24); + + ((uint32_t)fsinfo[0x1eb] << 24); boot->FSNext = fsinfo[0x1ec] + (fsinfo[0x1ed] << 8) + (fsinfo[0x1ee] << 16) - + (fsinfo[0x1ef] << 24); + + ((uint32_t)fsinfo[0x1ef] << 24); } if (lseek(dosfs, boot->Backup * boot->BytesPerSec, SEEK_SET)