Re: [LAU] sfArk for Linux - git repo access

From: Tito Latini <tito.01beta@email-addr-hidden>
Date: Sun Sep 21 2014 - 20:42:03 EEST

On Sun, Sep 21, 2014 at 09:26:13AM -0400, jonetsu@email-addr-hidden wrote:
> Le dimanche, 21 Sep 2014 14:40:22 +0200,
> Edgar Aichinger <edogawa@email-addr-hidden> a écrit :
>
> > Am Sonntag, 21. September 2014, 14:24:07 schrieb Pedro
> > Lopez-Cabanillas:
> > >
> > > I can confirm this behaviour when the program is compiled for 64
> > > bits, but seems to work for 32 bit. Looks like a bug in the
> > > program, which has not been properly ported from MS VC++ to GCC/G++.
> >
> > I can confirm that too for 64bit, but FWIW running this
> > http://melodymachine.com/sfark.htm in wine got the soundfonts
> > extracted, just to let you know in case running non-oss windows
> > programs is an option...
>
> Many thanks for the replies ! I haven't tried the 32-bit way yet, so I
> can do that using a 32-bit Mint VM.
>
> I just tried now by coincidence the Windows version from melodymachine
> using wine, and although it installs OK (I presume, even though it is
> in C:\Program Files where ever that really is in Linux !), and although
> it is possible to use the GUI to navigate to a soundfile (way out there
> somewhere else on the Linux machine) and double-click it, the program
> will report 'file not found'. I'm surely missing something fundamental
> about how wine/Windows apps works in Linux.

The follow patch fixes the problem:

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;
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Mon Sep 22 00:15:02 2014

This archive was generated by hypermail 2.1.8 : Mon Sep 22 2014 - 00:15:02 EEST