SCP: Cleanup MinGW compile warnings

This commit is contained in:
Mark Pizzolato 2019-01-21 02:36:42 -08:00
parent ad40f57809
commit 3cca0cf90b
3 changed files with 5 additions and 32 deletions

View file

@ -4142,10 +4142,10 @@ VhdPathToHostPath (const char *szVhdPath,
char *c; char *c;
char *d = szHostPath; char *d = szHostPath;
strncpy (szHostPath, szVhdPath, HostPathSize-1); memmove (szHostPath, szVhdPath, HostPathSize);
szHostPath[HostPathSize-1] = '\0'; szHostPath[HostPathSize-1] = '\0';
#if defined(VMS) #if defined(VMS)
c = strchr (szVhdPath, ':'); c = strchr (szHostPath, ':');
if (*(c+1) != '\\') if (*(c+1) != '\\')
return NULL; return NULL;
*(c+1) = '['; *(c+1) = '[';

View file

@ -291,40 +291,12 @@ return (t_offset)(ftell (st));
int sim_fseeko (FILE *st, t_offset offset, int whence) int sim_fseeko (FILE *st, t_offset offset, int whence)
{ {
fpos_t fileaddr; return _fseeki64 (st, (__int64)offset, whence);
struct _stati64 statb;
switch (whence) {
case SEEK_SET:
fileaddr = (fpos_t)offset;
break;
case SEEK_END:
if (_fstati64 (_fileno (st), &statb))
return (-1);
fileaddr = statb.st_size + offset;
break;
case SEEK_CUR:
if (fgetpos (st, &fileaddr))
return (-1);
fileaddr = fileaddr + offset;
break;
default:
errno = EINVAL;
return (-1);
}
return fsetpos (st, &fileaddr);
} }
t_offset sim_ftell (FILE *st) t_offset sim_ftell (FILE *st)
{ {
fpos_t fileaddr; return (t_offset)_ftelli64 (st);
if (fgetpos (st, &fileaddr))
return (-1);
return (t_offset)fileaddr;
} }
#endif /* end Windows */ #endif /* end Windows */

View file

@ -1312,6 +1312,7 @@ switch (f) { /* case on format */
case MTUF_F_STD: /* standard */ case MTUF_F_STD: /* standard */
sbc = MTR_L ((bc + 1) & ~1); /* pad odd length */ sbc = MTR_L ((bc + 1) & ~1); /* pad odd length */
/* fall through into the E11 handler */
case MTUF_F_E11: /* E11 */ case MTUF_F_E11: /* E11 */
sim_fwrite (&bc, sizeof (t_mtrlnt), 1, uptr->fileref); sim_fwrite (&bc, sizeof (t_mtrlnt), 1, uptr->fileref);
sim_fwrite (buf, sizeof (uint8), sbc, uptr->fileref); sim_fwrite (buf, sizeof (uint8), sbc, uptr->fileref);