I tried it locally, and the patch worked great. But I don't have context on other possible implications.
diff -ur sfArkLib~/sfklCoding.cpp sfArkLib/sfklCoding.cpp
--- sfArkLib~/sfklCoding.cpp 2013-12-19 00:07:11.000000000 +0100
+++ sfArkLib/sfklCoding.cpp 2014-09-21 19:29:35.925453244 +0200
@@ -633,7 +633,7 @@
if (n <= 0 || n > ZBUF_SIZE) // Check for valid block length
{
- sprintf(MsgTxt, "ERROR - Invalid length for %s file (apparently %ld bytes) %s", FileExt, n, CorruptedMsg);
+ sprintf(MsgTxt, "ERROR - Invalid length for %s file (apparently %d bytes) %s", FileExt, n, CorruptedMsg);
msg(MsgTxt, MSG_PopUp);
GlobalErrorFlag = SFARKLIB_ERR_CORRUPT;
return false;
@@ -833,7 +833,7 @@
return EndProcess(GlobalErrorFlag);
}
- sprintf(MsgTxt, "Created %s (%ld kb) successfully.", ReqOutFileName, Blk.TotBytesWritten/1024);
+ sprintf(MsgTxt, "Created %s (%d kb) successfully.", ReqOutFileName, Blk.TotBytesWritten/1024);
msg(MsgTxt, 0);
return EndProcess(GlobalErrorFlag);
diff -ur sfArkLib~/sfklZip.cpp sfArkLib/sfklZip.cpp
--- sfArkLib~/sfklZip.cpp 2013-12-19 00:07:11.000000000 +0100
+++ sfArkLib/sfklZip.cpp 2014-09-21 19:28:37.014193859 +0200
@@ -26,7 +26,7 @@
ULONG UnMemcomp(const BYTE *InBuf, int InBytes, BYTE *OutBuf, int OutBufLen)
{
// Uncompress buffer using ZLIBs uncompress function...
- ULONG OutBytes = OutBufLen;
+ unsigned long OutBytes = OutBufLen;
int Result = uncompress(OutBuf, &OutBytes, InBuf, InBytes);
if (Result != Z_OK) // uncompress failed?
{
diff -ur sfArkLib~/wcc.h sfArkLib/wcc.h
--- sfArkLib~/wcc.h 2013-12-19 00:07:11.000000000 +0100
+++ sfArkLib/wcc.h 2014-09-21 19:28:37.015193847 +0200
@@ -67,13 +67,13 @@
// ----- typdefs -----
typedef unsigned short USHORT;
typedef unsigned char BYTE;
-typedef unsigned long ULONG;
+typedef unsigned int ULONG;
//typedef int bool;
typedef short AWORD; // Audio word (i.e., 16-bit audio)
typedef unsigned short UAWORD;
-typedef long LAWORD; // "long" audio word i.e. 32 bits
-typedef unsigned long ULAWORD;
+typedef int LAWORD; // "long" audio word i.e. 32 bits
+typedef unsigned int ULAWORD;
// Types used by Bit I/O (BIO) routines...
typedef USHORT BIOWORD;