]> Shamusworld >> Repos - wozmaker/commitdiff
Small bugfix & fix for cross-platform compilation.
authorShamus Hammons <jlhamm@acm.org>
Fri, 4 Jan 2019 01:15:45 +0000 (19:15 -0600)
committerShamus Hammons <jlhamm@acm.org>
Fri, 4 Jan 2019 01:15:45 +0000 (19:15 -0600)
src/analysisthread.cpp
src/fileio.cpp

index 138da3ad75c874fa5998c41edd8d7fcc9ee4ed4c..2a909ae982aa52aac513e49fddf6fab09014f86e 100644 (file)
@@ -53,7 +53,7 @@ void AnalysisThread::run()
        for(uint32_t i=0; i<141; i+=4)
        {
                SynthesizeTrack(i);
-               int a = random() & 0x03;
+               int a = rand() & 0x03;
                Global::trackStatus[i] = (a == 0 ? 3 : a);
                emit(ShowTracks());
        }
@@ -65,7 +65,7 @@ void AnalysisThread::run()
                        continue;
 
                SynthesizeTrack(i);
-               int a = random() & 0x03;
+               int a = rand() & 0x03;
                Global::trackStatus[i] = (a == 0 ? 3 : a);
                emit(ShowTracks());
        }
index c3718c367bc886149dc01aea3510885c54c993cb..3261c2c95d58c38902d49529fae1ee7e3e2e53e1 100644 (file)
@@ -271,8 +271,8 @@ bool WriteWOZFile(const char * filename)
                woz->track[i].bitCount = Uint16LE(Global::bStreamLenBits[i]);
                startBlock += blockLen;
 
-               if (blockCount > largestBlock)
-                       largestBlock = blockCount;
+               if (blockLen > largestBlock)
+                       largestBlock = blockLen;
        }
 
        woz->largestTrack = Uint16LE(largestBlock);