From f0c12e64ab2e17fae15f90624ec94b64f87793ff Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 3 May 2020 02:46:36 +0100 Subject: [PATCH] Fix compiling with Watcom 11. --- setter/src/dos.c | 14 +++++++------- setter/src/os2_16.c | 16 ++++++++-------- setter/src/os2_16.h | 13 ------------- setter/src/os2_32.c | 20 ++++++++++---------- 4 files changed, 25 insertions(+), 38 deletions(-) diff --git a/setter/src/dos.c b/setter/src/dos.c index 092a5ab..d55e8ec 100644 --- a/setter/src/dos.c +++ b/setter/src/dos.c @@ -1089,12 +1089,12 @@ void Links(const char *path) void MillionFiles(const char *path) { - char driveNo = path[0] - '@'; - int rc = 0; - char filename[9]; - unsigned long long pos = 0; - int handle; - unsigned total; + char driveNo = path[0] - '@'; + int rc = 0; + char filename[9]; + unsigned long pos = 0; + int handle; + unsigned total; if(driveNo > 32) driveNo -= 32; @@ -1113,7 +1113,7 @@ void MillionFiles(const char *path) printf("Creating lots of files.\n"); - for(pos = 0; pos < 100000ULL; pos++) + for(pos = 0; pos < 100000; pos++) { memset(&filename, 0, 9); sprintf(&filename, "%08llu", pos); diff --git a/setter/src/os2_16.c b/setter/src/os2_16.c index 65b732d..e55f61d 100644 --- a/setter/src/os2_16.c +++ b/setter/src/os2_16.c @@ -1670,12 +1670,12 @@ void Sparse(const char *path) void MillionFiles(const char *path) { - char drivePath[4]; - USHORT rc = 0; - char filename[9]; - unsigned long long pos = 0; - USHORT actionTaken = 0; - HFILE handle; + char drivePath[4]; + USHORT rc = 0; + char filename[9]; + unsigned long pos = 0; + USHORT actionTaken = 0; + HFILE handle; drivePath[0] = path[0]; drivePath[1] = ':'; @@ -1702,7 +1702,7 @@ void MillionFiles(const char *path) printf("Creating lots of files.\n"); - for(pos = 0; pos < 100000ULL; pos++) + for(pos = 0; pos < 100000; pos++) { memset(&filename, 0, 9); sprintf(&filename, "%08llu", pos); @@ -1719,7 +1719,7 @@ void MillionFiles(const char *path) DosClose(handle); } - printf("\tCreated %llu files\n", pos); + printf("\tCreated %lu files\n", pos); } void DeleteFiles(const char *path) diff --git a/setter/src/os2_16.h b/setter/src/os2_16.h index ab0f512..56ef354 100644 --- a/setter/src/os2_16.h +++ b/setter/src/os2_16.h @@ -44,19 +44,6 @@ Copyright (C) 2011-2020 Natalia Portillo #define FSAT_LOCALDRV 3 /* Local drive */ #define FSAT_REMOTEDRV 4 /* Remote drive attached to FSD */ -/* Cannot be used directly must be traversed manually, at least with OpenWatcom 1.8 */ -typedef struct _FSQBUFFER /* fsqbuf Data structure for QFSAttach */ -{ - USHORT iType; /* Item type */ - USHORT cbName; /* Length of item name, sans NULL */ - UCHAR szName[1]; /* ASCIIZ item name */ - USHORT cbFSDName; /* Length of FSD name, sans NULL */ - UCHAR szFSDName[1]; /* ASCIIZ FSD name */ - USHORT cbFSAData; /* Length of FSD Attach data returned */ - UCHAR rgFSAData[1]; /* FSD Attach data from FSD */ -} FSQBUFFER; -typedef FSQBUFFER *PFSQBUFFER; - unsigned char CommentsEA[72] = { 0x45, 0x00, 0x00, 0x00, 0x00, 0x09, 0x33, 0x00, 0x2E, 0x43, 0x4F, 0x4D, 0x4D, 0x45, 0x4E, 0x54, 0x53, 0x00, 0xFD, 0xFF, 0x2E, 0x00, 0x54, 0x68, 0x69, 0x73, 0x20, 0x45, 0x41, 0x20, 0x63, 0x6F, 0x6E, 0x74, 0x61, 0x69, diff --git a/setter/src/os2_32.c b/setter/src/os2_32.c index e79209d..3075c10 100644 --- a/setter/src/os2_32.c +++ b/setter/src/os2_32.c @@ -61,7 +61,7 @@ void GetOsInfo() return; } - if(aulBuffer[0] = 20) + if(aulBuffer[0] == 20) { MajorVer = aulBuffer[1] / 10; MinorVer = aulBuffer[1] % 10; @@ -1593,12 +1593,12 @@ void Links(const char *path) void MillionFiles(const char *path) { - char drivePath[4]; - APIRET rc = 0; - char filename[9]; - unsigned long long pos = 0; - ULONG actionTaken = 0; - HFILE handle; + char drivePath[4]; + APIRET rc = 0; + char filename[9]; + unsigned long pos = 0; + ULONG actionTaken = 0; + HFILE handle; drivePath[0] = path[0]; drivePath[1] = ':'; @@ -1625,10 +1625,10 @@ void MillionFiles(const char *path) printf("Creating lots of files.\n"); - for(pos = 0; pos < 100000ULL; pos++) + for(pos = 0; pos < 100000; pos++) { memset(&filename, 0, 9); - sprintf(&filename, "%08d", pos); + sprintf(&filename, "%08lu", pos); rc = DosOpen(&filename, &handle, &actionTaken, @@ -1642,7 +1642,7 @@ void MillionFiles(const char *path) DosClose(handle); } - printf("\tCreated %llu files\n", pos); + printf("\tCreated %lu files\n", pos); } void DeleteFiles(const char *path)