From: Toni Wilen Date: Sat, 13 Sep 2014 17:21:54 +0000 (+0300) Subject: >1T drive size incorrect size display. X-Git-Tag: 3000~38 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=af430f62853ca081adce7408325b2d6901af34bd;p=francis%2Fwinuae.git >1T drive size incorrect size display. --- diff --git a/filesys.cpp b/filesys.cpp index aa8e8e19..0dc130c9 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -6952,7 +6952,7 @@ static void dump_partinfo (struct hardfiledata *hfd, uae_u8 *pp) spt, reserved, lowcyl, highcyl, (uae_u32)(size >> 20)); write_log (_T("Buffers: %d, BufMemType: %08x, MaxTransfer: %08x, Mask: %08x, BootPri: %d\n"), rl (pp + 44), rl (pp + 48), rl (pp + 52), rl (pp + 56), rl (pp + 60)); - write_log (_T("Total blocks: %d, Total disk blocks: %d\n"), surfaces * spt * (highcyl - lowcyl + 1), hfd->virtsize / blocksize); + write_log (_T("Total blocks: %lld, Total disk blocks: %lld\n"), (uae_s64)surfaces * spt * (highcyl - lowcyl + 1), hfd->virtsize / blocksize); if (hfd->drive_empty) { write_log (_T("Empty drive\n")); diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 23f9c67a..badcc363 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -2779,7 +2779,7 @@ int MultiDiskSelection (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *pr int multi = 0; return DiskSelection_2 (hDlg, wParam, flag, prefs, path_out, &multi); } -static int loopmulti (TCHAR *s, TCHAR *out) +static int loopmulti (const TCHAR *s, TCHAR *out) { static int index; @@ -2802,7 +2802,7 @@ static int loopmulti (TCHAR *s, TCHAR *out) return 1; } -static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, TCHAR *dostype, TCHAR *newpath, TCHAR *outpath) +static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, const TCHAR *dostype, TCHAR *newpath, TCHAR *outpath) { HANDLE hf; int i = 0; @@ -10306,7 +10306,7 @@ static void updatehdfinfo (HWND hDlg, bool force, bool defaults) { static uae_u64 bsize; static uae_u8 id[512]; - int blocks, cyls, i; + uae_u32 blocks, cyls, i; TCHAR tmp[200], tmp2[200]; TCHAR idtmp[17]; @@ -10346,7 +10346,7 @@ static void updatehdfinfo (HWND hDlg, bool force, bool defaults) } else { getchspgeometry (bsize, ¤t_hfdlg.ci.pcyls, ¤t_hfdlg.ci.pheads, ¤t_hfdlg.ci.psecs, false); } - } else if (current_hfdlg.ci.blocksize * current_hfdlg.ci.sectors * current_hfdlg.ci.surfaces) { + } else if (current_hfdlg.ci.blocksize && current_hfdlg.ci.sectors && current_hfdlg.ci.surfaces) { getchsgeometry_hdf (open ? &hfd : NULL, bsize, ¤t_hfdlg.ci.cyls, ¤t_hfdlg.ci.surfaces, ¤t_hfdlg.ci.sectors); current_hfdlg.original = 0; } @@ -10358,7 +10358,7 @@ static void updatehdfinfo (HWND hDlg, bool force, bool defaults) } cyls = current_hfdlg.forcedcylinders; - if (!cyls && current_hfdlg.ci.blocksize * current_hfdlg.ci.sectors * current_hfdlg.ci.surfaces) { + if (!cyls && current_hfdlg.ci.blocksize && current_hfdlg.ci.sectors && current_hfdlg.ci.surfaces) { cyls = bsize / (current_hfdlg.ci.blocksize * current_hfdlg.ci.sectors * current_hfdlg.ci.surfaces); } blocks = cyls * (current_hfdlg.ci.sectors * current_hfdlg.ci.surfaces);